changeset 103096:d98eb168e700

* progmodes/which-func.el (which-function): Don't assume that entries from `imenu--index-alist' are ordered by buffer position, which fails when submenus are present (Bug#3153).
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 28 Apr 2009 21:29:47 +0000
parents 65cc22e2c624
children 129ed78cd442
files lisp/ChangeLog lisp/progmodes/which-func.el
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Apr 28 19:02:26 2009 +0000
+++ b/lisp/ChangeLog	Tue Apr 28 21:29:47 2009 +0000
@@ -1,3 +1,9 @@
+2009-04-28  Geert Kloosterman  <g.j.kloosterman@gmail.com>  (tiny change)
+
+	* progmodes/which-func.el (which-function): Don't assume that
+	entries from `imenu--index-alist' are ordered by buffer position,
+	which fails when submenus are present (Bug#3153).
+
 2009-04-28  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* international/quail.el (quail-vunion): Remove unexplained nreverse.
--- a/lisp/progmodes/which-func.el	Tue Apr 28 19:02:26 2009 +0000
+++ b/lisp/progmodes/which-func.el	Tue Apr 28 21:29:47 2009 +0000
@@ -310,11 +310,8 @@
                                (setq minoffset offset
                                      name (funcall
                                            which-func-imenu-joiner-function
-                                           (reverse (cons (car pair) namestack)))))
-                         ;; Entries in order, so can skip all those after point.
-                         (setq alist nil
-                               imstack nil)))))
-
+					   (reverse (cons (car pair)
+							  namestack)))))))))
             (setq alist     (car imstack)
                   namestack (cdr namestack)
                   imstack   (cdr imstack))))))