diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/info-look.el | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eef4e033ed0..0718296dffd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-16 Kevin Ryde <user42@zip.com.au> | ||
| 2 | |||
| 3 | * info-look.el (info-lookup-select-mode): If major-mode has no | ||
| 4 | info-lookup-alist entry then search up derived-mode-parent (bug#8660). | ||
| 5 | |||
| 1 | 2013-02-16 Jambunathan K <kjambunathan@gmail.com> | 6 | 2013-02-16 Jambunathan K <kjambunathan@gmail.com> |
| 2 | 7 | ||
| 3 | * replace.el (read-regexp): Tighten the regexp that matches tag. | 8 | * replace.el (read-regexp): Tighten the regexp that matches tag. |
diff --git a/lisp/info-look.el b/lisp/info-look.el index a67fabc5a88..0b33dd51faf 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el | |||
| @@ -298,6 +298,21 @@ If optional argument QUERY is non-nil, query for the help mode." | |||
| 298 | (when (string-match (caar file-name-alist) file-name) | 298 | (when (string-match (caar file-name-alist) file-name) |
| 299 | (setq info-lookup-mode (cdar file-name-alist))) | 299 | (setq info-lookup-mode (cdar file-name-alist))) |
| 300 | (setq file-name-alist (cdr file-name-alist))))) | 300 | (setq file-name-alist (cdr file-name-alist))))) |
| 301 | |||
| 302 | ;; If major-mode has no setups in info-lookup-alist, under any topic, then | ||
| 303 | ;; search up through derived-mode-parent to find a parent mode which does | ||
| 304 | ;; have some setups. This means that a `define-derived-mode' with no | ||
| 305 | ;; setups of its own will select its parent mode for lookups, if one of | ||
| 306 | ;; its parents has some setups. Good for example on `makefile-gmake-mode' | ||
| 307 | ;; and similar derivatives of `makefile-mode'. | ||
| 308 | ;; | ||
| 309 | (let ((mode major-mode)) ;; Look for `mode' with some setups. | ||
| 310 | (while (and mode (not info-lookup-mode)) | ||
| 311 | (dolist (topic-cell info-lookup-alist) ;; Usually only two topics here. | ||
| 312 | (if (info-lookup->mode-value (car topic-cell) mode) | ||
| 313 | (setq info-lookup-mode mode))) | ||
| 314 | (setq mode (get mode 'derived-mode-parent)))) | ||
| 315 | |||
| 301 | (or info-lookup-mode (setq info-lookup-mode major-mode))) | 316 | (or info-lookup-mode (setq info-lookup-mode major-mode))) |
| 302 | 317 | ||
| 303 | (defun info-lookup-change-mode (topic) | 318 | (defun info-lookup-change-mode (topic) |