(defun gnus-update-format-specifications (&optional force &rest types)
"Update all (necessary) format specifications."
;; Make the indentation array.
-
;; See whether all the stored info needs to be flushed.
(when (or force
(not (equal emacs-version
(setq new-format (symbol-value
(intern (format "gnus-%s-line-format" type))))))
(setq entry (cdr (assq type gnus-format-specs)))
- (if (and entry
+ (if (and (car entry)
(equal (car entry) new-format))
;; Use the old format.
(set (intern (format "gnus-%s-line-format-spec" type))
(if (> (length val) ,cut)
,(if (< cut-width 0)
`(substring val 0 (- (length val) ,cut))
- `(substring va 0 ,cut))
+ `(substring val ,cut))
val)))))
(defun gnus-tilde-ignore-form (el ignore-value)
;; SPEC-ALIST and returns a list that can be eval'ed to return a
;; string.
(let ((max-width 0)
- spec flist fstring newspec elem beg result dontinsert user-defined
- type spec value pad-width spec-beg cut-width ignore-value
+ spec flist fstring elem result dontinsert user-defined
+ type value pad-width spec-beg cut-width ignore-value
tilde-form tilde elem-type)
(save-excursion
(gnus-set-work-buffer)
(setq pad-width value))
((eq type 'pad-right)
(setq pad-width (- value)))
- ((eq type 'max)
+ ((memq type '(max-right max))
(setq max-width value))
+ ((eq type 'max-left)
+ (setq max-width (- value)))
((memq type '(cut cut-left))
(setq cut-width value))
((eq type 'cut-right)
t)
(t
nil)))
+ ;; User-defined spec -- find the spec name.
(when (= (setq spec (following-char)) ?u)
(forward-char 1)
(setq user-defined (following-char)))
"Byte-compile the user-defined format specs."
(interactive)
(let ((entries gnus-format-specs)
+ (byte-compile-warnings '(unresolved callargs redefine))
entry gnus-tmp-func)
(save-excursion
(gnus-message 7 "Compiling format specs...")
(setq gnus-format-specs (delq entry gnus-format-specs))
(when (and (listp (caddr entry))
(not (eq 'byte-code (caaddr entry))))
- (fset 'gnus-tmp-func
- `(lambda () ,(caddr entry)))
+ (fset 'gnus-tmp-func `(lambda () ,(caddr entry)))
(byte-compile 'gnus-tmp-func)
(setcar (cddr entry) (gnus-byte-code 'gnus-tmp-func)))))