changeset 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 3eeae124dcab
children 413b0a1cca76
files lisp/help-mode.el
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
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 ()