Skip to main content
3 votes
Accepted

Store the cursor position relative to surrounding text, make edits, then insert text at the stored location

From your description, you don't want to return to a particular buffer position. You want to return to a particular text position, that is, a position in context, a position relative to the text ...
Drew's user avatar
  • 78.1k
3 votes
Accepted

How to delete a marker

Markers that point nowhere are garbage-collected. From the Elisp manual, node Overview of Markers: Insertion and deletion in a buffer must check all the markers and relocate them if necessary. ...
Drew's user avatar
  • 78.1k
2 votes
Accepted

Interactive: region beginning/end as markers

In the case given don't see a necessity for a marker: (defun my-comment-region (start end) (interactive "*r") (comment-region start end)) A marker is needed, if the start/end positions are going ...
Andreas Röhler's user avatar
2 votes
Accepted

How are markers implemented?

buffer.h defines markers in struct buffer_text like so: /* The markers that refer to this buffer. This is actually a single marker --- successive elements in its marker `chain' are the other ...
phils's user avatar
  • 51.9k
1 vote
Accepted

How to use markers as keys in a hash map?

I reported this problem to [email protected]. @Stefan Monnier replied that this seems to be fixed in the development version (master) for Emacs 29.
Drew's user avatar
  • 78.1k
1 vote
Accepted

Searching text between markers as in Nota Bene

Yes. Here are some ways. With just vanilla Emacs you can narrow the buffer to the text between your two "markers", using C-x n n. You need only one marker - the mark, at one end of that bit of text, ...
Drew's user avatar
  • 78.1k
1 vote
Accepted

Set colour/font for markers

See this answer. Except in your case: (set-fringe-bitmap-face 'right-triangle 'my-custom-curly-face)
muffinmad's user avatar
  • 2,330

Only top scored, non community-wiki answers of a minimum length are eligible