]> git.eshelyaron.com Git - emacs.git/commitdiff
In describe-function, print the parent of a derived mode.
authorChong Yidong <cyd@stupidchicken.com>
Sat, 28 May 2011 17:40:37 +0000 (13:40 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 28 May 2011 17:40:37 +0000 (13:40 -0400)
* lisp/help-fns.el (describe-function-1): If the function is a derived
major mode, print the parent mode.

lisp/ChangeLog
lisp/help-fns.el

index 88289fc1656032d961bdd94d08f2e3b212334cd3..dde6bffe7fde2c648964918ae218f7c6d133dd4b 100644 (file)
@@ -1,5 +1,8 @@
 2011-05-28  Chong Yidong  <cyd@stupidchicken.com>
 
+       * help-fns.el (describe-function-1): If the function is a derived
+       major mode, print the parent mode.
+
        * progmodes/cc-mode.el (c-mode, c++-mode, objc-mode, java-mode)
        (idl-mode, pike-mode, awk-mode): Inherit from prog-mode.
 
index 97ce7ca44efe207792195fba6a6239993e11ed0c..ed1bd836fbf362225318eb38a10fa9c55e2d63b6 100644 (file)
@@ -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)