changeset 28840:d0531e35d9f2

Some doc fixes. (describe-face): Add customize button. Return the help text. Fix prompt.
author Dave Love <fx@gnu.org>
date Tue, 09 May 2000 15:45:57 +0000
parents fbefbd8057b8
children 354a826d7b20
files lisp/faces.el
diffstat 1 files changed, 34 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Tue May 09 09:34:22 2000 +0000
+++ b/lisp/faces.el	Tue May 09 15:45:57 2000 +0000
@@ -143,7 +143,7 @@
 
 ;; The functions in this section are defined because Lisp packages use
 ;; them, despite the prefix `internal-' suggesting that they are
-;; private to the face implementation.  
+;; private to the face implementation.
 
 (defun internal-find-face (name &optional frame)
   "Retrieve the face named NAME.
@@ -156,6 +156,7 @@
 This function is defined for compatibility with Emacs 20.2.  It
 should not be used anymore."
   (facep name))
+(make-obsolete 'internal-find-face 'facep)
 
 
 (defun internal-get-face (name &optional frame)
@@ -169,7 +170,7 @@
 should not be used anymore."
   (or (internal-find-face name frame)
       (check-face name)))
-
+(make-obsolete 'internal-find-face "See `facep' and `check-face'.")
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -512,7 +513,7 @@
 `:inverse-video'
 
 VALUE specifies whether characters in FACE should be displayed in
-inverse video. VALUE must be one of t or nil.
+inverse video.  VALUE must be one of t or nil.
 
 `:stipple'
 
@@ -578,7 +579,8 @@
 
 (defun make-face-unitalic (face &optional frame noerror)
   "Make the font of FACE be non-italic, if possible.
-FRAME nil or not specified means change face on all frames."
+FRAME nil or not specified means change face on all frames.
+Argument NOERROR is ignored and retained for compatibility."
   (interactive (list (read-face-name "Make which face non-italic ")))
   (set-face-attribute face frame :slant 'normal))
 
@@ -624,7 +626,7 @@
 (defun set-face-stipple (face stipple &optional frame)
   "Change the stipple pixmap of face FACE to STIPPLE.
 FRAME nil or not specified means change face on all frames.
-STIPPLE. should be a string, the name of a file of pixmap data.
+STIPPLE should be a string, the name of a file of pixmap data.
 The directories listed in the `x-bitmap-file-path' variable are searched.
 
 Alternatively, STIPPLE may be a list of the form (WIDTH HEIGHT DATA)
@@ -985,7 +987,11 @@
 	  (save-excursion
 	    (save-match-data
 	      (search-backward face-name)
-	      (help-xref-button 0 #'customize-face face-name
+	      (help-xref-button 0 (lambda (f)
+				    (if help-xref-stack
+					(pop help-xref-stack))
+				    (customize-face f))
+				face-name
 				"mouse-2: customize this face")))
 	  (let ((beg (point)))
 	    (insert list-faces-sample-text)
@@ -1023,7 +1029,7 @@
 If the optional argument FRAME is given, report on face FACE in that frame.
 If FRAME is t, report on the defaults for face FACE (for new frames).
 If FRAME is omitted or nil, use the selected frame."
-  (interactive (list (read-face-name "Describe face ")))
+  (interactive (list (read-face-name "Describe face")))
   (let* ((attrs '((:family . "Family")
 		  (:width . "Width")
 		  (:height . "Height")
@@ -1049,11 +1055,21 @@
 		    (cdr a) ": " (format "%s" attr) "\n")))
 	(insert "\nDocumentation:\n\n"
 		(or (face-documentation face)
-		    "not documented as a face.")))
-      (print-help-return-message))))
-  
-
-
+		    "not documented as a face."))
+	(let ((customize-label "customize"))
+	  (terpri)
+	  (terpri)
+	  (princ (concat "You can " customize-label " this face."))
+	  (with-current-buffer "*Help*"
+	    (save-excursion
+	      (re-search-backward
+	       (concat "\\(" customize-label "\\)") nil t)
+	      (help-xref-button 1 #'customize-face face
+				"mouse-2, RET: customize face")))))
+      (print-help-return-message)
+      (with-current-buffer "*Help*"
+	(help-setup-xref (list #'describe-face face) (interactive-p))
+	(buffer-string)))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Face specifications (defface).
@@ -1107,7 +1123,7 @@
 			((eq req 'background)
 			 (memq (frame-parameter frame 'background-mode)
 			       options))
-			(t (error "Unknown req `%S' with options `%S'" 
+			(t (error "Unknown req `%S' with options `%S'"
 				  req options)))))
     match))
 
@@ -1259,7 +1275,7 @@
 	   (set var value)
 	   (mapcar 'frame-set-background-mode (frame-list)))
   :initialize 'custom-initialize-changed
-  :type '(choice (choice-item dark) 
+  :type '(choice (choice-item dark)
 		 (choice-item light)
 		 (choice-item :tag "default" nil)))
 
@@ -1455,14 +1471,14 @@
 
 (defun frame-update-faces (frame)
   nil)
-
+(make-obsolete 'frame-update-faces "No longer necessary")
 
 ;; Update the colors of FACE, after FRAME's own colors have been
 ;; changed.
 
 (defun frame-update-face-colors (frame)
   (frame-set-background-mode frame))
-
+(make-obsolete 'frame-update-face-colors 'frame-set-background-mode)
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1704,7 +1720,7 @@
 		"\\([-*?]\\|\\'\\)"))
   (setq x-font-regexp-slant (concat - slant -))
   (setq x-font-regexp-weight (concat - weight -))
-  nil)	    
+  nil)
 
 
 (defun x-resolve-font-name (pattern &optional face frame)
@@ -1821,7 +1837,6 @@
   (and (setq font (x-make-font-bold font))
        (x-make-font-italic font)))
 
-
 (provide 'faces)
 
-;;; end of faces.el
+;;; faces.el ends here