lisp/help.el (describe-mode): Link to the mode's definition.

Fixes: debbugs:8185
This commit is contained in:
Juanma Barranquero 2011-03-13 02:57:40 +01:00
parent 09d9db2c49
commit 9d05d1ba20
2 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2011-03-13 Juanma Barranquero <lekktu@gmail.com>
* help.el (describe-mode): Link to the mode's definition (bug#8185).
2011-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
* ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization

View file

@ -871,7 +871,17 @@ whose documentation describes the minor mode."
(let ((start (point)))
(insert (format-mode-line mode nil nil buffer))
(add-text-properties start (point) '(face bold)))))
(princ " mode:\n")
(princ " mode")
(let* ((mode major-mode)
(file-name (find-lisp-object-file-name mode nil)))
(when file-name
(princ (concat " defined in `" (file-name-nondirectory file-name) "'"))
;; Make a hyperlink to the library.
(with-current-buffer standard-output
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
(help-xref-button 1 'help-function-def mode file-name)))))
(princ ":\n")
(princ (documentation major-mode)))))
;; For the sake of IELM and maybe others
nil)