Trailing whitespace deleted.
[bpt/emacs.git] / lisp / facemenu.el
index 14eb548..78bdfc6 100644 (file)
@@ -1,6 +1,6 @@
 ;;; facemenu.el --- create a face menu for interactively adding fonts to text
 
-;; Copyright (c) 1994, 1995, 1996 Free Software Foundation, Inc.
+;; Copyright (c) 1994, 1995, 1996, 2001, 2002 Free Software Foundation, Inc.
 
 ;; Author: Boris Goldowsky <boris@gnu.org>
 ;; Keywords: faces
 
 ;; This file defines a menu of faces (bold, italic, etc) which allows you to
 ;; set the face used for a region of the buffer.  Some faces also have
-;; keybindings, which are shown in the menu.  Faces with names beginning with
-;; "fg:" or "bg:", as in "fg:red", are treated specially.
-;; Such faces are assumed to consist only of a foreground (if "fg:") or
-;; background (if "bg:") color.  They are thus put into the color submenus
-;; rather than the general Face submenu.  These faces can also be
-;; automatically created by selecting the "Other..." menu items in the
-;; "Foreground" and "Background" submenus.
+;; keybindings, which are shown in the menu.
 ;;
 ;; The menu also contains submenus for indentation and justification-changing
 ;; commands.
@@ -44,7 +38,7 @@
 ;; insertion.  It will be forgotten if you move point or make other
 ;; modifications before inserting or typing anything.
 ;;
-;; Faces can be selected from the keyboard as well.  
+;; Faces can be selected from the keyboard as well.
 ;; The standard keybindings are M-g (or ESC g) + letter:
 ;; M-g i = "set italic",  M-g b = "set bold", etc.
 
 
 ;;; Code:
 
-(provide 'facemenu)
+(eval-when-compile
+  (require 'help)
+  (require 'button))
 
 ;;; Provide some binding for startup:
 ;;;###autoload (define-key global-map "\M-g" 'facemenu-keymap)
 ;;;###autoload (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap)
-  
+
 ;; Global bindings:
 (define-key global-map [C-down-mouse-2] 'facemenu-menu)
 (define-key global-map "\M-g" 'facemenu-keymap)
     (italic      . "i")
     (bold-italic . "l") ; {bold} intersect {italic} = {l}
     (underline   . "u"))
-  "Alist of interesting faces and keybindings. 
+  "Alist of interesting faces and keybindings.
 Each element is itself a list: the car is the name of the face,
 the next element is the key to use as a keyboard equivalent of the menu item;
 the binding is made in `facemenu-keymap'.
 
 The faces specifically mentioned in this list are put at the top of
 the menu, in the order specified.  All other faces which are defined,
-except for those in `facemenu-unlisted-faces', are listed after them, 
+except for those in `facemenu-unlisted-faces', are listed after them,
 but get no keyboard equivalents.
 
 If you change this variable after loading facemenu.el, you will need to call
@@ -136,10 +132,10 @@ just before \"Other\" at the end."
   :group 'facemenu)
 
 (defcustom facemenu-unlisted-faces
-  '(modeline region secondary-selection highlight scratch-face
-    (purecopy "^font-lock-") (purecopy "^gnus-") (purecopy "^message-")
-    (purecopy "^ediff-") (purecopy "^term-") (purecopy "^vc-")
-    (purecopy "^widget-") (purecopy "^custom-") (purecopy "^vm-"))
+  `(modeline region secondary-selection highlight scratch-face
+    ,(purecopy "^font-lock-") ,(purecopy "^gnus-") ,(purecopy "^message-")
+    ,(purecopy "^ediff-") ,(purecopy "^term-") ,(purecopy "^vc-")
+    ,(purecopy "^widget-") ,(purecopy "^custom-") ,(purecopy "^vm-"))
   "*List of faces not to include in the Face menu.
 Each element may be either a symbol, which is the name of a face, or a string,
 which is a regular expression to be matched against face names.  Matching
@@ -153,8 +149,8 @@ call `facemenu-update' to recalculate the menu contents.
 If this variable is t, no faces will be added to the menu.  This is useful for
 temporarily turning off the feature that automatically adds faces to the menu
 when they are created."
-  :type '(choice (const :tag "Don't add" t)
-                (const :tag "None" nil)
+  :type '(choice (const :tag "Don't add faces" t)
+                (const :tag "None (do add any face)" nil)
                 (repeat (choice symbol regexp)))
   :group 'facemenu)
 
@@ -168,7 +164,7 @@ when they are created."
 (defalias 'facemenu-face-menu facemenu-face-menu)
 
 ;;;###autoload
-(defvar facemenu-foreground-menu 
+(defvar facemenu-foreground-menu
   (let ((map (make-sparse-keymap "Foreground Color")))
     (define-key map "o" (cons "Other..." 'facemenu-set-foreground))
     map)
@@ -186,7 +182,7 @@ when they are created."
 (defalias 'facemenu-background-menu facemenu-background-menu)
 
 ;;;###autoload
-(defvar facemenu-special-menu 
+(defvar facemenu-special-menu
   (let ((map (make-sparse-keymap "Special")))
     (define-key map [?s] (cons (purecopy "Remove Special")
                               'facemenu-remove-special))
@@ -217,7 +213,7 @@ when they are created."
 ;;;###autoload
 (defvar facemenu-indentation-menu
   (let ((map (make-sparse-keymap "Indentation")))
-    (define-key map [decrease-right-margin] 
+    (define-key map [decrease-right-margin]
       (cons (purecopy "Indent Right Less") 'decrease-right-margin))
     (define-key map [increase-right-margin]
       (cons (purecopy "Indent Right More") 'increase-right-margin))
@@ -240,8 +236,8 @@ when they are created."
 (let ((map facemenu-menu))
   (define-key map [dc] (cons (purecopy "Display Colors") 'list-colors-display))
   (define-key map [df] (cons (purecopy "Display Faces") 'list-faces-display))
-  (define-key map [dp] (cons (purecopy "List Properties")
-                            'list-text-properties-at))
+  (define-key map [dp] (cons (purecopy "Describe Properties")
+                            'describe-text-properties))
   (define-key map [ra] (cons (purecopy "Remove Text Properties")
                             'facemenu-remove-all))
   (define-key map [rm] (cons (purecopy "Remove Face Properties")
@@ -249,23 +245,23 @@ when they are created."
   (define-key map [s1] (list (purecopy "--"))))
 ;;;###autoload
 (let ((map facemenu-menu))
-  (define-key map [in] (cons (purecopy "Indentation") 
+  (define-key map [in] (cons (purecopy "Indentation")
                             'facemenu-indentation-menu))
   (define-key map [ju] (cons (purecopy "Justification")
                             'facemenu-justification-menu))
   (define-key map [s2] (list (purecopy "--")))
-  (define-key map [sp] (cons (purecopy "Special Properties") 
+  (define-key map [sp] (cons (purecopy "Special Properties")
                             'facemenu-special-menu))
-  (define-key map [bg] (cons (purecopy "Background Color") 
+  (define-key map [bg] (cons (purecopy "Background Color")
                             'facemenu-background-menu))
-  (define-key map [fg] (cons (purecopy "Foreground Color") 
+  (define-key map [fg] (cons (purecopy "Foreground Color")
                             'facemenu-foreground-menu))
-  (define-key map [fc] (cons (purecopy "Face") 
+  (define-key map [fc] (cons (purecopy "Face")
                             'facemenu-face-menu)))
 ;;;###autoload
 (defalias 'facemenu-menu facemenu-menu)
 
-(defvar facemenu-keymap 
+(defvar facemenu-keymap
   (let ((map (make-sparse-keymap "Set face")))
     (define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face))
     map)
@@ -321,55 +317,75 @@ variables."
 ;;;###autoload
 (defun facemenu-set-face (face &optional start end)
   "Add FACE to the region or next character typed.
-It will be added to the top of the face list; any faces lower on the list that
+This adds FACE to the top of the face list; any faces lower on the list that
 will not show through at all will be removed.
 
-Interactively, the face to be used is read with the minibuffer.
+Interactively, reads the face name with the minibuffer.
 
-If the region is active and there is no prefix argument,
-this command sets the region to the requested face.
+If the region is active (normally true except in Transient Mark mode)
+and there is no prefix argument, this command sets the region to the
+requested face.
 
 Otherwise, this command specifies the face for the next character
 inserted.  Moving point or switching buffers before
-typing a character to insert cancels the specification." 
-  (interactive (list (read-face-name "Use face")))
-  (barf-if-buffer-read-only)
+typing a character to insert cancels the specification."
+  (interactive (list (progn
+                      (barf-if-buffer-read-only)
+                      (read-face-name "Use face"))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-beginning))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-end))))
   (facemenu-add-new-face face)
-  (if (and mark-active (not current-prefix-arg))
-      (let ((start (or start (region-beginning)))
-           (end (or end (region-end))))
-       (facemenu-add-face face start end))
-    (facemenu-add-face face)))
+  (facemenu-add-face face start end))
 
 ;;;###autoload
 (defun facemenu-set-foreground (color &optional start end)
   "Set the foreground COLOR of the region or next character typed.
-The color is prompted for.  A face named `fg:color' is used \(or created).
-If the region is active, it will be set to the requested face.  If
-it is inactive \(even if mark-even-if-inactive is set) the next
-character that is typed \(via `self-insert-command') will be set to
-the selected face.  Moving point or switching buffers before
-typing a character cancels the request." 
-  (interactive (list (facemenu-read-color "Foreground color: ")))
-  (let ((face (intern (concat "fg:" color))))
-    (or (facemenu-get-face face)
-       (error "Unknown color: %s" color))
-    (facemenu-set-face face start end)))
+This command reads the color in the minibuffer.
+
+If the region is active (normally true except in Transient Mark mode)
+and there is no prefix argument, this command sets the region to the
+requested face.
+
+Otherwise, this command specifies the face for the next character
+inserted.  Moving point or switching buffers before
+typing a character to insert cancels the specification."
+  (interactive (list (progn
+                      (barf-if-buffer-read-only)
+                      (facemenu-read-color "Foreground color: "))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-beginning))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-end))))
+  (unless (color-defined-p color)
+    (message "Color `%s' undefined" color))
+  (facemenu-add-new-color color 'facemenu-foreground-menu)
+  (facemenu-add-face (list (list :foreground color)) start end))
 
 ;;;###autoload
 (defun facemenu-set-background (color &optional start end)
   "Set the background COLOR of the region or next character typed.
-The color is prompted for.  A face named `bg:color' is used \(or created).
-If the region is active, it will be set to the requested face.  If
-it is inactive \(even if mark-even-if-inactive is set) the next
-character that is typed \(via `self-insert-command') will be set to
-the selected face.  Moving point or switching buffers before
-typing a character cancels the request." 
-  (interactive (list (facemenu-read-color "Background color: ")))
-  (let ((face (intern (concat "bg:" color))))
-    (or (facemenu-get-face face)
-       (error "Unknown color: %s" color))
-    (facemenu-set-face face start end)))
+This command reads the color in the minibuffer.
+
+If the region is active (normally true except in Transient Mark mode)
+and there is no prefix argument, this command sets the region to the
+requested face.
+
+Otherwise, this command specifies the face for the next character
+inserted.  Moving point or switching buffers before
+typing a character to insert cancels the specification."
+  (interactive (list (progn
+                      (barf-if-buffer-read-only)
+                      (facemenu-read-color "Background color: "))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-beginning))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-end))))
+  (unless (color-defined-p color)
+    (message "Color `%s' undefined" color))
+  (facemenu-add-new-color color 'facemenu-background-menu)
+  (facemenu-add-face (list (list :background color)) start end))
 
 ;;;###autoload
 (defun facemenu-set-face-from-menu (face start end)
@@ -377,12 +393,13 @@ typing a character cancels the request."
 This function is designed to be called from a menu; the face to use
 is the menu item's name.
 
-If the region is active and there is no prefix argument,
-this command sets the region to the requested face.
+If the region is active (normally true except in Transient Mark mode)
+and there is no prefix argument, this command sets the region to the
+requested face.
 
 Otherwise, this command specifies the face for the next character
 inserted.  Moving point or switching buffers before
-typing a character to insert cancels the specification." 
+typing a character to insert cancels the specification."
   (interactive (list last-command-event
                     (if (and mark-active (not current-prefix-arg))
                         (region-beginning))
@@ -390,7 +407,7 @@ typing a character to insert cancels the specification."
                         (region-end))))
   (barf-if-buffer-read-only)
   (facemenu-get-face face)
-  (if start 
+  (if start
       (facemenu-add-face face start end)
     (facemenu-add-face face)))
 
@@ -423,7 +440,7 @@ This sets the `read-only' text property; it can be undone with
   "Remove `face' and `mouse-face' text properties."
   (interactive "*r") ; error if buffer is read-only despite the next line.
   (let ((inhibit-read-only t))
-    (remove-text-properties 
+    (remove-text-properties
      start end '(face nil mouse-face nil))))
 
 ;;;###autoload
@@ -439,50 +456,15 @@ This sets the `read-only' text property; it can be undone with
 These special properties include `invisible', `intangible' and `read-only'."
   (interactive "*r") ; error if buffer is read-only despite the next line.
   (let ((inhibit-read-only t))
-    (remove-text-properties 
+    (remove-text-properties
      start end '(invisible nil intangible nil read-only nil))))
-
-;;;###autoload
-(defun list-text-properties-at (p)
-  "Pop up a buffer listing text-properties at LOCATION."
-  (interactive "d")
-  (let ((props (text-properties-at p))
-       category
-       str)
-    (if (null props)
-       (message "None")
-      (if (and (not (cdr (cdr props)))
-              (not (eq (car props) 'category))
-              (< (length (setq str (format "Text property at %d:  %s  %S"
-                                           p (car props) (car (cdr props)))))
-                 (frame-width)))
-         (message "%s" str)
-       (with-output-to-temp-buffer "*Text Properties*"
-         (princ (format "Text properties at %d:\n\n" p))
-         (setq help-xref-stack nil)
-         (while props
-           (if (eq (car props) 'category)
-               (setq category (car (cdr props))))
-           (princ (format "%-20s %S\n"
-                          (car props) (car (cdr props))))
-           (setq props (cdr (cdr props))))
-         (if category
-             (progn
-               (setq props (symbol-plist category))
-               (princ (format "\nCategory %s:\n\n" category))
-               (while props
-                 (princ (format "%-20s %S\n"
-                                (car props) (car (cdr props))))
-                 (if (eq (car props) 'category)
-                     (setq category (car (cdr props))))
-                 (setq props (cdr (cdr props)))))))))))
-
+\f
 ;;;###autoload
 (defun facemenu-read-color (&optional prompt)
   "Read a color using the minibuffer."
-  (let ((col (completing-read (or prompt "Color: ") 
+  (let ((col (completing-read (or prompt "Color: ")
                              (or facemenu-color-alist
-                                 (mapcar 'list (defined-colors)))
+                                 (defined-colors))
                              nil t)))
     (if (equal "" col)
        nil
@@ -495,14 +477,19 @@ If the optional argument LIST is non-nil, it should be a list of
 colors to display.  Otherwise, this command computes a list
 of colors that the current display can handle."
   (interactive)
-  (when (null list)
+  (when (and (null list) (> (display-color-cells) 0))
     (setq list (defined-colors))
     ;; Delete duplicate colors.
     (let ((l list))
       (while (cdr l)
        (if (facemenu-color-equal (car l) (car (cdr l)))
            (setcdr l (cdr (cdr l)))
-         (setq l (cdr l))))))
+         (setq l (cdr l)))))
+    (when (memq (display-visual-class) '(gray-scale pseudo-color direct-color))
+      ;; Don't show more than what the display can handle.
+      (let ((lc (nthcdr (1- (display-color-cells)) list)))
+       (if lc
+           (setcdr lc nil)))))
   (with-output-to-temp-buffer "*Colors*"
     (save-excursion
       (set-buffer standard-output)
@@ -511,11 +498,11 @@ of colors that the current display can handle."
          (setq s (point))
          (insert (car list))
          (indent-to 20)
-         (put-text-property s (point) 'face 
+         (put-text-property s (point) 'face
                             (cons 'background-color (car list)))
          (setq s (point))
          (insert "  " (car list) "\n")
-         (put-text-property s (point) 'face 
+         (put-text-property s (point) 'face
                             (cons 'foreground-color (car list)))
          (setq list (cdr list)))))))
 
@@ -534,7 +521,7 @@ If START is nil or START to END is empty, add FACE to next typed character
 instead.  For each section of that region that has a different face property,
 FACE will be consed onto it, and other faces that are completely hidden by
 that will be removed from the list.
-If `facemenu-add-face-function' and maybe `facemenu-end-add-face' are non-`nil'
+If `facemenu-add-face-function' and maybe `facemenu-end-add-face' are non-nil,
 they are used to set the face information.
 
 As a special case, if FACE is `default', then the region is left with NO face
@@ -588,15 +575,25 @@ This means each face attribute is not specified in a face earlier in FACE-LIST
 and such a face is therefore active when used to display text.
 If the optional argument FRAME is given, use the faces in that frame; otherwise
 use the selected frame.  If t, then the global, non-frame faces are used."
-  (let* ((mask-atts (copy-sequence (internal-get-face (car face-list) frame)))
+  (let* ((mask-atts (copy-sequence
+                    (if (consp (car face-list))
+                        (face-attributes-as-vector (car face-list))
+                      (or (internal-lisp-face-p (car face-list) frame)
+                          (check-face (car face-list))))))
         (active-list (list (car face-list)))
         (face-list (cdr face-list))
         (mask-len (length mask-atts)))
     (while face-list
-      (if (let ((face-atts (internal-get-face (car face-list) frame))
-               (i mask-len) (useful nil))
+      (if (let ((face-atts
+                (if (consp (car face-list))
+                    (face-attributes-as-vector (car face-list))
+                  (or (internal-lisp-face-p (car face-list) frame)
+                      (check-face (car face-list)))))
+               (i mask-len)
+               (useful nil))
            (while (> (setq i (1- i)) 1)
-             (and (aref face-atts i) (not (aref mask-atts i))
+             (and (not (memq (aref face-atts i) '(nil unspecified)))
+                  (memq (aref mask-atts i) '(nil unspecified))
                   (aset mask-atts i (setq useful t))))
            useful)
          (setq active-list (cons (car face-list) active-list)))
@@ -605,54 +602,32 @@ use the selected frame.  If t, then the global, non-frame faces are used."
 
 (defun facemenu-get-face (symbol)
   "Make sure FACE exists.
-If not, create it and add it to the appropriate menu.  Return the SYMBOL.
-
-If a window system is in use, and this function creates a face named
-`fg:color', then it sets the foreground to that color.  Likewise, `bg:color'
-means to set the background.  In either case, if the color is undefined,
-no color is set and a warning is issued."
-  (let ((name (symbol-name symbol))
-       foreground)
+If not, create it and add it to the appropriate menu.  Return the SYMBOL."
+  (let ((name (symbol-name symbol)))
     (cond ((facep symbol))
-         ((and (display-color-p)
-               (or (setq foreground (string-match "^fg:" name))
-                   (string-match "^bg:" name)))
-          (let ((face (make-face symbol))
-                (color (substring name 3)))
-            (if (x-color-defined-p color)
-                (if foreground
-                    (set-face-foreground face color)
-                  (set-face-background face color))
-              (message "Color \"%s\" undefined" color))))
          (t (make-face symbol))))
   symbol)
 
 (defun facemenu-add-new-face (face)
-  "Add a FACE to the appropriate Face menu.
-Automatically called when a new face is created."
-  (let* ((name (symbol-name face))
+  "Add FACE (a face) to the Face menu.
+
+This is called whenever you create a new face."
+  (let* (name
+        symbol
         menu docstring
         (key (cdr (assoc face facemenu-keybindings)))
         function menu-val)
-    (cond ((string-match "^fg:" name) 
-          (setq name (substring name 3))
-          (setq docstring
-                (format "Select foreground color %s for subsequent insertion."
-                        name))
-          (setq menu 'facemenu-foreground-menu))
-         ((string-match "^bg:" name) 
-          (setq name (substring name 3))
-          (setq docstring
-                (format "Select background color %s for subsequent insertion."
-                        name))
-          (setq menu 'facemenu-background-menu))
-         (t
-          (setq docstring
-                (format "Select face `%s' for subsequent insertion."
-                        name))
-          (setq menu 'facemenu-face-menu)))
+    (if (symbolp face)
+       (setq name (symbol-name face)
+             symbol face)
+      (setq name face
+           symbol (intern name)))
+    (setq menu 'facemenu-face-menu)
+    (setq docstring
+         (format "Select face `%s' for subsequent insertion."
+                 name))
     (cond ((eq t facemenu-unlisted-faces))
-         ((memq face facemenu-unlisted-faces))
+         ((memq symbol facemenu-unlisted-faces))
          ;; test against regexps in facemenu-unlisted-faces
          ((let ((unlisted facemenu-unlisted-faces)
                 (matched nil))
@@ -668,16 +643,63 @@ Automatically called when a new face is created."
                 `(lambda ()
                    ,docstring
                    (interactive)
-                   (facemenu-set-face (quote ,face))))
+                   (facemenu-set-face
+                    (quote ,symbol)
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-beginning))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-end)))))
           (define-key 'facemenu-keymap key (cons name function))
           (define-key menu key (cons name function)))
          ((facemenu-iterate ; check if equivalent face is already in the menu
-           (lambda (m) (and (listp m) 
+           (lambda (m) (and (listp m)
+                            (symbolp (car m))
+                            (face-equal (car m) symbol)))
+           (cdr (symbol-function menu))))
+         (t   ; No keyboard equivalent.  Figure out where to put it:
+          (setq key (vector symbol)
+                function 'facemenu-set-face-from-menu
+                menu-val (symbol-function menu))
+          (if (and facemenu-new-faces-at-end
+                  (> (length menu-val) 3))
+              (define-key-after menu-val key (cons name function)
+                (car (nth (- (length menu-val) 3) menu-val)))
+            (define-key menu key (cons name function))))))
+  nil) ; Return nil for facemenu-iterate
+
+(defun facemenu-add-new-color (color &optional menu)
+  "Add COLOR (a color name string) to the appropriate Face menu.
+MENU should be `facemenu-foreground-menu' or
+`facemenu-background-menu'.
+
+This is called whenever you use a new color."
+  (let* (name
+        symbol
+        docstring
+        function menu-val key
+        (color-p (memq menu '(facemenu-foreground-menu
+                              facemenu-background-menu))))
+    (unless (stringp color)
+      (error "%s is not a color" color))
+    (setq name color
+         symbol (intern name))
+
+    (cond ((eq menu 'facemenu-foreground-menu)
+          (setq docstring
+                (format "Select foreground color %s for subsequent insertion."
+                        name)))
+         ((eq menu 'facemenu-background-menu)
+          (setq docstring
+                (format "Select background color %s for subsequent insertion."
+                        name))))
+    (cond ((facemenu-iterate ; check if equivalent face is already in the menu
+           (lambda (m) (and (listp m)
                             (symbolp (car m))
-                            (face-equal (car m) face)))
+                            (stringp (cadr m))
+                            (string-equal (cadr m) color)))
            (cdr (symbol-function menu))))
          (t   ; No keyboard equivalent.  Figure out where to put it:
-          (setq key (vector face)
+          (setq key (vector symbol)
                 function 'facemenu-set-face-from-menu
                 menu-val (symbol-function menu))
           (if (and facemenu-new-faces-at-end
@@ -689,13 +711,13 @@ Automatically called when a new face is created."
 
 (defun facemenu-complete-face-list (&optional oldlist)
   "Return list of all faces that look different.
-Starts with given ALIST of faces, and adds elements only if they display 
+Starts with given ALIST of faces, and adds elements only if they display
 differently from any face already on the list.
-The faces on ALIST will end up at the end of the returned list, in reverse 
+The faces on ALIST will end up at the end of the returned list, in reverse
 order."
   (let ((list (nreverse (mapcar 'car oldlist))))
-    (facemenu-iterate 
-     (lambda (new-face) 
+    (facemenu-iterate
+     (lambda (new-face)
        (if (not (memq new-face list))
           (setq list (cons new-face list)))
        nil)
@@ -711,4 +733,5 @@ Returns the non-nil value it found, or nil if all were nil."
 
 (facemenu-update)
 
+(provide 'facemenu)
 ;;; facemenu.el ends here