+ (insert (gnus-pp-to-string spec))))
+
+(eval-when-compile (defvar unchanged))
+
+(put 'gnus-search-or-regist-spec 'lisp-indent-function 4)
+(defmacro gnus-search-or-regist-spec (specs type format val &rest body)
+ `(let* ((entry (assq ,type ,specs))
+ (elem (assoc ,format (cdr entry))))
+ ;; That `(cdr elem)' returns non-nil means the spec for `type'
+ ;; doesn't need to be updated.
+ (or (cdr elem)
+ ;; This variable is set beforehand.
+ (setq unchanged nil)
+ ;; Update the spec. Where `body' will modify `val'. This
+ ;; section will be skipped if compiling the spec is disabled.
+ (when (progn ,@body)
+ (if entry
+ (if elem
+ (setcdr elem ,val)
+ (setcdr entry (cons (cons ,format ,val) (cdr entry))))
+ (push (list ,type (cons ,format ,val)) ,specs))
+ (gnus-product-variable-touch (quote ,specs)))
+ ;; Return the new spec without compiling.
+ ,val)))
+
+(defun gnus-update-format-specification-1 (type format val)
+ (set (intern (format "gnus-%s-line-format-spec" type))
+ (gnus-search-or-regist-spec
+ gnus-format-specs-compiled type format val
+ (when (and gnus-compile-user-specs val)
+ (setq val (prog1
+ (progn
+ (fset 'gnus-tmp-func `(lambda () ,val))
+ (require 'bytecomp)
+ (let (byte-compile-warnings)
+ (byte-compile 'gnus-tmp-func))
+ (gnus-byte-code 'gnus-tmp-func))
+ (when (get-buffer "*Compile-Log*")
+ (bury-buffer "*Compile-Log*"))
+ (when (get-buffer "*Compile-Log-Show*")
+ (bury-buffer "*Compile-Log-Show*"))))))))