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
0 votes
1 answer
21 views

Mark up to and including the character under the cursor

By default, when I activate mark it just adds everything to the region up to the point which is behind the cursor (image below) What I want to achieve, however, is to also include - as part of my ...
user avatar
  • 121
1 vote
2 answers
61 views

Can I have a selected region that doesn't have point (cursor position) at one of its ends?

I have C-a bound to mark-whole-buffer to replicate the "select all" feature of other standard GUI editors (I also use cua-mode), as described in https://stackoverflow.com/questions/22544655/...
user avatar
  • 127
3 votes
1 answer
63 views

How to select/mark a whole paragraph in org-mode?

I have the following paragraph inside an .org file: Observation: Currently, this feature is not part of the last stable release (version 2.2.4). Thus, users can only access it while running the ...
user avatar
1 vote
1 answer
90 views

How to go to the beginning of a selection?

I selected a large region by going to the beginning line and hit C-SPC (currently mapped to cua-set-mark), and then moving to the end of the buffer with M-S->. Now for some reason, I want to get ...
user avatar
  • 930
2 votes
1 answer
42 views

How to apply multiple actions to the same active region (using CUA-mode) [duplicate]

Imagine one wants to apply two functions (A and B, where A could be commenting the code with M-; and B convert the text to all-caps with C-x C-u) to the same active region. I would proceed as follows: ...
user avatar
0 votes
1 answer
69 views

Popping the mark in Emacs

I am interested to know more about the use of the phrase "pop" in relationship to the mark in Emacs. The command pop-global-mark, as I understand it, jumps to the buffer and position of the ...
user avatar
  • 1,060
1 vote
0 answers
71 views

Indicate the mark in a buffer in Emacs

Is there a way of visually indicating mark and previous locations of mark in a buffer using only vanilla Emacs without any external package?
user avatar
  • 1,060
1 vote
1 answer
78 views

How to select and replace the content of all specific org-headings?

I am trying to select each content-heading extracted with org-noter and then remove all erroneous newlines. This is my function. (defun sanitize-noter-import () "Sanitizes org-noter imports. ...
user avatar
-1 votes
1 answer
119 views

mark-sexp (Wrong number of arguments)

((foo(bar)) ...
user avatar
0 votes
1 answer
48 views

How to insert text and activate the mark in the same function [duplicate]

I am trying to write a function where I insert some text, and then activate the mark at the end of the function. I have several use-cases where I would like to use this. I cannot figure out how do ...
user avatar
  • 1
5 votes
2 answers
462 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 ...
user avatar
  • 305
0 votes
0 answers
85 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?
user avatar
  • 7,267
0 votes
1 answer
193 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-...
user avatar
  • 1,481
1 vote
2 answers
473 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 ...
user avatar
  • 1,099
0 votes
0 answers
159 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 ...
user avatar
  • 211
1 vote
1 answer
85 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 ...
user avatar
  • 655
3 votes
1 answer
73 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, ...
user avatar
  • 47
3 votes
1 answer
328 views

(interactive "r") can't be used directly after Emacs startup

The proper way to deal with region is using (interactive "r"). But in my case, (interactive "r") always complaints: The mark is not set now, so there is no region after fresh ...
user avatar
  • 604
1 vote
0 answers
107 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 ...
user avatar
  • 1,409
-1 votes
2 answers
250 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 ...
user avatar
0 votes
1 answer
70 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 ...
user avatar
  • 701
2 votes
1 answer
169 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")) "...
user avatar
1 vote
1 answer
58 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 ...
user avatar
  • 1,414
5 votes
0 answers
50 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 ...
user avatar
  • 151
2 votes
1 answer
105 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 ...
user avatar
1 vote
1 answer
63 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 ...
user avatar
0 votes
1 answer
125 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 ...
user avatar
0 votes
0 answers
59 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-...
user avatar
2 votes
1 answer
136 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 ...
user avatar
1 vote
1 answer
201 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 ...
user avatar
  • 1,151
0 votes
1 answer
133 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 ...
user avatar
  • 547
9 votes
5 answers
9k 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 ...
user avatar
1 vote
2 answers
103 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 ...
user avatar
1 vote
1 answer
216 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 ...
user avatar
0 votes
2 answers
83 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 ...
user avatar
6 votes
3 answers
2k 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 ...
user avatar
  • 297
1 vote
2 answers
226 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 ...
user avatar
  • 522
1 vote
1 answer
212 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-...
user avatar
  • 171
3 votes
2 answers
500 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. ...
user avatar
  • 31
6 votes
3 answers
1k 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 ...
user avatar
  • 326
3 votes
1 answer
322 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?
user avatar
  • 1,625
4 votes
1 answer
414 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 ...
user avatar
2 votes
1 answer
153 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 ...
user avatar
  • 123
0 votes
4 answers
219 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 ...
user avatar
2 votes
1 answer
150 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'...
user avatar
  • 1,638
3 votes
8 answers
846 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 ...
user avatar
  • 171
0 votes
1 answer
62 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 ...
user avatar
6 votes
1 answer
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 ...
user avatar
  • 1,151
0 votes
1 answer
180 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.
user avatar
  • 969
1 vote
1 answer
99 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.
user avatar