emacs-devel
[Top][All Lists]
Advanced

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

Re: `inhibit-mark-movement'


From: Paul Pogonyshev
Subject: Re: `inhibit-mark-movement'
Date: Wed, 8 Dec 2004 17:40:48 +0200
User-agent: KMail/1.4.3

Stefan Monnier wrote:
> > In other words, I'd like these two scenarios be possible
> > simultaneously (in Transient Mark mode):
> >
> >     1. Select text from point to the end of function: C-SPC C-M-e
> >
> >     2. Glance at buffer beginning and go back: M-< C-u C-SPC
>
> I don't understand: just turning on transient-mark-mode, I get exactly
> this behavior.  No need to fiddle with inhibit-mark-movement.
> What am I missing?

Sorry, the first scenario is wrong.  It should read this way:

        1. Select text from point to somewhere else: C-SPC C-M-e / C-n...
           where C-M-e and C-n (or something similar) can be mixed.

What I'm trying to suggest is that commands should not modify active mark
in Transient Mark mode _by side effect_.  Commands like M-h are fine to
modify mark, because they _activate_ it.  If command is not meant to
activate mark and the mark is active, the command should not touch it at
all, because I activated mark exactly where I wanted it to be.  If the
mark is inactive, commands can alter it, because this is not intrusive
for Transient Mark mode users and is useful for popping to previous mark
positions.

Juri Linkov wrote:
> I already encountered the same problem some time ago.  I fixed it as
> below and really like this.  It makes use of transient-mark-mode
> more natural: the mark should not be changed when it is active.
> If there is a need to set a new mark when the mark is already
> active, it's possible to deactivates the current region with C-g,
> and set a new mark.

I didn't try your patch, but looks like it implements exactly what I'm
trying to explain.  Except that I proposed to make this behaviour
optional.  However, this behaviour seems much more natural to me, so
maybe customization is not necessary if we don't mind surprising a few
users.

Juri Linkov wrote:
> > I'd like these two scenarios be possible simultaneously (in
> > Transient Mark mode):
> >
> >     1. Select text from point to the end of function: C-SPC C-M-e
> >
> >     2. Glance at buffer beginning and go back: M-< C-u C-SPC
>
> You can achieve the desired result with 3 more keys:
>
>  1. Select text from point to the end of function: C-SPC C-M-e
>
>  2. Glance at buffer beginning and go back: C-g M-< C-u C-SPC C-x C-x
>                                             ===               === ===

Yes, you are right, but I meant "simultaneously" in that sense that
I don't want to evaluate `(setq inhibit-mark-movement ...)' before
realization of either of scenarios.

Paul





reply via email to

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