unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 30fa6da552: Add new command 'imenu-flush-cache'
       [not found] ` <20220512022446.10C81C01683@vcs2.savannah.gnu.org>
@ 2022-05-12  8:51   ` Robert Pluim
  2022-05-12 11:51     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2022-05-12  8:51 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

>>>>> On Wed, 11 May 2022 22:24:45 -0400 (EDT), Lars Ingebrigtsen <larsi@gnus.org> said:

    Lars> branch: master
    Lars> commit 30fa6da5529f80df25fcba49d10cd8a806774868
    Lars> Author: Lars Ingebrigtsen <larsi@gnus.org>
    Lars> Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Lars>     Add new command 'imenu-flush-cache'
    
    Lars>     * lisp/imenu.el (imenu-flush-cache): New command (bug#20589).

Should "C-u M-g i" flush the cache? I guess thatʼs a bit awkward to
type, so if it was 'any prefix arg' you could say "M-- M-g i".

Robert
-- 



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

* Re: master 30fa6da552: Add new command 'imenu-flush-cache'
  2022-05-12  8:51   ` master 30fa6da552: Add new command 'imenu-flush-cache' Robert Pluim
@ 2022-05-12 11:51     ` Lars Ingebrigtsen
  2022-05-12 13:02       ` Filipp Gunbin
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-12 11:51 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

Robert Pluim <rpluim@gmail.com> writes:

> Should "C-u M-g i" flush the cache? I guess thatʼs a bit awkward to
> type, so if it was 'any prefix arg' you could say "M-- M-g i".

Is flushing the cache something that people would want to do a lot?  If
not, I think keeping it on its own command would be better (because I'm
sure somebody will come up with something useful to do with a prefix for
`M-g i' eventually 🙂).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: master 30fa6da552: Add new command 'imenu-flush-cache'
  2022-05-12 11:51     ` Lars Ingebrigtsen
@ 2022-05-12 13:02       ` Filipp Gunbin
  2022-05-12 13:08         ` Lars Ingebrigtsen
  2022-05-12 15:39         ` [External] : " Drew Adams
  0 siblings, 2 replies; 7+ messages in thread
From: Filipp Gunbin @ 2022-05-12 13:02 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Robert Pluim, emacs-devel

On 12/05/2022 13:51 +0200, Lars Ingebrigtsen wrote:

> Robert Pluim <rpluim@gmail.com> writes:
>
>> Should "C-u M-g i" flush the cache? I guess thatʼs a bit awkward to
>> type, so if it was 'any prefix arg' you could say "M-- M-g i".
>
> Is flushing the cache something that people would want to do a lot?  If
> not, I think keeping it on its own command would be better (because I'm
> sure somebody will come up with something useful to do with a prefix for
> `M-g i' eventually 🙂).

Yes, let's leave the prefix for some future day.  Imenu could present
its list in different ways, that's where the prefix will be useful.

BTW, I thought the _function_ (even if one-liner) was missing, not the
command, why the command is needed at all?  Why the *Rescan* selection
is not enough?

Filipp



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

* Re: master 30fa6da552: Add new command 'imenu-flush-cache'
  2022-05-12 13:02       ` Filipp Gunbin
@ 2022-05-12 13:08         ` Lars Ingebrigtsen
  2022-05-12 14:51           ` Filipp Gunbin
  2022-05-12 15:39         ` [External] : " Drew Adams
  1 sibling, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-12 13:08 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

Filipp Gunbin <fgunbin@fastmail.fm> writes:

> Yes, let's leave the prefix for some future day.  Imenu could present
> its list in different ways, that's where the prefix will be useful.
>
> BTW, I thought the _function_ (even if one-liner) was missing, not the
> command, why the command is needed at all?  Why the *Rescan* selection
> is not enough?

I may have misread the request -- I thought a command was what was
requested?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: master 30fa6da552: Add new command 'imenu-flush-cache'
  2022-05-12 13:08         ` Lars Ingebrigtsen
@ 2022-05-12 14:51           ` Filipp Gunbin
  2022-05-13 12:07             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Filipp Gunbin @ 2022-05-12 14:51 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Robert Pluim, emacs-devel

On 12/05/2022 15:08 +0200, Lars Ingebrigtsen wrote:

> Filipp Gunbin <fgunbin@fastmail.fm> writes:
>
>> Yes, let's leave the prefix for some future day.  Imenu could present
>> its list in different ways, that's where the prefix will be useful.
>>
>> BTW, I thought the _function_ (even if one-liner) was missing, not the
>> command, why the command is needed at all?  Why the *Rescan* selection
>> is not enough?
>
> I may have misread the request -- I thought a command was what was
> requested?

bug#20589 refers to this discussion
https://stackoverflow.com/questions/13426564/how-to-force-a-rescan-in-imenu-by-a-function/,
and Marcin requests a function there, to use in his code.

Also, looking at imenu-choose-buffer-index, it does this when rescan is
selected:

--8<---------------cut here---------------start------------->8---
      (and (equal result imenu--rescan-item)
	   (imenu--cleanup)
	   (setq result t imenu--index-alist nil)))
--8<---------------cut here---------------end--------------->8---

I guess you should extract

(when (imenu--cleanup)
  (setq imenu--index-alist nil))

from here.

Filipp



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

* RE: [External] : Re: master 30fa6da552: Add new command 'imenu-flush-cache'
  2022-05-12 13:02       ` Filipp Gunbin
  2022-05-12 13:08         ` Lars Ingebrigtsen
@ 2022-05-12 15:39         ` Drew Adams
  1 sibling, 0 replies; 7+ messages in thread
From: Drew Adams @ 2022-05-12 15:39 UTC (permalink / raw)
  To: Filipp Gunbin, Lars Ingebrigtsen; +Cc: Robert Pluim, emacs-devel@gnu.org

> Imenu could present its list in different ways

Yes, it could.  See `imenu+.el', where it does:

https://www.emacswiki.org/emacs/ImenuMode#ImenuPlus

It adds these 3 menu items, which toggle the behavior:

 Toggle Case-Sensitive Name-Sort
 Toggle Ignoring Commented Defs
 Toggle Sorting


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

* Re: master 30fa6da552: Add new command 'imenu-flush-cache'
  2022-05-12 14:51           ` Filipp Gunbin
@ 2022-05-13 12:07             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-13 12:07 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

Filipp Gunbin <fgunbin@fastmail.fm> writes:

> bug#20589 refers to this discussion
> https://stackoverflow.com/questions/13426564/how-to-force-a-rescan-in-imenu-by-a-function/,
> and Marcin requests a function there, to use in his code.

OK; I've now made it into a function.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

end of thread, other threads:[~2022-05-13 12:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <165232228575.4973.16265111485645720331@vcs2.savannah.gnu.org>
     [not found] ` <20220512022446.10C81C01683@vcs2.savannah.gnu.org>
2022-05-12  8:51   ` master 30fa6da552: Add new command 'imenu-flush-cache' Robert Pluim
2022-05-12 11:51     ` Lars Ingebrigtsen
2022-05-12 13:02       ` Filipp Gunbin
2022-05-12 13:08         ` Lars Ingebrigtsen
2022-05-12 14:51           ` Filipp Gunbin
2022-05-13 12:07             ` Lars Ingebrigtsen
2022-05-12 15:39         ` [External] : " Drew Adams

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).