all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: Transient Region Highlighting - an improvement over Transient Mark Mode.
Date: Tue, 1 Apr 2008 15:19:31 +0000	[thread overview]
Message-ID: <20080401151931.GA6533@muc.de> (raw)

Hi, Emacs!

I've criticised Transient Mark Mode somewhat in the last few days.  I
therefore feel obliged to make a constructive suggestion as how to make
it better.  Here is that suggestion:

Analysing T-M-M, it seems to consist of 3 vaguely related features:
(i) Disabling functions which operate on the region;
(ii) Highlighting the region;
(iii) Restricting the operation of some commands (e.g. M-x occur) to the
  region when highlit, a sort of narrowing.

Just as an aside, I think that terms like "active mark" and "activating
the region" are unhelpful, and have caused confused thinking over the
years.  Neither the mark nor the region is an agent - they don't DO
anything, anymore than a milepost on a country road between two villages,
or the road itself, do.  So I suggest we purge these terms from the code
and manual.


Feature (i) above, the one for which "Transient Mark Mode" is named,
doesn't seem to be useful, so let's just remove it - the mark, once set,
remains set, ditto for the region.  The variable mark-even-if-inactive is
redundant, and can vanish (or be marked obsolete).


Feature (ii) seems to be what people really want.  So let's rename the
entire feature "Region Highlighting Mode".  The variable
`region-highlighting-mode' should take the values nil, t, and possibly
'always, should there be anybody who wants the region always to be
highlit.

Region highlighting is switched on when the user types C-<space>, (?C-u)
C-x C-x or M-@ or the like, or the "certain mouse commands".  There
should be a command to switch it off (Keybinding C-u C-g, perhaps?).  I
don't think a simple C-g should switch it off.  Highlighting should also
be removed (via a before-change-function, possibly) when the buffer is
changed.  I don't think it should be switched off on executing a random
command.  For example, if you do M-: region-highlit, and see "t", the t
should remain meaningful.

"Momentary Transient Mark Mode" (there's tautology there ;-) should stay,
but be renamed to "Explicit Region Highlighting", to indicated that the
region gets highlit only when the user explicitly requests it via
C-<space> C-<space> or C-u C-x C-x.


Feature (iii) should be construed as "Wide area commands are restricted
to the region when it is highlit", and should be an option independent of
Region Highlighting Mode.  How about calling it
`area-commands-on-highlit-region-flag'?  To use this feature when Region
Highlighting is switched off, a user needs to set explicit region
highlighting first.


I think something like this design would be logically coherent, simple to
document, implement and use, would have the features that people want,
and be a vast improvement over the current Transient Mark Mode.

What do others think?

-- 
Alan Mackenzie (Nuremberg, Germany).




             reply	other threads:[~2008-04-01 15:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-01 15:19 Alan Mackenzie [this message]
2008-04-01 16:06 ` Transient Region Highlighting - an improvement over Transient Mark Mode Stefan Monnier
2008-04-01 17:49   ` Alan Mackenzie
2008-04-01 18:10     ` Luc Teirlinck
2008-04-01 18:18       ` Luc Teirlinck
2008-04-01 18:48       ` paul r
2008-04-01 19:04       ` Alan Mackenzie
2008-04-02  2:01         ` Mike Mattie
2008-04-02  0:57   ` Manoj Srivastava
2008-04-02 14:04     ` Stefan Monnier
2008-04-02 18:32       ` Manoj Srivastava
2008-04-02 20:40         ` David Kastrup
2008-04-01 17:08 ` Andreas Röhler
2008-04-01 17:16 ` Vincent Belaïche
2008-04-01 21:29   ` Mathias Dahl
2008-04-02  6:26     ` Jan Djärv

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=20080401151931.GA6533@muc.de \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.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.