Questions tagged [mark]

is for marking the start of a region of text in a buffer. Emacs uses `mark` and `point` to highlight a region. Highlighting indicates that the mark and region are active.

Filter by
Sorted by
Tagged with
5
votes
2answers
250 views

Mysterious highlight in emacs

Recently, I change my laptop from old Thinkpad to newer laptop with much larger touchpad. I've found that I frequently touch the sensitive touchpad while I'm using emacs. And with some mysterious ...
0
votes
0answers
11 views

C-w deletes everything below the cursor [duplicate]

I first press Ctrl-Space to mark start of block, I select lines and to cut the selected text, using C-w. Later I undo this and move my cursor top of the file and and press C-w, now all the lines ...
0
votes
0answers
29 views

What does the “Mark set” message mean when going to the beginning or end of the buffer?

Opening emacs -Q, then Pressing Ctrl-Home or Ctrl-End also shows this message. Mark set What is happening? Why is the mark set and is there a way not to set the mark?
3
votes
6answers
350 views

Storing previous cursor positions

I would like the ability to go back and forth through a series of stored recent cursor positions, say up to 100 of them. Specifically, a position should be recorded when I click somewhere, or when I ...
0
votes
1answer
41 views

Automatic “push-mark” when navigating with xref, find-grep, etc?

There seem to be a lot of situations, where a command changes the cursor location (point), but no mark is pushed, making navigating back by popping the mark with C-u SPC impossible. For isolated use-...
1
vote
2answers
89 views

Select to the sentence of line in a shortcut

C-k and M-k could delete forward to the end of line and sentence respectively. How could only select to the end in a shortcut? Usually select a sentence and append it to a file for further ...
1
vote
1answer
60 views

Mark isearch result

I'd like to mark the current isearch result so that it can be copied or cut (killed) via M-w and C-w. Is there a ready-made function for this? The solution below provided by @danielpoe over here ...
0
votes
0answers
46 views

Mark Cursor Vertically on Multiple Lines

I can enter rectangle mark mode with C-x SPC, and then do C-p or C-n to set mark to the line above or below. How do I vertically mark multiple lines in one go without having to do C-p or C-n multiple ...
0
votes
0answers
43 views

Filter to track end of process output in buffer by default

Taking advice from the manual as per this link: https://www.gnu.org/software/emacs/manual/html_node/elisp/Filter-Functions.html I've created a filter for a process I'm running under emacs. (defun ...
3
votes
1answer
58 views

Making a region without point

From my understanding, Emacs creates a region my setting a mark and then anything between 'mark' and 'point' is the current region. I'm wondering if there is a way to create a region with only marks, ...
4
votes
1answer
2k views

How to unmark selection in elisp?

I wish to remove selection programatically, what is the proper way of doing this? Specifically I wish to write a function to make swiper search in buffer with selected text, but it needs to remove ...
1
vote
1answer
431 views

How to bind meta-shift-arrow to mark one word at a time

I am having trouble of marking one word at a time (ctrl-shift-arrow or meta-shift f/b) when connecting from one of my terminals. I would like to bind it also to meta-shift-arrow. I couldn't find what ...
1
vote
0answers
77 views

How to delete a long region by setting a mark and then searching for the location of the end of the region?

I have a long document. I placed two unique identifiers, in the form of short strings of printable English letter, in two positions in the document. The identifiers are far apart. My task is to delete ...
-1
votes
2answers
113 views

Highlight active region without transient-mark-mode

Is there any way to have the region highlighted without transient-mark-mode on? I'm trying to implement kakoune style editing in emacs and having a persistent region actually makes sense under that ...
0
votes
1answer
62 views

Inconsistent point in an elisp program and in a visible non-focused process buffer

I am able to collect output data from a process, but I don't understand the coordination of point and process-mark. In particular, the visible cursor in a non-selected window visiting the buffer does ...
2
votes
1answer
81 views

how to fix an overlay at end-of-line highlighting too much?

I have added the following definitions to my initialization file in order to make the mark show up as a red highlight: (defface mmv-face '((t :inherit default :background "red")) "...
1
vote
1answer
39 views

Make region transient in elisp function

I'm trying to write a function that exits isearch leaving the current match selected "transiently", so that the mark is deactivated by any unshifted movement command. I've tried to modify this ...
2
votes
1answer
99 views

Since upgrading to emacs 26.1 C-SPC behaviour changed and I have to press it twice to set-mark

Since upgrading to Emacs 26.1 C-SPC behaviour changed and I have to press it twice (most of the time) to set mark, which disrupts my flow and is hard on my thumb joint (don't ask). I'd like to ...
5
votes
0answers
49 views

Point belongs to window - mark belongs to buffer

In Emacs the point belongs to a window: this allows a buffer to be displayed in two different windows at the same time. The mark belongs however to the buffer. Conceptually the mark and a point ...
1
vote
1answer
53 views

Cannot mark text when inserting into buffer within post-command-hook

When I add this post-command-hook: (defun insert-into-a-buffer () (with-current-buffer (get-buffer-create "some-buffer") (insert "a"))) (add-hook 'post-command-hook 'insert-into-a-buffer ...
0
votes
1answer
82 views

Why is the mark ring called a 'ring' and not a 'stack'?

From the description of the mark ring on the Emacs website (link) it seems to me that it is basically just a stack with a maximum size set to be 16. So I am curious why this data-structure is called a ...
0
votes
0answers
49 views

How can I get my target string point/marker without moving the pointer?

Lets say I have the following LaTeX code: \ref{AAA}, \ref{BBB} ... \ref{BBB,CCC,DDD} \begin{the bibliography}{99} \bibitem{AAA} \bibitem{BBB} and I want to write a function that does: (perform-...
2
votes
1answer
66 views

command to mark a block comment as region

Is there an existing EMACS command to select a block comment? That is, I have /** * A Comment */ I want to set the mark ahead of the /** and set the point after */. I realize there are several ...
5
votes
3answers
1k views

delete-selection-mode not a default?

If you enable Delete Selection mode, a minor mode, then inserting text while the mark is active causes the selected text to be deleted first. This also deactivates the mark. Many graphical ...
1
vote
1answer
110 views

Region does not get deselected on move commands using `push-mark` from Elisp

By using shift-select-mode, I can select some region via holding down Shift + arrow keys. When I then stop pushing Shift and press other keys the region get deselected. But this is not the case when ...
0
votes
1answer
87 views

Can I programmatically get access to the yanked region?

You are likely to want to do things to the text that you just yanks / pasted (wrap it in brackets etc). Is there a way to know what you just yanked? If so I would quite like select it (put the mark ...
7
votes
5answers
6k views

Best way to select a word

I want to select current word under the cursor without using mouse. After searching this forum, I learned how double click works. (I noticed that it is a bit complicated and there were no direct key ...
1
vote
1answer
50 views

Select Within Quotes

Supposing I have my cursor resting somewhere in a bunch of text within quotes, is there a key binding that will mark or highlight just the text within the quotes so I can delete it? This would be ...
1
vote
1answer
113 views

deactivate active region after `eval-region`

I do the following to activate the region and evaluate it M-x spc to begin mark C-n C-n C-n M-x eval-region The region is still active (highlighted) after the eval-region is performed. I would ...
4
votes
3answers
1k views

How to mark current line and move cursor to next line?

How do I mark the current line and then move the cursor to the beginning of the next line? I'd like it to behave like Sublime Text's Ctrl-L.
0
votes
2answers
65 views

Function to duplicate and mark duplicated text

In order to be able to chain the following command, I need the yanked text to be marked. That is because the end goal is to call (pop kill-ring) so that I can still use whatever was at the top of the ...
1
vote
1answer
142 views

Making it so that cursor movement after command will deactivate region

I'm overriding double-mouse-1 to do additional stuff on top of its default behavior. To this end, I have a function that (1) does my additional stuff and then (2) calls another function, ora-mark-like-...
1
vote
2answers
167 views

wanderlust: save all attachments in a group of messages

I'm using wanderlust in emacs-25.1.x I'm looking for a way to select a group of messages and have all of their MIME attachments extracted and saved into a specified folder. I assume that I can mark ...
3
votes
2answers
396 views

Is it possible to disable automatic “mark”ing in emacs?

I would like to set the marks myself, rather than emacs doing it automatically for me. I've experienced emacs setting the mark automatically when I search, or move to the top/bottom of the buffer. ...
6
votes
3answers
936 views

How to grep marked files in the dired mode of emacs?

I hope it's a simple problem.. I'd like to search for the regexp 'thisWord' only in the marked files of a dired buffer. Usually I used in the dired buffer: M-x grep and then in the mini-buffer grep ...
2
votes
1answer
215 views

emacs mark from point to start of buffer?

I know one can mark the whole buffer with mark-whole-buffer. but how does one mark from point (that line) to start of buffer?
32
votes
6answers
5k views

Effectively using the mark ring

I have used the mark to select regions of a buffer. For example, I know the sequence C-<space> C-s foo can be used to select all text between the current point and the point after a search for ...
4
votes
1answer
260 views

What are the differences mark-ring and global-mark-ring?

I have just explore how to use mark rings in emacs. There are two kind of mark type mark-ring and global-mark-ring. What are the differences between them and is there any option to push all marks ...
2
votes
1answer
94 views

What is the problem with this yank function in elisp in emacs?

Idea I will like to construct a simple emacs function that copies the yy functionality in vim. The function should yank a visual-line into kill ring without deleting the line. Function Here is ...
0
votes
4answers
138 views

Set the mark at the beginning of the current function definition

I want this function: assume that I am inside a function, and in line 100, now I want to go to the definition of this function, say 80, and set mark, then go back to 100. So now I have an active ...
2
votes
1answer
124 views

Error using the Emacs Spreadsheet

I have started to use the Simple Emacs Spreadsheet (SES) with GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-09-17. When I try to mark/highlight a column with (ses-mark-column), the selection doesn'...
0
votes
1answer
56 views

What does refeer evil-mode ^ (carry)'s mark to ? (shown in :marks list)

I Think I have an idea, unless i want to be sure. According to vim.wikia.com, [ and ] marks in vim refers to beginning/end of previously changed or yanked text, but there is no built-in ^ mark. I ...
2
votes
1answer
135 views

What changed with Mark/Region behavior between GNU Emacs 24.3.1 and 24.5.1?

I wrote a little search function a long time ago, binded to ctrl-f. It has been working perfectly until I tried Emacs 24.4. The purpose of the function is to highlight (region) the found word. ...
0
votes
1answer
110 views

Unable to deactivate the selection mode with C-SPC

Sometimes I can't deactivate the mode of selecting text which is C-SPC. Even if I press it a second time and move the cursor, the text still gets selected. I press C-SPC one more time, it activates ...
0
votes
1answer
122 views

How to automatically set marks on all of the edited lines?

I would like to automatically set marks on all of the edited lines so that I can go back to any of my previous edited lines using helm-mark-ring.
2
votes
1answer
199 views

pop-mark not working as expected

I have some sample code like this: (defun some-function () (interactive) (push-mark) (goto-char (point-min)) ; do some stuff (pop-mark)) Now I'm expecting pop-mark to get me back to the ...
7
votes
3answers
833 views

Is there a package to simplify clickable text?

I'm writing a debugger front end, and in that over the course of program execution a number of marks get added inside the source code. In other buffers such as a buffer showing execution history, or a ...
2
votes
2answers
557 views

How to jump to a mark using Elisp

Suppose I store the current mark into a variable using mark or (mark-marker). Then I move point elsewhere and insert some text. Which function should I use to jump to the saved mark?
1
vote
1answer
76 views

highlight blank spaces only under the marked region

Is there a way to only highlight blank spaces/tabs under the marked region? Basically if I have whitespace-mode turned off and if a select a region all the spaces and tabs get highlighted.
9
votes
1answer
609 views

How to set mark in elisp and have shift selection?

The normal behavior of Emacs when transient-mark-mode is active is that when you make a shift-selection, then if the next command is a non-shift movement, the mark is deactivated. For example, after ...