From: Lars Ingebrigtsen Date: Wed, 13 Apr 2022 00:51:03 +0000 (+0200) Subject: Make `describe-mode' include a link to the major mode function X-Git-Tag: emacs-29.0.90~1931^2~620 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6b16092a8d6f12fa8c5e69dd6948f8f524212bb3;p=emacs.git Make `describe-mode' include a link to the major mode function * lisp/help-fns.el (describe-mode): Add a link to the mode function so that the user can go to the manual more easily (bug#575). --- diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 80d7d5cb028..38b11f1c99f 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1952,12 +1952,16 @@ documentation for the major and minor modes of that buffer." (princ "\n(Information about these minor modes follows the major mode info.)\n\n")) ;; Document the major mode. - (let ((mode mode-name)) - (with-current-buffer standard-output - (let ((start (point))) - (insert (format-mode-line mode nil nil buffer)) - (add-text-properties start (point) '(face bold))))) - (princ " mode") + (with-current-buffer standard-output + (insert (buttonize + (propertize (format-mode-line + (buffer-local-value 'mode-name buffer) + nil nil buffer) + 'face 'bold) + (lambda (_) + (describe-function + (buffer-local-value 'major-mode buffer)))))) + (princ " mode") (let* ((mode major-mode) (file-name (find-lisp-object-file-name mode nil))) (if (not file-name)