all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Lars Ingebrigtsen <larsi@gnus.org>
Subject: Re: master 760910f: Add a new buffer-local variable `minor-modes'
Date: Sun, 14 Feb 2021 10:34:51 -0500	[thread overview]
Message-ID: <jwvtuqe652b.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20210214113756.93760209D4@vcs0.savannah.gnu.org> (Lars Ingebrigtsen's message of "Sun, 14 Feb 2021 06:37:56 -0500 (EST)")

>     Add a new buffer-local variable `minor-modes'
>     
>     * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Keep
>     `minor-modes' updated.

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.

Can't we have an `enabled-minor-modes` function instead, which can simply
loop through `minor-mode-list` and see which ones are enabled?

> +           ;; 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.


        Stefan




  parent reply	other threads:[~2021-02-14 15:34 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 [this message]
2021-02-14 15:41     ` Lars Ingebrigtsen
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=jwvtuqe652b.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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 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.