From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: master 760910f: Add a new buffer-local variable `minor-modes'
Date: Sun, 14 Feb 2021 16:41:53 +0100 [thread overview]
Message-ID: <874kieejwe.fsf@gnus.org> (raw)
In-Reply-To: <jwvtuqe652b.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 14 Feb 2021 10:34:51 -0500")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Hmm... those files that have already been compiled with earlier Emacsen
> will not keep this var up-to-date, so it can't be used reliably.
> Also, I wonder why we need this to be a variable.
Yes, the .elc files will have to be recompiled.
> Can't we have an `enabled-minor-modes` function instead, which can simply
> loop through `minor-mode-list` and see which ones are enabled?
But how do we know which ones are enabled? As far as I know, there's no
way to know (reliably) -- the :variable that shows whether the mode is
on or not isn't preserved anywhere.
Even if we had a function like that, looping over all possible minor
modes and calling predicates for them sounds hopelessly slow when you
have to do this for thousands of symbols...
>> + ;; Keep `minor-modes' up to date.
>> + (setq minor-modes (delq ',modefun minor-modes))
>> + (when ,getter
>> + (push ',modefun minor-modes))
>
> For global minor modes, this will adjust the list for the buffer that
> happens to be current when the mode is changed, but it won't affect all
> other buffers's lists.
Oh, darn, didn't think about globalized minor modes...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2021-02-14 15:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210214113754.21891.10736@vcs0.savannah.gnu.org>
[not found] ` <20210214113756.93760209D4@vcs0.savannah.gnu.org>
2021-02-14 12:26 ` master 760910f: Add a new buffer-local variable `minor-modes' Basil L. Contovounesios
2021-02-14 12:49 ` Lars Ingebrigtsen
2021-02-14 13:01 ` Lars Ingebrigtsen
2021-02-14 13:47 ` Lars Ingebrigtsen
2021-02-14 15:34 ` Stefan Monnier
2021-02-14 15:41 ` Lars Ingebrigtsen [this message]
2021-02-14 15:45 ` Lars Ingebrigtsen
2021-02-14 18:17 ` Stefan Monnier
2021-02-14 18:40 ` Lars Ingebrigtsen
2021-02-14 23:19 ` Stefan Monnier
2021-02-14 23:22 ` Lars Ingebrigtsen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874kieejwe.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 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.