aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero <[email protected]>2011-03-13 02:57:40 +0100
committerJuanma Barranquero <[email protected]>2011-03-13 02:57:40 +0100
commit9d05d1ba20797a7478a7ed68ff88452cb4f8c4c8 (patch)
treee638fd4bd243d06bf345c2ede81620d7b14b104a
parent09d9db2c4921cb2eb0974892164dd03d6bffdd80 (diff)
lisp/help.el (describe-mode): Link to the mode's definition.
Fixes: debbugs:8185
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/help.el12
2 files changed, 15 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3b47dd2469..1f50ee9ebe 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-13 Juanma Barranquero <[email protected]>
+
+ * help.el (describe-mode): Link to the mode's definition (bug#8185).
+
2011-03-12 Stefan Monnier <[email protected]>
* ebuff-menu.el (electric-buffer-menu-mode-map): Move initialization
diff --git a/lisp/help.el b/lisp/help.el
index 9fcb06c559..e148e5ef6a 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -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)