[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r104402: In describe-function, print
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r104402: In describe-function, print the parent of a derived mode. |
Date: |
Sat, 28 May 2011 13:40:37 -0400 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 104402
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2011-05-28 13:40:37 -0400
message:
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.
modified:
lisp/ChangeLog
lisp/help-fns.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-05-28 17:16:54 +0000
+++ b/lisp/ChangeLog 2011-05-28 17:40:37 +0000
@@ -1,5 +1,8 @@
2011-05-28 Chong Yidong <address@hidden>
+ * 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.
=== modified file 'lisp/help-fns.el'
--- a/lisp/help-fns.el 2011-04-13 17:56:47 +0000
+++ b/lisp/help-fns.el 2011-05-28 17:40:37 +0000
@@ -557,6 +557,21 @@
(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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r104402: In describe-function, print the parent of a derived mode.,
Chong Yidong <=