From 1c6bf19606fb25af4bff5582b593c7813501a2c5 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 28 Apr 2009 21:29:47 +0000 Subject: [PATCH] * 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). --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/which-func.el | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 009225a97f0..8d7881c1aa1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2009-04-28 Geert Kloosterman (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 * international/quail.el (quail-vunion): Remove unexplained nreverse. diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index ee392e2734a..3e06bf762a8 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -310,11 +310,8 @@ If no function name is found, return nil." (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)))))) -- 2.39.2