From: Alex Branham <alex.branham@gmail.com>
To: 33695@debbugs.gnu.org
Subject: bug#33695: 27.0.50; which-function reports wrong imenu information
Date: Mon, 10 Dec 2018 12:58:25 -0600 [thread overview]
Message-ID: <87tvjlmcoe.fsf@gmail.com> (raw)
(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
next reply other threads:[~2018-12-10 18:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 18:58 Alex Branham [this message]
2018-12-11 8:35 ` bug#33695: 27.0.50; which-function reports wrong imenu information martin rudalics
2018-12-11 14:32 ` Alex Branham
2018-12-12 8:31 ` martin rudalics
2018-12-12 22:53 ` Alex Branham
2018-12-13 9:01 ` martin rudalics
2018-12-19 15:42 ` bug#33695: [PATCH] Fix which-function reporting outdated information Alex Branham
2019-01-10 19:55 ` Alex Branham
2019-02-19 21:29 ` Alex Branham
2019-02-22 21:28 ` Alex Branham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tvjlmcoe.fsf@gmail.com \
--to=alex.branham@gmail.com \
--cc=33695@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).