The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
1
vote
1answer
27 views

Mark isearch results

I'd like to mark regex isearch results so that they 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 copies ...
0
votes
0answers
26 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
34 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
54 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, ...
3
votes
1answer
1k 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
311 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
59 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
66 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
50 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
58 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")) "Face used for ...
1
vote
1answer
35 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
95 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
45 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
46 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
74 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
45 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
56 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 ...
4
votes
3answers
718 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
70 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
69 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 ...
6
votes
5answers
4k 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
40 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
82 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 ...
3
votes
3answers
815 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
55 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
116 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
143 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
347 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
728 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
189 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?
29
votes
6answers
4k 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
191 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
76 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
122 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
112 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'...
2
votes
3answers
185 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
51 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
129 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
86 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
104 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
186 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
746 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
462 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
71 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
471 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 ...
1
vote
1answer
41 views

Cutting selection with CUA-mode bindings after searching

I want to cut/copy some code with this method: setting a mark with C-SPC, searching with C-s, then cutting/copying the selection. Check the following image: I can copy selected code with M-w or ...
2
votes
2answers
238 views

Selecting inner-most scope in C/C++

I would like to be able to mark the current block scope. In other words, given some piece of code like: ... if (1) { ... } ... If my cursors was sitting somewhere inside the if-body, it would mark ...
4
votes
2answers
123 views

Activating the region without altering the mark ring

Setting the mark and moving point activates the region, which appears highlighted (assuming transient-mark-mode is enabled). Once the mark is set it's location is sent to the mark ring, thus changing ...
4
votes
2answers
120 views

Keep region activated upon completion of my command

I'm using the following functions to speed up some regexps replacements I frequently use. jc-replace-regexp-in-region can be called by several functions like jc-dollar-to-paren. At the moment, when ...
1
vote
5answers
99 views

Leave point in original position when C-g is pressed?

I am writing a function to select a region (say 2 lines). (defun select-some-region () (interactive) (push-mark (point) nil t) (forward-line 2)) When point is in a buffer like this |...