emacs-devel
[Top][All Lists]
Advanced

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

Re: Tentative diagnosis of TMM's problem. [Re: Enabling Transient Mark M


From: Stefan Monnier
Subject: Re: Tentative diagnosis of TMM's problem. [Re: Enabling Transient Mark Mode by default]
Date: Thu, 21 Feb 2008 09:54:01 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> If you only want to visually highlight a piece of text, you can use
>> other packages that do that, like facemenu.

> Yes, of course there are workarounds, but that doesn't answer the point.
> ;-)  Why is toggling the region highlighting not regarded as a command
> in its own right?  Why can I not, in emacs -Q, highlight the region with
> (say) C-x r h?  (Hey, that binding, still unused, could hardly be more
> appropriate.  :-)

As mentioned in an earlier message, I find that having to do C-u C-x C-x
to activate temporary-TMM is too long already.
[ So maybe M-x temporary-transient-mark-mode RET yes RET would be
  preferable, although partial-completion-mode could still undermine such
  efforts to force-train my (inexistent) touch-typing. ]

>> > I think that if we partitioned TMM into the command `highlight-region',
>> > and the other stuff, most of the acrimony on this thread would abate.
>> > highlight-region probably deserves its own key binding.

>> I don't think it's the right way to cut it.  The main issue is with the
>> conflation of 2 concepts on the set/push-mark commands: one is to push
>> a buffer location on a ring for navigational purposes, the other is to
>> set the boundary of the region.

> Yes, "issue", but not "problem".  This handling of THE mark is essential
> to Emacs, and I am convinced it is not coincidental.  These 2 mark uses
> are not sharply distinct; I often want to go to places in the mark ring
> that were originally there for region operation; I often do M-> C-w to
> delete the last few lines of a buffer.  Were there to be separate marks
> for these purposes, Emacs wouldn't be Emacs.

The issue is not so much the mark itself as the mark's
activation status.  Without TMM, the mark is (basically) always
activated because it never hurts.  Let's think of it as 3 different
activation levels:
0 - unset:  This state is rare and rather uninteresting.
    Basically it's only the initial state before the first
    mark-pushing command.
1 - set:  There is a mark, but it's not active, so the region is not
    highlighted and commands like M-; do not operate on the region.
    OTOH commands that only operate on the region such as C-w will
    work, tho.
2 - highlighted:  Not only there's a mark but it's active and the region
    is highlighted.

- By default: most mark-setting commands set the mark to 1 and some rare
  exceptions like C-u C-x C-x and C-SPC C-SPC set the mark to 2.
  C-g or buffer-edits only brings the mark from state 2 to state 1 and
  otherwise doesn't change anything.

- With TMM without mark-even-if-inactive: all mark-setting commands set
  the mark to state 2.
  C-g or buffer-edits only brings the mark to state 0.

- With TMM with mark-even-if-inactive: all mark-setting commands set
  the mark to state 2.
  C-g or buffer-edits bring the mark to state 1 and otherwise doesn't
  change anything.

So I suggest to close the gap between the previous default and the
current default by reverting to the previous default but changing some
of the mark-setting commands (I'm thinking mainly of the mark-*
commands) to set the state to 2 rather than to 1.


        Stefan




reply via email to

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