help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: How to stop emacs from moving marks I set


From: Drew Adams
Subject: RE: How to stop emacs from moving marks I set
Date: Wed, 29 Aug 2012 09:34:09 -0700

> I often like to set a mark (with C-@) and then move the 
> cursor to another location to, say, cut a section of text.
> 
> Under certain circumstances, when I use search (C-s) to move 
> the cursor, and then move the cursor a bit more (with, say 
> arrow keys), emacs moves the mark to where the search started 
> ("Mark saved where search started").
> 
> 1. Is there a way to get emacs to leave the mark where I 
> explicitly set it?
> 
> 2. Under what circumstances does emacs decide to ignore the 
> mark that I set explicitly and set its own mark?
> 
> 3. By what logic does this editor allow the user to set a 
> mark and then ignore that setting?

Your mark is not removed or moved.  It is "ignored" only in the sense that it is
no longer the most recent marker, since, yes, Isearch does set the mark at the
search start position.  It does this because it is very convenient to use `C-x
C-x' to get back to that starting point.

You can use `C-u C-SPC' to pop back to the previous marker.  Repeat to move
backward in the mark history.  This is general for Emacs (not specific to
search): markers are kept in a history (a ring), which you can cycle through to
navigate among marked positions.

See also these pages wrt Isearch:

http://emacswiki.org/emacs/IncrementalSearch#toc6
http://emacswiki.org/emacs/IsearchOtherEnd
http://www.emacswiki.org/emacs/IsearchPlus#Isearch%2b 
(for the last one, see option `isearchp-set-region-flag', Isearch key `C-SPC' to
toggle that option, and command `set-region-around-search-target')





reply via email to

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