diff lisp/help-mode.el @ 62387:c051115aeb95

(help-face-def): New button type.
author Richard M. Stallman <rms@gnu.org>
date Mon, 16 May 2005 03:31:32 +0000
parents df46d87c0c2f
children 40c5f688942a f042e7c0fe20
line wrap: on
line diff
--- a/lisp/help-mode.el	Mon May 16 03:31:11 2005 +0000
+++ b/lisp/help-mode.el	Mon May 16 03:31:32 2005 +0000
@@ -169,6 +169,18 @@
 		     (goto-char (cdr location))))
   'help-echo (purecopy"mouse-2, RET: find variable's definition"))
 
+(define-button-type 'help-face-def
+  :supertype 'help-xref
+  'help-function (lambda (fun file)
+		   (require 'find-func)
+		   ;; Don't use find-function-noselect because it follows
+		   ;; aliases (which fails for built-in functions).
+		   (let ((location
+			  (find-function-search-for-symbol fun 'defface file)))
+		     (pop-to-buffer (car location))
+		     (goto-char (cdr location))))
+  'help-echo (purecopy "mouse-2, RET: find face's definition"))
+
 
 ;;;###autoload
 (defun help-mode ()