summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1997-12-09 21:41:33 +0000
committerKarl Heuer <kwzh@gnu.org>1997-12-09 21:41:33 +0000
commitf50dc5d269a57c47b1001514cf9eda1cbcde95b9 (patch)
treebeb2503d8d3f31adda485f5593f28a7d585b4c64 /lisp/cus-edit.el
parenta32d7856d303ee3a1f787b86291f7018cff780bb (diff)
downloademacs-f50dc5d269a57c47b1001514cf9eda1cbcde95b9.tar.gz
(customize-changed-options): New function.
(customize-version-lessp): New function.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el33
1 files changed, 33 insertions, 0 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index cac6684cbbb..8a272f6cd0f 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -856,6 +856,39 @@ are shown; the contents of those subgroups are initially hidden."
(custom-unlispify-tag-name symbol))))
;;;###autoload
+(defun customize-changed-options (since-version)
+ "Customize all user option variables whose default values changed recently.
+This means, in other words, variables defined with a `:new' option."
+ (interactive "sCustomize options changed, since version (default all versions): ")
+ (if (equal since-version "")
+ (setq since-version nil))
+ (let ((found nil))
+ (mapatoms (lambda (symbol)
+ (and (boundp symbol)
+ (let ((version (get symbol 'custom-version)))
+ (and version
+ (or (null since-version)
+ (customize-version-lessp since-version version))))
+ (setq found
+ (cons (list symbol 'custom-variable) found)))))
+ (if (not found)
+ (error "No user options have changed defaults in recent Emacs versions")
+ (custom-buffer-create (custom-sort-items found t nil)
+ "*Customize Changed Options*"))))
+
+(defun customize-version-lessp (version1 version2)
+ (let (major1 major2 minor1 minor2)
+ (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version1)
+ (setq major1 (read (match-string 1 version1)))
+ (setq minor1 (read (match-string 2 version1)))
+ (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version2)
+ (setq major2 (read (match-string 1 version2)))
+ (setq minor2 (read (match-string 2 version2)))
+ (or (< major1 major2)
+ (and (= major1 major2)
+ (< minor1 minor2)))))
+
+;;;###autoload
(defalias 'customize-variable-other-window 'customize-option-other-window)
;;;###autoload