aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-05-09 15:45:57 +0000
committerDave Love2000-05-09 15:45:57 +0000
commit70d0c3b0635782e468dee87f2b87cc29e2f94d0a (patch)
tree22dd564da24173703269952e17b4196f07f3eb42
parent82e2ca9d0116cd7e8f29cb2eaf74f44a41841534 (diff)
downloademacs-70d0c3b0635782e468dee87f2b87cc29e2f94d0a.tar.gz
emacs-70d0c3b0635782e468dee87f2b87cc29e2f94d0a.zip
Some doc fixes.
(describe-face): Add customize button. Return the help text. Fix prompt.
-rw-r--r--lisp/faces.el53
1 files changed, 34 insertions, 19 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index a7aad7f8e7f..36d95cafe71 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -143,7 +143,7 @@ to NEW-FACE on frame NEW-FRAME."
143 143
144;; The functions in this section are defined because Lisp packages use 144;; The functions in this section are defined because Lisp packages use
145;; them, despite the prefix `internal-' suggesting that they are 145;; them, despite the prefix `internal-' suggesting that they are
146;; private to the face implementation. 146;; private to the face implementation.
147 147
148(defun internal-find-face (name &optional frame) 148(defun internal-find-face (name &optional frame)
149 "Retrieve the face named NAME. 149 "Retrieve the face named NAME.
@@ -156,6 +156,7 @@ If NAME is already a face, it is simply returned.
156This function is defined for compatibility with Emacs 20.2. It 156This function is defined for compatibility with Emacs 20.2. It
157should not be used anymore." 157should not be used anymore."
158 (facep name)) 158 (facep name))
159(make-obsolete 'internal-find-face 'facep)
159 160
160 161
161(defun internal-get-face (name &optional frame) 162(defun internal-get-face (name &optional frame)
@@ -169,7 +170,7 @@ This function is defined for compatibility with Emacs 20.2. It
169should not be used anymore." 170should not be used anymore."
170 (or (internal-find-face name frame) 171 (or (internal-find-face name frame)
171 (check-face name))) 172 (check-face name)))
172 173(make-obsolete 'internal-find-face "See `facep' and `check-face'.")
173 174
174 175
175;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 176;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -512,7 +513,7 @@ box.
512`:inverse-video' 513`:inverse-video'
513 514
514VALUE specifies whether characters in FACE should be displayed in 515VALUE specifies whether characters in FACE should be displayed in
515inverse video. VALUE must be one of t or nil. 516inverse video. VALUE must be one of t or nil.
516 517
517`:stipple' 518`:stipple'
518 519
@@ -578,7 +579,8 @@ Use `set-face-attribute' for finer control of the font slant."
578 579
579(defun make-face-unitalic (face &optional frame noerror) 580(defun make-face-unitalic (face &optional frame noerror)
580 "Make the font of FACE be non-italic, if possible. 581 "Make the font of FACE be non-italic, if possible.
581FRAME nil or not specified means change face on all frames." 582FRAME nil or not specified means change face on all frames.
583Argument NOERROR is ignored and retained for compatibility."
582 (interactive (list (read-face-name "Make which face non-italic "))) 584 (interactive (list (read-face-name "Make which face non-italic ")))
583 (set-face-attribute face frame :slant 'normal)) 585 (set-face-attribute face frame :slant 'normal))
584 586
@@ -624,7 +626,7 @@ When called interactively, prompt for the face and color."
624(defun set-face-stipple (face stipple &optional frame) 626(defun set-face-stipple (face stipple &optional frame)
625 "Change the stipple pixmap of face FACE to STIPPLE. 627 "Change the stipple pixmap of face FACE to STIPPLE.
626FRAME nil or not specified means change face on all frames. 628FRAME nil or not specified means change face on all frames.
627STIPPLE. should be a string, the name of a file of pixmap data. 629STIPPLE should be a string, the name of a file of pixmap data.
628The directories listed in the `x-bitmap-file-path' variable are searched. 630The directories listed in the `x-bitmap-file-path' variable are searched.
629 631
630Alternatively, STIPPLE may be a list of the form (WIDTH HEIGHT DATA) 632Alternatively, STIPPLE may be a list of the form (WIDTH HEIGHT DATA)
@@ -985,7 +987,11 @@ The sample text is a string that comes from the variable
985 (save-excursion 987 (save-excursion
986 (save-match-data 988 (save-match-data
987 (search-backward face-name) 989 (search-backward face-name)
988 (help-xref-button 0 #'customize-face face-name 990 (help-xref-button 0 (lambda (f)
991 (if help-xref-stack
992 (pop help-xref-stack))
993 (customize-face f))
994 face-name
989 "mouse-2: customize this face"))) 995 "mouse-2: customize this face")))
990 (let ((beg (point))) 996 (let ((beg (point)))
991 (insert list-faces-sample-text) 997 (insert list-faces-sample-text)
@@ -1023,7 +1029,7 @@ The sample text is a string that comes from the variable
1023If the optional argument FRAME is given, report on face FACE in that frame. 1029If the optional argument FRAME is given, report on face FACE in that frame.
1024If FRAME is t, report on the defaults for face FACE (for new frames). 1030If FRAME is t, report on the defaults for face FACE (for new frames).
1025If FRAME is omitted or nil, use the selected frame." 1031If FRAME is omitted or nil, use the selected frame."
1026 (interactive (list (read-face-name "Describe face "))) 1032 (interactive (list (read-face-name "Describe face")))
1027 (let* ((attrs '((:family . "Family") 1033 (let* ((attrs '((:family . "Family")
1028 (:width . "Width") 1034 (:width . "Width")
1029 (:height . "Height") 1035 (:height . "Height")
@@ -1049,11 +1055,21 @@ If FRAME is omitted or nil, use the selected frame."
1049 (cdr a) ": " (format "%s" attr) "\n"))) 1055 (cdr a) ": " (format "%s" attr) "\n")))
1050 (insert "\nDocumentation:\n\n" 1056 (insert "\nDocumentation:\n\n"
1051 (or (face-documentation face) 1057 (or (face-documentation face)
1052 "not documented as a face."))) 1058 "not documented as a face."))
1053 (print-help-return-message)))) 1059 (let ((customize-label "customize"))
1054 1060 (terpri)
1055 1061 (terpri)
1056 1062 (princ (concat "You can " customize-label " this face."))
1063 (with-current-buffer "*Help*"
1064 (save-excursion
1065 (re-search-backward
1066 (concat "\\(" customize-label "\\)") nil t)
1067 (help-xref-button 1 #'customize-face face
1068 "mouse-2, RET: customize face")))))
1069 (print-help-return-message)
1070 (with-current-buffer "*Help*"
1071 (help-setup-xref (list #'describe-face face) (interactive-p))
1072 (buffer-string)))))
1057 1073
1058;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1074;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1059;;; Face specifications (defface). 1075;;; Face specifications (defface).
@@ -1107,7 +1123,7 @@ If FRAME is nil, the current FRAME is used."
1107 ((eq req 'background) 1123 ((eq req 'background)
1108 (memq (frame-parameter frame 'background-mode) 1124 (memq (frame-parameter frame 'background-mode)
1109 options)) 1125 options))
1110 (t (error "Unknown req `%S' with options `%S'" 1126 (t (error "Unknown req `%S' with options `%S'"
1111 req options))))) 1127 req options)))))
1112 match)) 1128 match))
1113 1129
@@ -1259,7 +1275,7 @@ examine the brightness for you."
1259 (set var value) 1275 (set var value)
1260 (mapcar 'frame-set-background-mode (frame-list))) 1276 (mapcar 'frame-set-background-mode (frame-list)))
1261 :initialize 'custom-initialize-changed 1277 :initialize 'custom-initialize-changed
1262 :type '(choice (choice-item dark) 1278 :type '(choice (choice-item dark)
1263 (choice-item light) 1279 (choice-item light)
1264 (choice-item :tag "default" nil))) 1280 (choice-item :tag "default" nil)))
1265 1281
@@ -1455,14 +1471,14 @@ created."
1455 1471
1456(defun frame-update-faces (frame) 1472(defun frame-update-faces (frame)
1457 nil) 1473 nil)
1458 1474(make-obsolete 'frame-update-faces "No longer necessary")
1459 1475
1460;; Update the colors of FACE, after FRAME's own colors have been 1476;; Update the colors of FACE, after FRAME's own colors have been
1461;; changed. 1477;; changed.
1462 1478
1463(defun frame-update-face-colors (frame) 1479(defun frame-update-face-colors (frame)
1464 (frame-set-background-mode frame)) 1480 (frame-set-background-mode frame))
1465 1481(make-obsolete 'frame-update-face-colors 'frame-set-background-mode)
1466 1482
1467 1483
1468;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1484;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1704,7 +1720,7 @@ created."
1704 "\\([-*?]\\|\\'\\)")) 1720 "\\([-*?]\\|\\'\\)"))
1705 (setq x-font-regexp-slant (concat - slant -)) 1721 (setq x-font-regexp-slant (concat - slant -))
1706 (setq x-font-regexp-weight (concat - weight -)) 1722 (setq x-font-regexp-weight (concat - weight -))
1707 nil) 1723 nil)
1708 1724
1709 1725
1710(defun x-resolve-font-name (pattern &optional face frame) 1726(defun x-resolve-font-name (pattern &optional face frame)
@@ -1821,7 +1837,6 @@ If that can't be done, return nil."
1821 (and (setq font (x-make-font-bold font)) 1837 (and (setq font (x-make-font-bold font))
1822 (x-make-font-italic font))) 1838 (x-make-font-italic font)))
1823 1839
1824
1825(provide 'faces) 1840(provide 'faces)
1826 1841
1827;;; end of faces.el 1842;;; faces.el ends here