changeset 17555:6e2928cff18e

(facemenu-add-new-face): Rewrite to give each lambda expression a doc string.
author Richard M. Stallman <rms@gnu.org>
date Fri, 25 Apr 1997 04:46:19 +0000
parents 0a75fcee3cb8
children c0f8f4264f7a
files lisp/facemenu.el
diffstat 1 files changed, 22 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/facemenu.el	Fri Apr 25 00:44:48 1997 +0000
+++ b/lisp/facemenu.el	Fri Apr 25 04:46:19 1997 +0000
@@ -593,22 +593,35 @@
   "Add a FACE to the appropriate Face menu.
 Automatically called when a new face is created."
   (let* ((name (symbol-name face))
-	 (menu (cond ((string-match "^fg:" name) 
-		      (setq name (substring name 3))
-		      'facemenu-foreground-menu)
-		     ((string-match "^bg:" name) 
-		      (setq name (substring name 3))
-		      'facemenu-background-menu)
-		     (t 'facemenu-face-menu)))
+	 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)))
     (cond ((eq t facemenu-unlisted-faces))
 	  ((memq face facemenu-unlisted-faces))
 	  (key ; has a keyboard equivalent.  These go at the front.
 	   (setq function (intern (concat "facemenu-set-" name)))
 	   (fset function
-		 (` (lambda () (interactive)
-		      (facemenu-set-face (quote (, face))))))
+		 `(lambda ()
+		    ,docstring
+		    (interactive)
+		    (facemenu-set-face (quote (, face)))))
 	   (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