all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: global minor modes that can be overridden locally? [was: highlight-changes-mode]
Date: Sat, 9 Dec 2006 10:55:44 -0800	[thread overview]
Message-ID: <EIENLHALHGIMHGDOLMIMIEFPCNAA.drew.adams@oracle.com> (raw)
In-Reply-To: <EIENLHALHGIMHGDOLMIMMEFDCNAA.drew.adams@oracle.com>

> > >    I think the real question is which way we want global
> > >    minor modes to work.  Do we want the global mode command
> > >    to affect only buffers created subsequently?  Do we want
> > >    it to affect all existing buffers? Only existing buffers
> > >    in which the user has not specified any setting for the mode?
> >
> >     I want turning on or off a global minor mode to affect all
> >     existing and all future buffers (until another explicit
> >     mode change). Anything else would be
> >     a nuisance, in addition to being confusing.
> >
> > Do you use highlight-changes-mode?  Would you say that this
> > change would be an improvement for you, in highlight-changes-mode?
>
> No, I haven't used it. I can't speak to that.

Some thoughts on global minor modes (for after the release). I'm no expert
on minor modes, so please correct any misunderstandings; it's quite possible
this makes no sense at all.

1. Assumption: global minor modes should, generally, let you turn on/off the
mode everywhere at once: all existing and future buffers. This should be the
most direct and easiest thing to do.

2. A minority of global minor modes might want to let you also turn on/off
the mode differently in a particular buffer. IOW, for such modes, you might
want to locally override the global setting (on or off).

3. Perhaps this could be treated analogously to setq-default and setq? For
example, toggling the mode normally would set the default value of the mode
variable everywhere. In buffers that had no different local value, this
would also set the mode. But you could set the local value of the mode
variable differently, if you wanted.

4. Perhaps an interface for #3 something like this?

- M-x foo-mode toggles the mode everywhere (including in buffers that have
local values?) - it is like using setq-default (should it also change the
local values?).

- C-u M-x foo-mode toggles the mode in the current buffer only - it is like
using setq with a local variable.

- C-9 M-x foo-mode turns the mode on globally. M-- M-x foo-mode turns it off
globally. That is, you use a numeric prefix to explicitly turn it on or off
globally (vs toggling).

- C-u C-u foo-mode turns it on locally; C-u C-u C-u turns it off locally.
That is, you use an non-numeric prefix to explicitly turn it on or off
locally (vs toggling). Perhaps someone has a better idea here?

Would this work also for minor modes that are not meant to be changed just
by setting the mode variable? Is there even a need for such a feature
(global modes that can be overridden locally)? Should global minor modes
that use this feature be declared differently - e.g. via :global-local
instead of :global, or should all global minor modes be open to such a use?

  reply	other threads:[~2006-12-09 18:55 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <17721.60660.980363.609046@kahikatea.snap.net.nz>
2006-10-23  5:11 ` highlight-changes-mode Richard Stallman
2006-10-23 18:39   ` highlight-changes-mode Richard Stallman
2006-10-24  0:16     ` highlight-changes-mode rsharman
2006-10-24 17:43       ` highlight-changes-mode Richard Stallman
2006-11-27  1:57         ` highlight-changes-mode rsharman
2006-11-27  6:43           ` highlight-changes-mode Nick Roberts
2006-11-28  2:15             ` highlight-changes-mode rsharman
2006-12-06  6:25             ` highlight-changes-mode rsharman
2006-12-06  6:37               ` highlight-changes-mode rsharman
2006-12-06 18:44               ` highlight-changes-mode Richard Stallman
2006-12-06 19:58                 ` highlight-changes-mode Drew Adams
2006-12-07 21:02                   ` highlight-changes-mode Richard Stallman
2006-12-07 21:13                     ` highlight-changes-mode Drew Adams
2006-12-09 18:55                       ` Drew Adams [this message]
2006-12-11  1:06                         ` global minor modes that can be overridden locally? [was: highlight-changes-mode] Richard Stallman
2006-12-11  1:16                           ` Lennart Borgman
2006-12-11  1:45                             ` Drew Adams
2006-12-11  1:52                               ` Lennart Borgman
2006-12-11  1:58                                 ` Drew Adams
2006-12-12  2:57                             ` Richard Stallman
2006-12-12  3:27                               ` Lennart Borgman
2006-12-12 21:45                                 ` Richard Stallman
2006-12-12 23:02                                   ` Lennart Borgman
2006-12-12  4:06                               ` Drew Adams
2006-12-12  4:25                                 ` global minor modes that can be overridden locally? Miles Bader
2006-12-12  5:00                                   ` Drew Adams
2006-12-29 16:25                                     ` Drew Adams
2006-12-29 22:15                                       ` Stefan Monnier
2006-12-29 22:40                                         ` Drew Adams
2006-12-30  6:24                                           ` Richard Stallman
2006-12-30  8:25                                             ` Drew Adams
2006-12-31  1:46                                               ` Richard Stallman
2006-12-30 22:43                                             ` Kim F. Storm
2006-12-30 23:27                                               ` Lennart Borgman (gmail)
2006-12-30  6:23                                       ` Richard Stallman
2006-12-12 11:08                                   ` Juanma Barranquero
2006-12-12 11:15                                     ` Miles Bader
2006-12-12 11:25                                       ` Juanma Barranquero
2006-12-12 11:33                                         ` Miles Bader
2006-12-12 11:59                                           ` Juanma Barranquero
2006-12-11  1:40                           ` global minor modes that can be overridden locally? [was:highlight-changes-mode] Drew Adams
2006-12-12  2:58                             ` Richard Stallman
2006-12-12  4:08                               ` global minor modes that can be overridden locally?[was:highlight-changes-mode] Drew Adams
2006-12-12 21:45                                 ` Richard Stallman
2006-12-06 23:39                 ` highlight-changes-mode rsharman
2006-12-07 21:03                   ` highlight-changes-mode Richard Stallman
2006-12-09 19:40                     ` highlight-changes-mode rsharman
2006-12-11  1:06                       ` highlight-changes-mode Richard Stallman
2006-12-11  9:15                         ` highlight-changes-mode Kim F. Storm
2006-12-12  2:58                           ` highlight-changes-mode Richard Stallman
2006-12-12  3:16                         ` highlight-changes-mode rsharman
2006-12-12 21:45                           ` highlight-changes-mode Richard Stallman
2006-12-12 23:33                             ` highlight-changes-mode rsharman
2006-12-14  5:29                               ` highlight-changes-mode Richard Stallman
2006-11-27 15:38           ` highlight-changes-mode Richard Stallman
2006-11-28  2:04             ` highlight-changes-mode rsharman
2006-12-05  2:42               ` highlight-changes-mode rsharman

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=EIENLHALHGIMHGDOLMIMIEFPCNAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.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.
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.