emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

transient-mark-mode and region highlighting


From: Pavel Janík
Subject: transient-mark-mode and region highlighting
Date: Sun, 27 Jan 2002 13:01:19 +0100
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i386-suse-linux-gnu)

Hi,

at the beginning of September, Milan Zamazal sent the following e-mail to
emacs-pretest-bug (it is in after-21.1.xmail):

  327   1-Sep            address@hidden [348] transient-mark-mode and region 
highlighting

--- cut here ---
In GNU Emacs 21.0.105.1 (i686-pc-linux-gnu, X toolkit)
 of 2001-09-01 on blackbird

Currently, transient-mark-mode serves two different purposes: To
highlight a selected region and to introduce "region sensitivity" to
some commands (e.g. replace-string or comment-dwim).  AFAIK there is no
way to separate the two transient-mark-mode's functionalities.  This is
IMHO a bug and the attached patch tries to solve it.

Motivation: I'd like to benefit from the transient-mark-mode features of
active mark sensitive commands, but I dislike region highlighting
performed by transient-mark-mode.  An exception is region highlighting
of mouse selections, which is the reason why simply customizing the
`region' face doesn't satisfy me.

Among the possible solutions I can think of the best one seems to be to
introduce a new user option saying whether transient-mark-mode should
perform region highlighting or not.  The suggested patch below does
this.  I can't say I'm very sure about all consequences of the patch,
but with the default value of the introduced user option it shouldn't
change any of the current conditionals in the sources (thus should cause
no harm) and with the non-default value it seems to work well for me.

The user variable name `highlight-region' doesn't look well to me, but I
couldn't invent a better one.
--- cut here ---

Milan currently does not have time to update his change (which also
contains documentation) to the current CVS, but I thing his ideas could be
useful. Can anyone who uses transient-mark-mode look at it?
-- 
Pavel Janík

Make sure special cases are truly special.
                  --  The Elements of Programming Style (Kernighan & Plaugher)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]