]> code.delx.au - gnu-emacs/blobdiff - lisp/help.el
Merge from mainline.
[gnu-emacs] / lisp / help.el
index 9fcb06c559f3d1fcd429f6db82be66e2a9e5dc73..e148e5ef6abba5be4edbfff0218259f3bb3befb4 100644 (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)