GNU bug report logs - #33695
27.0.50; which-function reports wrong imenu information

Previous Next

Package: emacs;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Mon, 10 Dec 2018 18:59:02 UTC

Severity: normal

Found in version 27.0.50

Done: Alex Branham <alex.branham <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Alex Branham <alex.branham <at> gmail.com>
Subject: bug#33695: closed (Re: [PATCH] Fix which-function reporting
 outdated information)
Date: Fri, 22 Feb 2019 21:29:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#33695: 27.0.50; which-function reports wrong imenu information

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 33695 <at> debbugs.gnu.org.

-- 
33695: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33695
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Alex Branham <alex.branham <at> gmail.com>
To: 33695-done <at> debbugs.gnu.org
Subject: Re: [PATCH] Fix which-function reporting outdated information
Date: Fri, 22 Feb 2019 15:28:25 -0600
Committed as 0613e7a38efc3b0534e0ca5c5fa401e2a3bda906 in what will be Emacs 27


[Message part 3 (message/rfc822, inline)]
From: Alex Branham <alex.branham <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; which-function reports wrong imenu information
Date: Mon, 10 Dec 2018 12:58:25 -0600
(which-function) can report outdated information because it relies on
imenu--index-alist. To see what I'm talking about, from emacs -q:

M-x which-function-mode RET

type:
    (defun test () "foo" (ignore))

M-x imenu *Rescan* RET C-g

type:
    (defun test2 () "bar" (ignore))

With point inside test2, (which-function) reports test (you'll see this
in the modeline) because it uses the (outdated) information in
`imenu--index-alist'.

I see a few potential fixes:

- Check `add-log-current-defun' before checking `imenu--index-alist' in
  `which-function' (easy, but falling back on imenu--index-alist could
  still report old info)

- Have `which-function' update `imenu--index-alist' before checking it
  (also easy to implement, but updating the index could be slow in large
  buffers)

- Something else

I'm happy to write up a patch, just let me know what solution is best.

Thanks,
Alex



This bug report was last modified 6 years and 151 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.