comparison lisp/cus-edit.el @ 223:2c611d1463a6 r20-4b10

Import from CVS: tag r20-4b10
author cvs
date Mon, 13 Aug 2007 10:10:54 +0200
parents 262b8bb4a523
children 12579d965149
comparison
equal deleted inserted replaced
222:aae4c8b01452 223:2c611d1463a6
32 ;; See `custom.el'. 32 ;; See `custom.el'.
33 33
34 ;; No commands should have names starting with `custom-' because 34 ;; No commands should have names starting with `custom-' because
35 ;; that interferes with completion. Use `customize-' for commands 35 ;; that interferes with completion. Use `customize-' for commands
36 ;; that the user will run with M-x, and `Custom-' for interactive commands. 36 ;; that the user will run with M-x, and `Custom-' for interactive commands.
37
38 ;; NOTE: In many places within this file we use `mapatoms', which is
39 ;; very slow in an average XEmacs because of the large number of
40 ;; symbols requiring a large number of funcalls -- XEmacs with Gnus
41 ;; can grow to some 17000 symbols without ever doing anything fancy.
42 ;; It would probably pay off to make a hashtable of symbols known to
43 ;; Custom, similar to custom-group-hash-table.
44
45 ;; This is not top priority, because none of the functions that do
46 ;; mapatoms are speed-critical (the one that was now uses
47 ;; custom-group-hash-table), but it would be nice to have.
37 48
38 49
39 ;;; Code: 50 ;;; Code:
40 51
41 (require 'cus-face) 52 (require 'cus-face)
375 (format "Customize variable: (default %s) " v) 386 (format "Customize variable: (default %s) " v)
376 "Customize variable: ") 387 "Customize variable: ")
377 obarray (lambda (symbol) 388 obarray (lambda (symbol)
378 (and (boundp symbol) 389 (and (boundp symbol)
379 (or (get symbol 'custom-type) 390 (or (get symbol 'custom-type)
380 (user-variable-p symbol)))))) 391 (user-variable-p symbol)))) t))
381 (list (if (equal val "") 392 (list (if (equal val "")
382 (if (symbolp v) v nil) 393 (if (symbolp v) v nil)
383 (intern val))))) 394 (intern val)))))
384 395
385 ;; Here we take not only the actual groups, but the loads, too. 396 ;; Here we take not only the actual groups, but the loads, too.
826 "Customize SYMBOL, which must be a user option variable." 837 "Customize SYMBOL, which must be a user option variable."
827 (interactive (custom-variable-prompt)) 838 (interactive (custom-variable-prompt))
828 (custom-buffer-create (list (list symbol 'custom-variable)) 839 (custom-buffer-create (list (list symbol 'custom-variable))
829 (format "*Customize Variable: %s*" 840 (format "*Customize Variable: %s*"
830 (custom-unlispify-tag-name symbol)))) 841 (custom-unlispify-tag-name symbol))))
842
843 ;;;###autoload
844 (defun customize-changed-options (since-version)
845 "Customize all user option variables whose default values changed recently.
846 This means, in other words, variables defined with a `:version' keyword."
847 (interactive "sCustomize options changed, since version (default all versions): ")
848 (if (equal since-version "")
849 (setq since-version nil))
850 (let ((found nil))
851 (mapatoms (lambda (symbol)
852 (and (boundp symbol)
853 (let ((version (get symbol 'custom-version)))
854 (and version
855 (or (null since-version)
856 (customize-version-lessp since-version version))))
857 (push (list symbol 'custom-variable) found))))
858 (unless found
859 (error "No user options have changed defaults %s"
860 (if since-version
861 (format "since XEmacs %s" since-version)
862 "in recent Emacs versions")))
863 (custom-buffer-create (custom-sort-items found t nil)
864 "*Customize Changed Options*")))
865
866 (defun customize-version-lessp (version1 version2)
867 (let (major1 major2 minor1 minor2)
868 (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version1)
869 (setq major1 (read (match-string 1 version1)))
870 (setq minor1 (read (match-string 2 version1)))
871 (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version2)
872 (setq major2 (read (match-string 1 version2)))
873 (setq minor2 (read (match-string 2 version2)))
874 (or (< major1 major2)
875 (and (= major1 major2)
876 (< minor1 minor2)))))
831 877
832 ;;;###autoload 878 ;;;###autoload
833 (defalias 'customize-variable-other-window 'customize-option-other-window) 879 (defalias 'customize-variable-other-window 'customize-option-other-window)
834 880
835 ;;;###autoload 881 ;;;###autoload