diff options
| author | Chong Yidong | 2006-07-03 14:31:35 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-07-03 14:31:35 +0000 |
| commit | b6a675073037e81f781db98e0210f8cc58de8227 (patch) | |
| tree | d87364c26b0c5d5b66e6bc1c50c03467601d44e3 | |
| parent | 00c8c617aad02d60098805d9480b083d92632ebc (diff) | |
| download | emacs-b6a675073037e81f781db98e0210f8cc58de8227.tar.gz emacs-b6a675073037e81f781db98e0210f8cc58de8227.zip | |
* facemenu.el (facemenu-listed-faces): New var.
(facemenu-unlisted-faces): Variable deleted.
(facemenu-add-new-face): Use facemenu-listed-faces.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/facemenu.el | 71 |
2 files changed, 39 insertions, 41 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0011e5300f0..e6df1f0d806 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2006-07-03 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * facemenu.el (facemenu-listed-faces): New var. | ||
| 4 | (facemenu-unlisted-faces): Variable deleted. | ||
| 5 | (facemenu-add-new-face): Use facemenu-listed-faces. | ||
| 6 | |||
| 7 | * emulation/viper-init.el, calendar/calendar.el: | ||
| 8 | * progmodes/make-mode.el: Delete calls to facemenu-unlisted-faces. | ||
| 9 | |||
| 1 | 2006-07-03 Carsten Dominik <dominik@science.uva.nl> | 10 | 2006-07-03 Carsten Dominik <dominik@science.uva.nl> |
| 2 | 11 | ||
| 3 | * textmodes/org.el (org-mode): Removed no invalid settings for | 12 | * textmodes/org.el (org-mode): Removed no invalid settings for |
diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 5478cf12b8c..a8d8ea9a4b5 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el | |||
| @@ -67,8 +67,8 @@ | |||
| 67 | ;; | 67 | ;; |
| 68 | ;; The order of the faces that appear in the menu and their keybindings can be | 68 | ;; The order of the faces that appear in the menu and their keybindings can be |
| 69 | ;; controlled by setting the variables `facemenu-keybindings' and | 69 | ;; controlled by setting the variables `facemenu-keybindings' and |
| 70 | ;; `facemenu-new-faces-at-end'. List faces that you don't use in documents | 70 | ;; `facemenu-new-faces-at-end'. List faces that you want to use in documents |
| 71 | ;; (eg, `region') in `facemenu-unlisted-faces'. | 71 | ;; in `facemenu-listed-faces'. |
| 72 | 72 | ||
| 73 | ;;; Known Problems: | 73 | ;;; Known Problems: |
| 74 | ;; Bold and Italic do not combine to create bold-italic if you select them | 74 | ;; Bold and Italic do not combine to create bold-italic if you select them |
| @@ -116,9 +116,9 @@ the next element is the key to use as a keyboard equivalent of the menu item; | |||
| 116 | the binding is made in `facemenu-keymap'. | 116 | the binding is made in `facemenu-keymap'. |
| 117 | 117 | ||
| 118 | The faces specifically mentioned in this list are put at the top of | 118 | The faces specifically mentioned in this list are put at the top of |
| 119 | the menu, in the order specified. All other faces which are defined, | 119 | the menu, in the order specified. All other faces which are defined |
| 120 | except for those in `facemenu-unlisted-faces', are listed after them, | 120 | in `facemenu-listed-faces' are listed after them, but get no |
| 121 | but get no keyboard equivalents. | 121 | keyboard equivalents. |
| 122 | 122 | ||
| 123 | If you change this variable after loading facemenu.el, you will need to call | 123 | If you change this variable after loading facemenu.el, you will need to call |
| 124 | `facemenu-update' to make it take effect." | 124 | `facemenu-update' to make it take effect." |
| @@ -132,28 +132,25 @@ just before \"Other\" at the end." | |||
| 132 | :type 'boolean | 132 | :type 'boolean |
| 133 | :group 'facemenu) | 133 | :group 'facemenu) |
| 134 | 134 | ||
| 135 | (defcustom facemenu-unlisted-faces | 135 | (defcustom facemenu-listed-faces nil |
| 136 | `(modeline region secondary-selection highlight scratch-face | 136 | "*List of faces to include in the Face menu. |
| 137 | ,(purecopy "^font-lock-") ,(purecopy "^gnus-") ,(purecopy "^message-") | 137 | Each element should be a symbol, which is the name of a face. |
| 138 | ,(purecopy "^ediff-") ,(purecopy "^term-") ,(purecopy "^vc-") | 138 | The \"basic \" faces in `facemenu-keybindings' are automatically |
| 139 | ,(purecopy "^widget-") ,(purecopy "^custom-") ,(purecopy "^vm-")) | 139 | added to the Face menu, and are not included in this list. |
| 140 | "*List of faces not to include in the Face menu. | ||
| 141 | Each element may be either a symbol, which is the name of a face, or a string, | ||
| 142 | which is a regular expression to be matched against face names. Matching | ||
| 143 | faces will not be added to the menu. | ||
| 144 | 140 | ||
| 145 | You can set this list before loading facemenu.el, or add a face to it before | 141 | You can set this list before loading facemenu.el, or add a face to it before |
| 146 | creating that face if you do not want it to be listed. If you change the | 142 | creating that face if you want it to be listed. If you change the |
| 147 | variable so as to eliminate faces that have already been added to the menu, | 143 | variable so as to eliminate faces that have already been added to the menu, |
| 148 | call `facemenu-update' to recalculate the menu contents. | 144 | call `facemenu-update' to recalculate the menu contents. |
| 149 | 145 | ||
| 150 | If this variable is t, no faces will be added to the menu. This is useful for | 146 | If this variable is t, all faces will be added to the menu. This |
| 151 | temporarily turning off the feature that automatically adds faces to the menu | 147 | is useful for setting temporarily if you want to add faces to the |
| 152 | when they are created." | 148 | menu when they are created." |
| 153 | :type '(choice (const :tag "Don't add faces" t) | 149 | :type '(choice (const :tag "List all faces" t) |
| 154 | (const :tag "None (do add any face)" nil) | 150 | (const :tag "None" nil) |
| 155 | (repeat (choice symbol regexp))) | 151 | (repeat symbol)) |
| 156 | :group 'facemenu) | 152 | :group 'facemenu |
| 153 | :version "22.1") | ||
| 157 | 154 | ||
| 158 | ;;;###autoload | 155 | ;;;###autoload |
| 159 | (defvar facemenu-face-menu | 156 | (defvar facemenu-face-menu |
| @@ -675,18 +672,13 @@ This is called whenever you create a new face." | |||
| 675 | (setq docstring | 672 | (setq docstring |
| 676 | (format "Select face `%s' for subsequent insertion." | 673 | (format "Select face `%s' for subsequent insertion." |
| 677 | name)) | 674 | name)) |
| 678 | (cond ((eq t facemenu-unlisted-faces)) | 675 | (cond ((facemenu-iterate ; check if equivalent face is already in the menu |
| 679 | ((memq symbol facemenu-unlisted-faces)) | 676 | (lambda (m) (and (listp m) |
| 680 | ;; test against regexps in facemenu-unlisted-faces | 677 | (symbolp (car m)) |
| 681 | ((let ((unlisted facemenu-unlisted-faces) | 678 | (face-equal (car m) symbol))) |
| 682 | (matched nil)) | 679 | (cdr (symbol-function menu)))) |
| 683 | (while (and unlisted (not matched)) | 680 | ;; Faces with a keyboard equivalent. These go at the front. |
| 684 | (if (and (stringp (car unlisted)) | 681 | (key |
| 685 | (string-match (car unlisted) name)) | ||
| 686 | (setq matched t) | ||
| 687 | (setq unlisted (cdr unlisted)))) | ||
| 688 | matched)) | ||
| 689 | (key ; has a keyboard equivalent. These go at the front. | ||
| 690 | (setq function (intern (concat "facemenu-set-" name))) | 682 | (setq function (intern (concat "facemenu-set-" name))) |
| 691 | (fset function | 683 | (fset function |
| 692 | `(lambda () | 684 | `(lambda () |
| @@ -700,17 +692,14 @@ This is called whenever you create a new face." | |||
| 700 | (region-end))))) | 692 | (region-end))))) |
| 701 | (define-key 'facemenu-keymap key (cons name function)) | 693 | (define-key 'facemenu-keymap key (cons name function)) |
| 702 | (define-key menu key (cons name function))) | 694 | (define-key menu key (cons name function))) |
| 703 | ((facemenu-iterate ; check if equivalent face is already in the menu | 695 | ;; Faces with no keyboard equivalent. Figure out where to put it: |
| 704 | (lambda (m) (and (listp m) | 696 | ((or (eq t facemenu-listed-faces) |
| 705 | (symbolp (car m)) | 697 | (memq symbol facemenu-listed-faces)) |
| 706 | (face-equal (car m) symbol))) | ||
| 707 | (cdr (symbol-function menu)))) | ||
| 708 | (t ; No keyboard equivalent. Figure out where to put it: | ||
| 709 | (setq key (vector symbol) | 698 | (setq key (vector symbol) |
| 710 | function 'facemenu-set-face-from-menu | 699 | function 'facemenu-set-face-from-menu |
| 711 | menu-val (symbol-function menu)) | 700 | menu-val (symbol-function menu)) |
| 712 | (if (and facemenu-new-faces-at-end | 701 | (if (and facemenu-new-faces-at-end |
| 713 | (> (length menu-val) 3)) | 702 | (> (length menu-val) 3)) |
| 714 | (define-key-after menu-val key (cons name function) | 703 | (define-key-after menu-val key (cons name function) |
| 715 | (car (nth (- (length menu-val) 3) menu-val))) | 704 | (car (nth (- (length menu-val) 3) menu-val))) |
| 716 | (define-key menu key (cons name function)))))) | 705 | (define-key menu key (cons name function)))))) |