emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111807: * lisp/info-look.el (info-lo


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111807: * lisp/info-look.el (info-lookup-select-mode): If major-mode has no
Date: Sat, 16 Feb 2013 12:20:43 -0500
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111807
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8660
author: Kevin Ryde <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sat 2013-02-16 12:20:43 -0500
message:
  * lisp/info-look.el (info-lookup-select-mode): If major-mode has no
  info-lookup-alist entry then search up derived-mode-parent.
modified:
  lisp/ChangeLog
  lisp/info-look.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-02-16 09:26:42 +0000
+++ b/lisp/ChangeLog    2013-02-16 17:20:43 +0000
@@ -1,3 +1,8 @@
+2013-02-16  Kevin Ryde  <address@hidden>
+
+       * info-look.el (info-lookup-select-mode): If major-mode has no
+       info-lookup-alist entry then search up derived-mode-parent (bug#8660).
+
 2013-02-16  Jambunathan K  <address@hidden>
 
        * replace.el (read-regexp): Tighten the regexp that matches tag.

=== modified file 'lisp/info-look.el'
--- a/lisp/info-look.el 2013-01-01 09:11:05 +0000
+++ b/lisp/info-look.el 2013-02-16 17:20:43 +0000
@@ -298,6 +298,21 @@
        (when (string-match (caar file-name-alist) file-name)
          (setq info-lookup-mode (cdar file-name-alist)))
        (setq file-name-alist (cdr file-name-alist)))))
+
+  ;; If major-mode has no setups in info-lookup-alist, under any topic, then
+  ;; search up through derived-mode-parent to find a parent mode which does
+  ;; have some setups.  This means that a `define-derived-mode' with no
+  ;; setups of its own will select its parent mode for lookups, if one of
+  ;; its parents has some setups.  Good for example on `makefile-gmake-mode'
+  ;; and similar derivatives of `makefile-mode'.
+  ;;
+  (let ((mode major-mode)) ;; Look for `mode' with some setups.
+    (while (and mode (not info-lookup-mode))
+      (dolist (topic-cell info-lookup-alist) ;; Usually only two topics here.
+        (if (info-lookup->mode-value (car topic-cell) mode)
+            (setq info-lookup-mode mode)))
+      (setq mode (get mode 'derived-mode-parent))))
+
   (or info-lookup-mode (setq info-lookup-mode major-mode)))
 
 (defun info-lookup-change-mode (topic)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]