X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/eac88b3bfb2990efc5787564ddf249f8cabd8df7..1b74c4346e92c9ac1ae0575c2ad69f8d81126d7e:/lisp/help-mode.el diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 8b0284089f..eac7caad0c 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -1,7 +1,7 @@ ;;; help-mode.el --- `help-mode' used by *Help* buffers -;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2004 -;; Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002, +;; 2003, 2004, 2005 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: help, internal @@ -20,8 +20,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -169,6 +169,18 @@ The format is (FUNCTION ARGS...).") (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 () @@ -184,7 +196,7 @@ Commands: (view-mode) (make-local-variable 'view-no-disable-on-exit) (setq view-no-disable-on-exit t) - (run-hooks 'help-mode-hook)) + (run-mode-hooks 'help-mode-hook)) ;;;###autoload (defun help-mode-setup () @@ -376,9 +388,10 @@ that." ;;; (pop-to-buffer (car location)) ;;; (goto-char (cdr location)))) (help-xref-button 8 'help-function-def sym)) - ((facep sym) - (if (save-match-data (looking-at "[ \t\n]+face\\W")) - (help-xref-button 8 'help-face sym))) + ((and + (facep sym) + (save-match-data (looking-at "[ \t\n]+face\\W"))) + (help-xref-button 8 'help-face sym)) ((and (boundp sym) (fboundp sym)) ;; We can't intuit whether to use the ;; variable or function doc -- supply both. @@ -618,5 +631,5 @@ For the cross-reference format, see `help-make-xrefs'." (provide 'help-mode) -;;; arch-tag: 850954ae-3725-4cb4-8e91-0bf6d52d6b0b +;; arch-tag: 850954ae-3725-4cb4-8e91-0bf6d52d6b0b ;;; help-mode.el ends here