aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2003-04-20 13:04:58 +0000
committerGlenn Morris2003-04-20 13:04:58 +0000
commitd1389042e78ebd76c3bf24712bc8429c4e28b938 (patch)
tree3663620d5bee80c8a843e14078f8f6e71ce50ca2
parentbe35ca9f5ee2e215506f7a9c729ef59978c0036c (diff)
downloademacs-d1389042e78ebd76c3bf24712bc8429c4e28b938.tar.gz
emacs-d1389042e78ebd76c3bf24712bc8429c4e28b938.zip
(which-func-modes): Add f90-mode.
(which-function): Handle imenu submenus.
-rw-r--r--lisp/ChangeLog15
-rw-r--r--lisp/which-func.el31
2 files changed, 37 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c6db178fe8f..b1b6694d069 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,18 @@
12003-04-20 Glenn Morris <gmorris@ast.cam.ac.uk>
2
3 * which-func.el (which-func-modes): Add f90-mode.
4 (which-function): Handle imenu submenus.
5
6 * progmodes/fortran.el (fortran-abbrev-start): Make XEmacs
7 compatible.
8
9 * progmodes/f90.el (f90-font-lock-keywords-2): Use override for
10 font-lock-variable-name-face in declarations. Highlight
11 continuation characters.
12 (f90-indent-new-line): Remove direct call to f90-indent-line-no,
13 f90-update-line.
14 (f90-abbrev-start): Fix XEmacs compatibility.
15
12003-04-19 Richard M. Stallman <rms@gnu.org> 162003-04-19 Richard M. Stallman <rms@gnu.org>
2 17
3 * desktop.el (desktop-buffer-mh): Don't require mh-e; 18 * desktop.el (desktop-buffer-mh): Don't require mh-e;
diff --git a/lisp/which-func.el b/lisp/which-func.el
index 1d31b3d304a..7b178ab25ea 100644
--- a/lisp/which-func.el
+++ b/lisp/which-func.el
@@ -76,7 +76,7 @@
76 76
77(defcustom which-func-modes 77(defcustom which-func-modes
78 '(emacs-lisp-mode c-mode c++-mode perl-mode cperl-mode makefile-mode 78 '(emacs-lisp-mode c-mode c++-mode perl-mode cperl-mode makefile-mode
79 sh-mode fortran-mode) 79 sh-mode fortran-mode f90-mode)
80 "List of major modes for which Which Function mode should be used. 80 "List of major modes for which Which Function mode should be used.
81For other modes it is disabled. If this is equal to t, 81For other modes it is disabled. If this is equal to t,
82then Which Function mode is enabled in any major mode that supports it." 82then Which Function mode is enabled in any major mode that supports it."
@@ -216,14 +216,27 @@ If no function name is found, return nil."
216 (setq which-function-imenu-failed t))) 216 (setq which-function-imenu-failed t)))
217 ;; If we have an index alist, use it. 217 ;; If we have an index alist, use it.
218 (when (and (boundp 'imenu--index-alist) imenu--index-alist) 218 (when (and (boundp 'imenu--index-alist) imenu--index-alist)
219 (let ((pair (car-safe imenu--index-alist)) 219 (let ((alist imenu--index-alist)
220 (rest (cdr-safe imenu--index-alist))) 220 (minoffset (point-max))
221 (while (and (or rest pair) 221 offset elem pair mark)
222 (or (not (number-or-marker-p (cdr pair))) 222 (while alist
223 (> (point) (cdr pair)))) 223 (setq elem (car-safe alist)
224 (setq name (car pair)) 224 alist (cdr-safe alist))
225 (setq pair (car-safe rest)) 225 ;; Elements of alist are either ("name" . marker), or
226 (setq rest (cdr-safe rest))))) 226 ;; ("submenu" ("name" . marker) ... ).
227 (unless (listp (cdr elem))
228 (setq elem (list elem)))
229 (while elem
230 (setq pair (car elem)
231 elem (cdr elem))
232 (and (consp pair)
233 (number-or-marker-p (setq mark (cdr pair)))
234 (if (>= (setq offset (- (point) mark)) 0)
235 (if (< offset minoffset) ; find the closest item
236 (setq minoffset offset
237 name (car pair)))
238 ;; Entries in order, so can skip all those after point.
239 (setq elem nil)))))))
227 ;; Try using add-log support. 240 ;; Try using add-log support.
228 (when (and (null name) (boundp 'add-log-current-defun-function) 241 (when (and (null name) (boundp 'add-log-current-defun-function)
229 add-log-current-defun-function) 242 add-log-current-defun-function)