Show
Ignore:
Timestamp:
2006年07月16日 08時36分52秒 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/facemenu.el

    r4098 r4111  
    6868;; The order of the faces that appear in the menu and their keybindings can be 
    6969;; controlled by setting the variables `facemenu-keybindings' and 
    70 ;; `facemenu-new-faces-at-end'.  List faces that you don't use in documents 
    71 ;; (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'. 
    7272 
    7373;;; Known Problems: 
     
    117117 
    118118The 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 no keyboard equivalents. 
     119the menu, in the order specified.  All other faces which are defined 
     120in `facemenu-listed-faces' are listed after them, but get no 
     121keyboard equivalents. 
    122122 
    123123If you change this variable after loading facemenu.el, you will need to call 
     
    133133  :group 'facemenu) 
    134134 
    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. 
     137Each element should be a symbol, which is the name of a face. 
     138The \"basic \" faces in `facemenu-keybindings' are automatically 
     139added to the Face menu, and are not included in this list. 
    144140 
    145141You 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 
     142creating that face if you want it to be listed.  If you change the 
    147143variable so as to eliminate faces that have already been added to the menu, 
    148144call `facemenu-update' to recalculate the menu contents. 
    149145 
    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) 
     146If this variable is t, all faces will be added to the menu.  This 
     147is useful for setting temporarily if you want to add faces to the 
     148menu 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") 
    157154 
    158155;;;###autoload 
     
    676673          (format "Select face `%s' for subsequent insertion." 
    677674                  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 
    690682           (setq function (intern (concat "facemenu-set-" name))) 
    691683           (fset function 
     
    701693           (define-key 'facemenu-keymap key (cons name function)) 
    702694           (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)) 
    709698           (setq key (vector symbol) 
    710699                 function 'facemenu-set-face-from-menu 
    711700                 menu-val (symbol-function menu)) 
    712701           (if (and facemenu-new-faces-at-end 
    713                    (> (length menu-val) 3)) 
     702                    (> (length menu-val) 3)) 
    714703               (define-key-after menu-val key (cons name function) 
    715704                 (car (nth (- (length menu-val) 3) menu-val)))