Commit 8940232b authored by Miles Bader's avatar Miles Bader
Browse files

(list-faces-display, describe-face): Fix args to `help-xref-button'.

(describe-face): Don't switch to help-buffer around call to `help-setup-xref'.
Use `help-buffer' instead of hard-wired "*Help*".
Require `help-mode'.
parent c3b09bbf
...@@ -1055,20 +1055,14 @@ The sample text is a string that comes from the variable ...@@ -1055,20 +1055,14 @@ The sample text is a string that comes from the variable
(save-excursion (save-excursion
(save-match-data (save-match-data
(search-backward face-name) (search-backward face-name)
(help-xref-button 0 (lambda (f) (help-xref-button 0 'help-customize-face face-name)))
(if help-xref-stack
(pop help-xref-stack))
(customize-face f))
face-name
"mouse-2: customize this face")))
(let ((beg (point))) (let ((beg (point)))
(insert list-faces-sample-text) (insert list-faces-sample-text)
;; Hyperlink to a help buffer for the face. ;; Hyperlink to a help buffer for the face.
(save-excursion (save-excursion
(save-match-data (save-match-data
(search-backward list-faces-sample-text) (search-backward list-faces-sample-text)
(help-xref-button 0 #'describe-face face (help-xref-button 0 'help-face face)))
"mouse-2: describe this face")))
(insert "\n") (insert "\n")
(put-text-property beg (1- (point)) 'face face) (put-text-property beg (1- (point)) 'face face)
;; If the sample text has multiple lines, line up all of them. ;; If the sample text has multiple lines, line up all of them.
...@@ -1115,7 +1109,8 @@ If FRAME is omitted or nil, use the selected frame." ...@@ -1115,7 +1109,8 @@ If FRAME is omitted or nil, use the selected frame."
(:inherit . "Inherit"))) (:inherit . "Inherit")))
(max-width (apply #'max (mapcar #'(lambda (x) (length (cdr x))) (max-width (apply #'max (mapcar #'(lambda (x) (length (cdr x)))
attrs)))) attrs))))
(with-output-to-temp-buffer "*Help*" (require 'help-mode)
(with-output-to-temp-buffer (help-buffer)
(save-excursion (save-excursion
(set-buffer standard-output) (set-buffer standard-output)
(dolist (a attrs) (dolist (a attrs)
...@@ -1129,16 +1124,14 @@ If FRAME is omitted or nil, use the selected frame." ...@@ -1129,16 +1124,14 @@ If FRAME is omitted or nil, use the selected frame."
(terpri) (terpri)
(terpri) (terpri)
(princ (concat "You can " customize-label " this face.")) (princ (concat "You can " customize-label " this face."))
(with-current-buffer "*Help*" (with-current-buffer standard-output
(save-excursion (save-excursion
(re-search-backward (re-search-backward
(concat "\\(" customize-label "\\)") nil t) (concat "\\(" customize-label "\\)") nil t)
(help-xref-button 1 #'customize-face face (help-xref-button 1 'help-customize-face face)))))
"mouse-2, RET: customize face")))))
(print-help-return-message) (print-help-return-message)
(with-current-buffer "*Help*" (help-setup-xref (list #'describe-face face) (interactive-p)))))
(help-setup-xref (list #'describe-face face) (interactive-p))
(buffer-string)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Face specifications (defface). ;;; Face specifications (defface).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment