From: yamaoka Date: Fri, 11 Jan 2002 08:48:22 +0000 (+0000) Subject: * gnus.el (gnus-product-variable-file-list): Add a check for the value of X-Git-Tag: t-gnus-6_15_5-02-quimby~16 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b2b24e3b0adcf6978cebe9e580091579114ae2ea;p=elisp%2Fgnus.git- * gnus.el (gnus-product-variable-file-list): Add a check for the value of `gnus-use-correct-string-widths' in the forms. * gnus-start.el (gnus-product-quick-file-format): Include the value of `gnus-use-correct-string-widths' in the file form. (gnus-product-read-variable-file-1): Check for the equality in the value of `gnus-use-correct-string-widths' as well. --- diff --git a/ChangeLog b/ChangeLog index 81ceb22..07e9b4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-01-11 Katsumi Yamaoka + + * lisp/gnus.el (gnus-product-variable-file-list): Add a check for + the value of `gnus-use-correct-string-widths' in the forms. + + * lisp/gnus-start.el (gnus-product-quick-file-format): Include the + value of `gnus-use-correct-string-widths' in the file form. + (gnus-product-read-variable-file-1): Check for the equality in the + value of `gnus-use-correct-string-widths' as well. + 2002-01-10 Katsumi Yamaoka * lisp/gnus-vers.el (gnus-revision-number): Increment to 01 in diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index acf810b..0906d08 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -2144,24 +2144,36 @@ The backup file \".newsrc.eld_\" will be created before re-reading." (defun gnus-product-read-variable-file-1 (file checking-methods coding &rest variables) (let (error gnus-product-file-version method file-ver) - (when (or - (condition-case err - (let ((coding-system-for-read coding) - (input-coding-system coding)) - (load (expand-file-name file gnus-product-directory) t nil t) - nil) - (error - (message "%s" err) - (setq error t))) - (and (assq 'emacs-version checking-methods) - (not (string= emacs-version + (when (or (condition-case err + (let ((coding-system-for-read coding) + (input-coding-system coding)) + (load (expand-file-name file gnus-product-directory) + nil nil t) + nil) + (error + (message "Error while reading %s: %s" + (expand-file-name file gnus-product-directory) + (error-message-string err)) + (setq error t))) + (and (setq method (assq 'product-version checking-methods)) + (not (and (setq file-ver + (cdr (assq 'product-version + gnus-product-file-version))) + (zerop (product-version-compare file-ver + (cadr method)))))) + (and (assq 'emacs-version checking-methods) + (not (and (assq 'emacs-version gnus-product-file-version) + (string-equal + emacs-version (cdr (assq 'emacs-version - gnus-product-file-version))))) - (and (setq method (assq 'product-version checking-methods)) - (or (not (setq file-ver - (cdr (assq 'product-version - gnus-product-file-version)))) - (< (product-version-compare file-ver (cadr method)) 0)))) + gnus-product-file-version)))))) + (and (assq 'correct-string-widths checking-methods) + (not (and (assq 'correct-string-widths + gnus-product-file-version) + (eq (and gnus-use-correct-string-widths t) + (and (cdr (assq 'correct-string-widths + gnus-product-file-version)) + t)))))) (unless error (message "\"%s\" seems to have mismatched contents, updating..." file)) @@ -2615,7 +2627,7 @@ The backup file \".newsrc.eld_\" will be created before re-reading." "Insert gnus product depend variables in lisp format." (let ((print-quoted t) (print-escape-newlines t) - variable param) + print-length print-level variable param) (insert (format ";; -*- Mode: emacs-lisp; coding: %s -*-\n" coding)) (insert (format ";; %s startup file.\n" (product-name product))) (when (setq param (cdr (assq 'product-version checking-methods))) @@ -2628,7 +2640,11 @@ The backup file \".newsrc.eld_\" will be created before re-reading." (insert "(setq gnus-product-file-version \n" " '((product-version . " (prin1-to-string (product-version product)) ")\n" - "\t(emacs-version . " (prin1-to-string emacs-version) ")))\n") + "\t(emacs-version . " + (prin1-to-string emacs-version) ")\n" + "\t(correct-string-widths . " + (if gnus-use-correct-string-widths "t" "nil") + ")))\n") (while variables (when (and (boundp (setq variable (pop variables))) (symbol-value variable)) diff --git a/lisp/gnus.el b/lisp/gnus.el index d3aa8e3..2853334 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1952,13 +1952,29 @@ This variable can be nil, gnus or gnus-ja." (defvar gnus-product-variable-file-list (let ((version (product-version (product-find 'gnus-vers))) (codesys (static-if (boundp 'MULE) '*ctext* 'ctext))) - `(("strict-cache" ((product-version ,version) (emacs-version)) + `(("strict-cache" + ((product-version ,version) + (emacs-version) + (correct-string-widths)) binary gnus-format-specs-compiled) - ("cache" ((product-version ,version) (emacs-version)) + ("cache" + ((product-version ,version) + (emacs-version) + (correct-string-widths)) ,codesys gnus-format-specs))) - "Gnus variables are saved in the produce depend quick startup files.") + "Alist of the methods for checking whether the contents of the T-gnus +quick startup files are valid. One is for the byte-compiled format +specifications, the other is for the source form. Each element should +be a list which looks like follows: + +\(\"FILE_NAME\" + ((VARIABLE EXPECTED_VALUE_or_NIL) + (VARIABLE EXPECTED_VALUE_or_NIL) + ...) + CODING-SYSTEM_FOR_READING_FILE + SYMBOL_OF_FORMAT_SPECS)") (defcustom gnus-compile-user-specs t "If non-nil, the user-defined format specs will be byte-compiled