aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMarkus Rost2003-01-13 23:43:30 +0000
committerMarkus Rost2003-01-13 23:43:30 +0000
commitcba752d04afd59e86015afde78c5a351b6c91ac5 (patch)
treedf66dd7ecf5d6bd9dc1c0a25f52512aef44cc72a /lisp
parent7ed16567567ef354e28038e2e72154136e66b6e6 (diff)
downloademacs-cba752d04afd59e86015afde78c5a351b6c91ac5.tar.gz
emacs-cba752d04afd59e86015afde78c5a351b6c91ac5.zip
(customize-changed-options): Doc addition. Load the
version deps earlier. Use other tests for groups and variables. Handle faces.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/cus-edit.el81
1 files changed, 34 insertions, 47 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index b13c7965882..6a666513e5c 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -950,7 +950,11 @@ values have changed since the previous major Emacs release.
950 950
951With argument SINCE-VERSION (a string), customize all user option 951With argument SINCE-VERSION (a string), customize all user option
952variables that were added (or their meanings were changed) since that 952variables that were added (or their meanings were changed) since that
953version." 953version.
954
955Custom version numbers are actually associated to symbols. A symbol
956with version number VERSION will be listed with all its definitions as
957custom variable, face, or group."
954 958
955 (interactive "sCustomize options changed, since version (default all versions): ") 959 (interactive "sCustomize options changed, since version (default all versions): ")
956 (if (equal since-version "") 960 (if (equal since-version "")
@@ -961,52 +965,35 @@ version."
961 (signal 'wrong-type-argument (list 'numberp since-version)))) 965 (signal 'wrong-type-argument (list 'numberp since-version))))
962 (unless since-version 966 (unless since-version
963 (setq since-version customize-changed-options-previous-release)) 967 (setq since-version customize-changed-options-previous-release))
964 (let ((found nil) 968
965 (versions nil)) 969 ;; Load the information for versions since since-version. We use
966 (mapatoms (lambda (symbol) 970 ;; custom-load-symbol for this.
967 (and (or (boundp symbol) 971 (put 'custom-versions-load-alist 'custom-loads nil)
968 ;; For variables not yet loaded. 972 (dolist (elt custom-versions-load-alist)
969 (get symbol 'standard-value) 973 (if (customize-version-lessp since-version (car elt))
970 ;; For groups the previous test fails, this one 974 (dolist (load (cdr elt))
971 ;; could be used to determine if symbol is a 975 (custom-add-load 'custom-versions-load-alist load))))
972 ;; group. Is there a better way for this? 976 (custom-load-symbol 'custom-versions-load-alist)
973 (get symbol 'group-documentation)) 977 (put 'custom-versions-load-alist 'custom-loads nil)
974 (let ((version (get symbol 'custom-version))) 978
975 (and version 979 (let (found)
976 (or (null since-version) 980 (mapatoms
977 (customize-version-lessp since-version version)) 981 (lambda (symbol)
978 (if (member version versions) 982 (let ((version (get symbol 'custom-version)))
979 t 983 (if version
980 ;;; Collect all versions that we use. 984 (when (customize-version-lessp since-version version)
981 (push version versions)))) 985 (if (or (get symbol 'custom-group)
982 (setq found 986 (get symbol 'group-documentation))
983 ;; We have to set the right thing here, 987 (push (list symbol 'custom-group) found))
984 ;; depending if we have a group or a 988 (if (custom-variable-p symbol)
985 ;; variable. 989 (push (list symbol 'custom-variable) found))
986 (if (get symbol 'group-documentation) 990 (if (custom-facep symbol)
987 (cons (list symbol 'custom-group) found) 991 (push (list symbol 'custom-face) found)))))))
988 (cons (list symbol 'custom-variable) found)))))) 992 (if found
989 (if (not found) 993 (custom-buffer-create (custom-sort-items found t 'first)
990 (error "No user option defaults have been changed since Emacs %s" 994 "*Customize Changed Options*")
991 since-version) 995 (error "No user option defaults have been changed since Emacs %s"
992 (let ((flist nil)) 996 since-version))))
993 (while versions
994 (push (copy-sequence
995 (cdr (assoc (car versions) custom-versions-load-alist)))
996 flist)
997 (setq versions (cdr versions)))
998 (put 'custom-versions-load-alist 'custom-loads
999 ;; Get all the files that correspond to element from the
1000 ;; VERSIONS list. This could use some simplification.
1001 (apply 'nconc flist)))
1002 ;; Because we set all the files needed to be loaded as a
1003 ;; `custom-loads' property to `custom-versions-load-alist' this
1004 ;; call will actually load them.
1005 (custom-load-symbol 'custom-versions-load-alist)
1006 ;; Clean up
1007 (put 'custom-versions-load-alist 'custom-loads nil)
1008 (custom-buffer-create (custom-sort-items found t 'first)
1009 "*Customize Changed Options*"))))
1010 997
1011(defun customize-version-lessp (version1 version2) 998(defun customize-version-lessp (version1 version2)
1012 ;; Why are the versions strings, and given that they are, why aren't 999 ;; Why are the versions strings, and given that they are, why aren't