From 29d5f44c1b8941959c487877893196ec52b3a969 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 11 Jan 2002 08:48:16 +0000 Subject: [PATCH] * 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. --- ChangeLog | 10 ++++++++++ lisp/gnus-start.el | 54 ++++++++++++++++++++++++++++++++++------------------ lisp/gnus.el | 22 ++++++++++++++++++--- 3 files changed, 64 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b86b60..7085f3f 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 11 in diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index b570854..a5d2904 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -2153,24 +2153,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)) @@ -2624,7 +2636,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))) @@ -2637,7 +2649,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 20f53e2..20ac952 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1941,13 +1941,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 -- 1.7.10.4