aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPer Abrahamsen1997-06-19 11:30:04 +0000
committerPer Abrahamsen1997-06-19 11:30:04 +0000
commita1a4fa22ce167e9a49adedd2a2691609ccf406a8 (patch)
treed42160ab0004ae1aac928b6b7fceb1a4d1fec48c /lisp
parent0093dc5a9a0c0386a0e73708f5837b93878753c3 (diff)
downloademacs-a1a4fa22ce167e9a49adedd2a2691609ccf406a8.tar.gz
emacs-a1a4fa22ce167e9a49adedd2a2691609ccf406a8.zip
Synched with 1.9924.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/cus-edit.el132
-rw-r--r--lisp/wid-edit.el13
2 files changed, 103 insertions, 42 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 1adc2304aec..4dd350dd98b 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Author: Per Abrahamsen <abraham@dina.kvl.dk> 5;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6;; Keywords: help, faces 6;; Keywords: help, faces
7;; Version: 1.9920 7;; Version: 1.9924
8;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ 8;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -643,7 +643,7 @@ when the action is chosen.")
643 (let ((children custom-options)) 643 (let ((children custom-options))
644 (mapcar (lambda (child) 644 (mapcar (lambda (child)
645 (when (eq (widget-get child :custom-state) 'modified) 645 (when (eq (widget-get child :custom-state) 'modified)
646 (widget-apply child :custom-reset-current))) 646 (widget-apply child :custom-reset-saved)))
647 children))) 647 children)))
648 648
649(defun custom-reset-standard (&rest ignore) 649(defun custom-reset-standard (&rest ignore)
@@ -652,7 +652,7 @@ when the action is chosen.")
652 (let ((children custom-options)) 652 (let ((children custom-options))
653 (mapcar (lambda (child) 653 (mapcar (lambda (child)
654 (when (eq (widget-get child :custom-state) 'modified) 654 (when (eq (widget-get child :custom-state) 'modified)
655 (widget-apply child :custom-reset-current))) 655 (widget-apply child :custom-reset-standard)))
656 children))) 656 children)))
657 657
658;;; The Customize Commands 658;;; The Customize Commands
@@ -801,10 +801,10 @@ If SYMBOL is nil, customize all faces."
801 (let ((found nil)) 801 (let ((found nil))
802 (message "Looking for faces...") 802 (message "Looking for faces...")
803 (mapcar (lambda (symbol) 803 (mapcar (lambda (symbol)
804 (setq found (cons (list symbol 'custom-face) found))) 804 (push (list symbol 'custom-face) found))
805 (nreverse (mapcar 'intern 805 (nreverse (mapcar 'intern
806 (sort (mapcar 'symbol-name (face-list)) 806 (sort (mapcar 'symbol-name (face-list))
807 'string<)))) 807 'string-lessp))))
808 808
809 (custom-buffer-create found "*Customize Faces*")) 809 (custom-buffer-create found "*Customize Faces*"))
810 (if (stringp symbol) 810 (if (stringp symbol)
@@ -838,11 +838,10 @@ If SYMBOL is nil, customize all faces."
838 (mapatoms (lambda (symbol) 838 (mapatoms (lambda (symbol)
839 (and (get symbol 'customized-face) 839 (and (get symbol 'customized-face)
840 (custom-facep symbol) 840 (custom-facep symbol)
841 (setq found (cons (list symbol 'custom-face) found))) 841 (push (list symbol 'custom-face) found))
842 (and (get symbol 'customized-value) 842 (and (get symbol 'customized-value)
843 (boundp symbol) 843 (boundp symbol)
844 (setq found 844 (push (list symbol 'custom-variable) found))))
845 (cons (list symbol 'custom-variable) found)))))
846 (if found 845 (if found
847 (custom-buffer-create found "*Customize Customized*") 846 (custom-buffer-create found "*Customize Customized*")
848 (error "No customized user options")))) 847 (error "No customized user options"))))
@@ -855,11 +854,10 @@ If SYMBOL is nil, customize all faces."
855 (mapatoms (lambda (symbol) 854 (mapatoms (lambda (symbol)
856 (and (get symbol 'saved-face) 855 (and (get symbol 'saved-face)
857 (custom-facep symbol) 856 (custom-facep symbol)
858 (setq found (cons (list symbol 'custom-face) found))) 857 (push (list symbol 'custom-face) found))
859 (and (get symbol 'saved-value) 858 (and (get symbol 'saved-value)
860 (boundp symbol) 859 (boundp symbol)
861 (setq found 860 (push (list symbol 'custom-variable) found))))
862 (cons (list symbol 'custom-variable) found)))))
863 (if found 861 (if found
864 (custom-buffer-create found "*Customize Saved*") 862 (custom-buffer-create found "*Customize Saved*")
865 (error "No saved user options")))) 863 (error "No saved user options"))))
@@ -867,27 +865,55 @@ If SYMBOL is nil, customize all faces."
867;;;###autoload 865;;;###autoload
868(defun customize-apropos (regexp &optional all) 866(defun customize-apropos (regexp &optional all)
869 "Customize all user options matching REGEXP. 867 "Customize all user options matching REGEXP.
870If ALL (e.g., started with a prefix key), include options which are not 868If ALL is `options', include only options.
871user-settable." 869If ALL is `faces', include only faces.
870If ALL is `groups', include only groups.
871If ALL is t (interactively, with prefix arg), include options which are not
872user-settable, as well as faces and groups."
872 (interactive "sCustomize regexp: \nP") 873 (interactive "sCustomize regexp: \nP")
873 (let ((found nil)) 874 (let ((found nil))
874 (mapatoms (lambda (symbol) 875 (mapatoms (lambda (symbol)
875 (when (string-match regexp (symbol-name symbol)) 876 (when (string-match regexp (symbol-name symbol))
876 (when (get symbol 'custom-group) 877 (when (and (not (memq all '(faces options)))
877 (setq found (cons (list symbol 'custom-group) found))) 878 (get symbol 'custom-group))
878 (when (custom-facep symbol) 879 (push (list symbol 'custom-group) found))
879 (setq found (cons (list symbol 'custom-face) found))) 880 (when (and (not (memq all '(options groups)))
880 (when (and (boundp symbol) 881 (custom-facep symbol))
882 (push (list symbol 'custom-face) found))
883 (when (and (not (memq all '(groups faces)))
884 (boundp symbol)
881 (or (get symbol 'saved-value) 885 (or (get symbol 'saved-value)
882 (get symbol 'standard-value) 886 (get symbol 'standard-value)
883 (if all 887 (if (memq all '(nil options))
884 (get symbol 'variable-documentation) 888 (user-variable-p symbol)
885 (user-variable-p symbol)))) 889 (get symbol 'variable-documentation))))
886 (setq found 890 (push (list symbol 'custom-variable) found)))))
887 (cons (list symbol 'custom-variable) found)))))) 891 (if (not found)
888 (if found 892 (error "No matches")
889 (custom-buffer-create found "*Customize Apropos*") 893 (custom-buffer-create (sort (sort found
890 (error "No matches")))) 894 ;; Apropos should always be sorted.
895 'custom-sort-items-alphabetically)
896 custom-buffer-order-predicate)
897 "*Customize Apropos*"))))
898
899;;;###autoload
900(defun customize-apropos-options (regexp &optional arg)
901 "Customize all user options matching REGEXP.
902With prefix arg, include options which are not user-settable."
903 (interactive "sCustomize regexp: \nP")
904 (customize-apropos regexp (or arg 'options)))
905
906;;;###autoload
907(defun customize-apropos-faces (regexp)
908 "Customize all user faces matching REGEXP."
909 (interactive "sCustomize regexp: \n")
910 (customize-apropos regexp 'faces))
911
912;;;###autoload
913(defun customize-apropos-groups (regexp)
914 "Customize all user groups matching REGEXP."
915 (interactive "sCustomize regexp: \n")
916 (customize-apropos regexp 'groups))
891 917
892;;; Buffer. 918;;; Buffer.
893 919
@@ -1006,6 +1032,31 @@ Reset all visible items in this buffer to their standard settings."
1006 options)))) 1032 options))))
1007 (unless (eq (preceding-char) ?\n) 1033 (unless (eq (preceding-char) ?\n)
1008 (widget-insert "\n")) 1034 (widget-insert "\n"))
1035 (when (= (length options) 1)
1036 (message "Creating parent links...")
1037 (let* ((entry (nth 0 options))
1038 (name (nth 0 entry))
1039 (type (nth 1 entry))
1040 parents)
1041 (mapatoms (lambda (symbol)
1042 (let ((group (get symbol 'custom-group)))
1043 (when (assq name group)
1044 (when (eq type (nth 1 (assq name group)))
1045 (push symbol parents))))))
1046 (when parents
1047 (widget-insert "\nParent groups:")
1048 (mapcar (lambda (group)
1049 (widget-insert " ")
1050 (widget-create 'link
1051 :tag (custom-unlispify-tag-name group)
1052 :help-echo (format "\
1053Create customize buffer for `%S' group." group)
1054 :action (lambda (widget &rest ignore)
1055 (customize-group
1056 (widget-value widget)))
1057 group))
1058 parents)
1059 (widget-insert ".\n"))))
1009 (message "Creating customization magic...") 1060 (message "Creating customization magic...")
1010 (mapcar 'custom-magic-reset custom-options) 1061 (mapcar 'custom-magic-reset custom-options)
1011 (message "Creating customization setup...") 1062 (message "Creating customization setup...")
@@ -2356,8 +2407,10 @@ Optional EVENT is the location for the menu."
2356 (custom-magic-reset widget)) 2407 (custom-magic-reset widget))
2357 2408
2358;;; The `custom-save-all' Function. 2409;;; The `custom-save-all' Function.
2359 2410;;;###autoload
2360(defcustom custom-file "~/.emacs" 2411(defcustom custom-file (if (featurep 'xemacs)
2412 "~/.xemacs-custom"
2413 "~/.emacs")
2361 "File used for storing customization information. 2414 "File used for storing customization information.
2362If you change this from the default \"~/.emacs\" you need to 2415If you change this from the default \"~/.emacs\" you need to
2363explicitly load that file for the settings to take effect." 2416explicitly load that file for the settings to take effect."
@@ -2481,14 +2534,19 @@ Leave point at the location of the call, or after the last expression."
2481;;; Menu support 2534;;; Menu support
2482 2535
2483(unless (string-match "XEmacs" emacs-version) 2536(unless (string-match "XEmacs" emacs-version)
2484 (defconst custom-help-menu '("Customize" 2537 (defconst custom-help-menu
2485 ["Update menu..." custom-menu-update t] 2538 '("Customize"
2486 ["Group..." customize-group t] 2539 ["Update menu..." custom-menu-update t]
2487 ["Variable..." customize-variable t] 2540 ["Group..." customize-group t]
2488 ["Face..." customize-face t] 2541 ["Variable..." customize-variable t]
2489 ["Saved..." customize-saved t] 2542 ["Face..." customize-face t]
2490 ["Set..." customize-customized t] 2543 ["Saved..." customize-saved t]
2491 ["Apropos..." customize-apropos t]) 2544 ["Set..." customize-customized t]
2545 ["--" custom-menu-sep t]
2546 ["Apropos..." customize-apropos t]
2547 ["Group apropos..." customize-apropos-groups t]
2548 ["Variable apropos..." customize-apropos-options t]
2549 ["Face apropos..." customize-apropos-faces t])
2492 ;; This menu should be identical to the one defined in `menu-bar.el'. 2550 ;; This menu should be identical to the one defined in `menu-bar.el'.
2493 "Customize menu") 2551 "Customize menu")
2494 2552
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index dc69b0ca828..9ef05d00d05 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Author: Per Abrahamsen <abraham@dina.kvl.dk> 5;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6;; Keywords: extensions 6;; Keywords: extensions
7;; Version: 1.9920 7;; Version: 1.9924
8;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ 8;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -296,8 +296,11 @@ size field."
296 (when widget-field-add-space 296 (when widget-field-add-space
297 (insert-and-inherit " ")) 297 (insert-and-inherit " "))
298 (setq to (point))) 298 (setq to (point)))
299 (add-text-properties (1- to) to ;to (1+ to) 299 (if widget-field-add-space
300 '(front-sticky nil start-open t read-only to)) 300 (add-text-properties (1- to) to
301 '(front-sticky nil start-open t read-only to))
302 (add-text-properties to (1+ to)
303 '(front-sticky nil start-open t read-only to)))
301 (add-text-properties (1- from) from 304 (add-text-properties (1- from) from
302 '(rear-nonsticky t end-open t read-only from)) 305 '(rear-nonsticky t end-open t read-only from))
303 (let ((map (widget-get widget :keymap)) 306 (let ((map (widget-get widget :keymap))
@@ -2653,8 +2656,8 @@ link for that string."
2653 (goto-char from) 2656 (goto-char from)
2654 (while (re-search-forward regexp to t) 2657 (while (re-search-forward regexp to t)
2655 (let ((name (match-string 1)) 2658 (let ((name (match-string 1))
2656 (begin (match-beginning 0)) 2659 (begin (match-beginning 1))
2657 (end (match-end 0))) 2660 (end (match-end 1)))
2658 (when (funcall predicate name) 2661 (when (funcall predicate name)
2659 (push (widget-convert-button type begin end :value name) 2662 (push (widget-convert-button type begin end :value name)
2660 buttons))))) 2663 buttons)))))