Changeset 4111 for trunk/lisp/facemenu.el
- Timestamp:
- 2006年07月16日 08時36分52秒 (2 years ago)
- Files:
-
- trunk/lisp/facemenu.el (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/facemenu.el
r4098 r4111 68 68 ;; The order of the faces that appear in the menu and their keybindings can be 69 69 ;; controlled by setting the variables `facemenu-keybindings' and 70 ;; `facemenu-new-faces-at-end'. List faces that you don'tuse in documents71 ;; (eg, `region') in `facemenu-unlisted-faces'.70 ;; `facemenu-new-faces-at-end'. List faces that you want to use in documents 71 ;; in `facemenu-listed-faces'. 72 72 73 73 ;;; Known Problems: … … 117 117 118 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 ,120 except for those in `facemenu-unlisted-faces', are listed after them, 121 but get nokeyboard equivalents.119 the menu, in the order specified. All other faces which are defined 120 in `facemenu-listed-faces' are listed after them, but get no 121 keyboard equivalents. 122 122 123 123 If you change this variable after loading facemenu.el, you will need to call … … 133 133 :group 'facemenu) 134 134 135 (defcustom facemenu-unlisted-faces 136 `(modeline region secondary-selection highlight scratch-face 137 ,(purecopy "^font-lock-") ,(purecopy "^gnus-") ,(purecopy "^message-") 138 ,(purecopy "^ediff-") ,(purecopy "^term-") ,(purecopy "^vc-") 139 ,(purecopy "^widget-") ,(purecopy "^custom-") ,(purecopy "^vm-")) 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. 135 (defcustom facemenu-listed-faces nil 136 "*List of faces to include in the Face menu. 137 Each element should be a symbol, which is the name of a face. 138 The \"basic \" faces in `facemenu-keybindings' are automatically 139 added to the Face menu, and are not included in this list. 144 140 145 141 You can set this list before loading facemenu.el, or add a face to it before 146 creating that face if you do notwant it to be listed. If you change the142 creating that face if you want it to be listed. If you change the 147 143 variable so as to eliminate faces that have already been added to the menu, 148 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 151 temporarily turning off the feature that automatically adds faces to the menu 152 when they are created." 153 :type '(choice (const :tag "Don't add faces" t) 154 (const :tag "None (do add any face)" nil) 155 (repeat (choice symbol regexp))) 156 :group 'facemenu) 146 If this variable is t, all faces will be added to the menu. This 147 is useful for setting temporarily if you want to add faces to the 148 menu when they are created." 149 :type '(choice (const :tag "List all faces" t) 150 (const :tag "None" nil) 151 (repeat symbol)) 152 :group 'facemenu 153 :version "22.1") 157 154 158 155 ;;;###autoload … … 676 673 (format "Select face `%s' for subsequent insertion." 677 674 name)) 678 (cond ((eq t facemenu-unlisted-faces)) 679 ((memq symbol facemenu-unlisted-faces)) 680 ;; test against regexps in facemenu-unlisted-faces 681 ((let ((unlisted facemenu-unlisted-faces) 682 (matched nil)) 683 (while (and unlisted (not matched)) 684 (if (and (stringp (car unlisted)) 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. 675 (cond ((facemenu-iterate ; check if equivalent face is already in the menu 676 (lambda (m) (and (listp m) 677 (symbolp (car m)) 678 (face-equal (car m) symbol))) 679 (cdr (symbol-function menu)))) 680 ;; Faces with a keyboard equivalent. These go at the front. 681 (key 690 682 (setq function (intern (concat "facemenu-set-" name))) 691 683 (fset function … … 701 693 (define-key 'facemenu-keymap key (cons name function)) 702 694 (define-key menu key (cons name function))) 703 ((facemenu-iterate ; check if equivalent face is already in the menu 704 (lambda (m) (and (listp m) 705 (symbolp (car m)) 706 (face-equal (car m) symbol))) 707 (cdr (symbol-function menu)))) 708 (t ; No keyboard equivalent. Figure out where to put it: 695 ;; Faces with no keyboard equivalent. Figure out where to put it: 696 ((or (eq t facemenu-listed-faces) 697 (memq symbol facemenu-listed-faces)) 709 698 (setq key (vector symbol) 710 699 function 'facemenu-set-face-from-menu 711 700 menu-val (symbol-function menu)) 712 701 (if (and facemenu-new-faces-at-end 713 (> (length menu-val) 3))702 (> (length menu-val) 3)) 714 703 (define-key-after menu-val key (cons name function) 715 704 (car (nth (- (length menu-val) 3) menu-val)))
