emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/cus-edit.el


From: Bill Wohler
Subject: [Emacs-diffs] Changes to emacs/lisp/cus-edit.el
Date: Mon, 10 Apr 2006 23:43:35 +0000

Index: emacs/lisp/cus-edit.el
diff -u emacs/lisp/cus-edit.el:1.289 emacs/lisp/cus-edit.el:1.290
--- emacs/lisp/cus-edit.el:1.289        Tue Mar 21 16:44:10 2006
+++ emacs/lisp/cus-edit.el      Mon Apr 10 23:43:34 2006
@@ -786,7 +786,7 @@
     (if (or (and (= 1 (length children))
                 (memq (widget-type (car children))
                       '(custom-variable custom-face)))
-           (y-or-n-p "Reset all settings' buffer text to show current values?  
"))
+           (y-or-n-p "Reset all settings' buffer text to show current values? 
"))
        (mapc (lambda (widget)
                (if (memq (widget-get widget :custom-state)
                          '(modified changed))
@@ -1079,6 +1079,18 @@
 (defvar customize-changed-options-previous-release "21.1"
   "Version for `customize-changed-options' to refer back to by default.")
 
+;; Packages will update this variable, so make it available.
+;;;###autoload
+(defvar customize-package-emacs-version-alist nil
+  "Alist that maps packages to alists of package to Emacs versions.
+The value alists map all package versions used with
+the :package-version keyword to Emacs versions.  Packages are
+symbols and versions are strings.
+
+For example:
+  '((MH-E (\"7.4\" \"22.1\") (\"8.0\" \"22.1\"))
+    (Gnus (\"5.11\" \"22.1\")))")
+
 ;;;###autoload
 (defalias 'customize-changed 'customize-changed-options)
 
@@ -1119,7 +1131,12 @@
   (let (found)
     (mapatoms
      (lambda (symbol)
-       (let ((version (get symbol 'custom-version)))
+        (let* ((package-version (get symbol 'custom-package-version))
+               (version
+                (or (and package-version
+                         (customize-package-emacs-version symbol
+                                                          package-version))
+                    (get symbol 'custom-version))))
         (if version
             (when (customize-version-lessp since-version version)
               (if (or (get symbol 'custom-group)
@@ -1135,6 +1152,31 @@
       (error "No user option defaults have been changed since Emacs %s"
             since-version))))
 
+(defun customize-package-emacs-version (symbol package-version)
+  "Return Emacs version of SYMBOL.
+PACKAGE-VERSION has the form (PACKAGE VERSION).  The VERSION of
+PACKAGE is looked up in the associated list
+`customize-package-emacs-version-alist' to find the version of
+Emacs that is associated with it."
+  (let (package-versions emacs-version)
+    ;; Use message instead of error since we want user to be able to
+    ;; see the rest of the symbols even if a package author has
+    ;; botched things up.
+    (cond ((not (listp package-version))
+           (message "Invalid package-version value for %s" symbol))
+          ((setq package-versions (assq (car package-version)
+                                        customize-package-emacs-version-alist))
+           (setq emacs-version
+                 (cadr (assoc (cadr package-version) package-versions)))
+           (unless emacs-version
+             (message "Package version of %s not found in %s" symbol
+                      "customize-package-emacs-version-alist")))
+          (t
+           (message "Package %s neglected to update %s"
+                    (car package-version)
+                    "customize-package-emacs-version-alist")))
+    emacs-version))
+
 (defun customize-version-lessp (version1 version2)
   ;; Why are the versions strings, and given that they are, why aren't
   ;; they converted to numbers and compared as such here?  -- fx




reply via email to

[Prev in Thread] Current Thread [Next in Thread]