all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#33695: 27.0.50; which-function reports wrong imenu information
@ 2018-12-10 18:58 Alex Branham
  2018-12-11  8:35 ` martin rudalics
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alex Branham @ 2018-12-10 18:58 UTC (permalink / raw)
  To: 33695

(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





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-02-22 21:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-10 18:58 bug#33695: 27.0.50; which-function reports wrong imenu information Alex Branham
2018-12-11  8:35 ` 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.