emacs-devel
[Top][All Lists]
Advanced

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

Re: visual-region-mode?


From: Charles A. Roelli
Subject: Re: visual-region-mode?
Date: Sat, 29 Sep 2018 13:18:11 +0200

> From: Yuri Khan <address@hidden>
> Date: Tue, 25 Sep 2018 01:07:24 +0700
> 
> On Tue, Sep 25, 2018 at 12:41 AM Charles A. Roelli <address@hidden> wrote:
> 
> > Yes.  See the doc of "t-m-m":
> >
> >             The mark is "deactivated" by changing the buffer,
> > and after certain other operations that set the mark but whose
> > main purpose is something else--for example, incremental search,
> > M-<, and M->.
> 
> FWIW, mark is not deactivated for me by incremental search.
> 
> $ emacs -Q
> M-x emacs-version
> → GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
> of 2018-05-29
> 
> 1. In the *scratch* buffer, move point to the start of the word “buffer”.
> 2. Select the word “buffer” by holding down Shift and pressing <right>
> six times.
> 3. Press C-s for isearch-forward.
> 4. Search for “text”.
> 5. Press RET to end incremental search.
> 
> Observed: “buffer is for text” is highlighted as region.
> 
> Expected: region is deactivated.
> 
> 6. Move point using an unshifted arrow key.
> 
> Observed, expected: region is deactivated.
> 
> 
> The ability to extend a region using isearch is occasionally useful,
> but it would probably be better if it only behaved that way if invoked
> as C-S-s or C-S-r (as a general case of shifted navigation command).
> (Text terminal users are out of luck with Shift+Ctrl+letter bindings,
> though.)

Yes, the documentation is wrong here, and probably needs a review.

There's more: in your recipe, ISEARCH actually does not set the mark
where the search was started (since the region is already active) --
to give the impression that ISEARCH "extends the region".  So the
documentation here is doubly wrong.

The manual tries to explain why ISEARCH sometimes does not push a
mark:

    When you exit the incremental search, it adds the original value of
  point to the mark ring, without activating the mark; you can thus use
  ‘C-u C-<SPC>’ or ‘C-x C-x’ to return to where you were before beginning
  the search.  *Note Mark Ring::.  (Emacs only does this if the mark was
  not already active; if the mark was active when you started the search,
  both 'C-u C-<SPC>' and 'C-x C-x' will go to the mark.)

The wording leaves something to be desired.  The parenthetical could
maybe say:

  Emacs only pushes the mark if it was not already active; if the mark
  was active when you started the search, both 'C-u C-<SPC>' and 'C-x
  C-x' will place point at the other end of the active region, not at
  the original value of point.

Also, isearch.el seems not to have any documentation about any of the
mark- or "t-m-m"-related behavior, at all.



reply via email to

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