unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Disabling minor mode after setting imenu-generic-expression
Date: Wed, 28 Aug 2024 09:09:22 +0000	[thread overview]
Message-ID: <WUD-cLs18gIwwms2b6friH_iMiYft8BgBUf9i_mbiFjSqjN7BWq2BQu6xtSRRY0LsTfjhmiGh-87hjkIhGN_xcGcbW8TPUXXi3XX1ee0sF0=@protonmail.com> (raw)
In-Reply-To: <CAP_d_8XzCQky0iFoTBuGtSPkkVdv40z=OG0F6PCs85kPOXjYZw@mail.gmail.com>

On Wednesday, August 28th, 2024 at 5:15 PM, Yuri Khan <yuri.v.khan@gmail.com> wrote:

> On Wed, 28 Aug 2024 at 02:01, Heime heimeborgia@protonmail.com wrote:
> 
> > Have set 'imenu-generic-expression' for a buffer when it is in 'emacs-lisp-mode'
> > using '(eq major-mode'. But how do I revert back to the initial sate after disabling
> > the minor mode ? What should 'tema-disable-function' do exactly ?
> 
> 
> You have been asking this question every day for the last week (I
> might be exaggerating a bit) and got no answers. This should cue you
> to the idea that the functionality you seek is not well suited to be a
> minor mode.

I already have a minor-mode and I want to add this functionality to it.
There should be nothing bad about doing this.

The imenu-generic-expression is customarily set by the major-mode, but I want
to change it, and then revert back when the mode is disabled. 

 
> You have also not explained why you want different imenu settings at
> different times. 

I want to have matching regexp types in a buffer that I want to match
besides the standard "(defun" thing, but which would not always be needed.  

> So your question is an instance of XY problem — you have a need that 
> you are not telling us, you have a feeling that it might be solved in 
> a particular way, and you’re asking about that way.

I do not see it the way you describe.




  reply	other threads:[~2024-08-28  9:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 19:00 Disabling minor mode after setting imenu-generic-expression Heime
2024-08-28  5:15 ` Yuri Khan
2024-08-28  9:09   ` Heime [this message]
2024-08-29  1:21   ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-08-29 10:21     ` Heime
  -- strict thread matches above, loose matches on Subject: below --
2024-08-28 23:22 Heime

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='WUD-cLs18gIwwms2b6friH_iMiYft8BgBUf9i_mbiFjSqjN7BWq2BQu6xtSRRY0LsTfjhmiGh-87hjkIhGN_xcGcbW8TPUXXi3XX1ee0sF0=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=yuri.v.khan@gmail.com \
    /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.
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).