* How to stop emacs from moving marks I set
@ 2012-08-29 16:13 larry.camilli
2012-08-29 16:34 ` Drew Adams
2012-08-30 8:49 ` Barry Margolin
0 siblings, 2 replies; 3+ messages in thread
From: larry.camilli @ 2012-08-29 16:13 UTC (permalink / raw)
To: help-gnu-emacs
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?
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: How to stop emacs from moving marks I set
2012-08-29 16:13 How to stop emacs from moving marks I set larry.camilli
@ 2012-08-29 16:34 ` Drew Adams
2012-08-30 8:49 ` Barry Margolin
1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2012-08-29 16:34 UTC (permalink / raw)
To: larry.camilli, help-gnu-emacs
> 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')
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to stop emacs from moving marks I set
2012-08-29 16:13 How to stop emacs from moving marks I set larry.camilli
2012-08-29 16:34 ` Drew Adams
@ 2012-08-30 8:49 ` Barry Margolin
1 sibling, 0 replies; 3+ messages in thread
From: Barry Margolin @ 2012-08-30 8:49 UTC (permalink / raw)
To: help-gnu-emacs
In article <05c8263f-b9e7-4782-ac8a-4a47e64df00c@googlegroups.com>,
larry.camilli@gmail.com wrote:
> 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?
No. Use point-to-register to set a named mark; these will never be
overridden.
>
> 2. Under what circumstances does emacs decide to ignore the mark that I set
> explicitly and set its own mark?
Many commands that move large distances set the mark to make it easy for
you get get back to where you were. There's no general answer, it's
just a decision made by the designer of specific commands. Examples are
searching and beginning/end-of-buffer.
> 3. By what logic does this editor allow the user to set a mark and then
> ignore that setting?
Emacs doesn't distinguish between the mark being set explicitly by the
user and being set automatically by some command. So it doesn't know
that some mark settings should not be overridden.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-30 8:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-29 16:13 How to stop emacs from moving marks I set larry.camilli
2012-08-29 16:34 ` Drew Adams
2012-08-30 8:49 ` Barry Margolin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).