[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 6b16092a8d 1/2: Make `describe-mode' include a link to the major
From: |
Lars Ingebrigtsen |
Subject: |
master 6b16092a8d 1/2: Make `describe-mode' include a link to the major mode function |
Date: |
Tue, 12 Apr 2022 21:51:01 -0400 (EDT) |
branch: master
commit 6b16092a8d6f12fa8c5e69dd6948f8f524212bb3
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
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).
---
lisp/help-fns.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 80d7d5cb02..38b11f1c99 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)