summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2011-05-28 13:40:37 -0400
committerChong Yidong <cyd@stupidchicken.com>2011-05-28 13:40:37 -0400
commit5199bde17738aba58d6380ba5b334fd2a48b6621 (patch)
tree598a5d01c017f72e301737e8ea3e2577700e44cd /lisp/help-fns.el
parentd43eaf2c3cfa8cc8b1272f75db5b705540307e2d (diff)
downloademacs-5199bde17738aba58d6380ba5b334fd2a48b6621.tar.gz
emacs-5199bde17738aba58d6380ba5b334fd2a48b6621.tar.bz2
emacs-5199bde17738aba58d6380ba5b334fd2a48b6621.zip
In describe-function, print the parent of a derived mode.
* lisp/help-fns.el (describe-function-1): If the function is a derived major mode, print the parent mode.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 97ce7ca44ef..ed1bd836fbf 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -557,6 +557,21 @@ suitable file is found, return nil."
(insert (car high) "\n")
(fill-region fill-begin (point)))
(setq doc (cdr high))))
+
+ ;; If this is a derived mode, link to the parent.
+ (let ((parent-mode (and (symbolp real-function)
+ (get real-function
+ 'derived-mode-parent))))
+ (when parent-mode
+ (with-current-buffer standard-output
+ (insert "\nParent mode: `")
+ (let ((beg (point)))
+ (insert (format "%s" parent-mode))
+ (make-text-button beg (point)
+ 'type 'help-function
+ 'help-args (list parent-mode))))
+ (princ "'.\n")))
+
(let* ((obsolete (and
;; function might be a lambda construct.
(symbolp function)