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
27 views

Why Does The Highlighted Region Go Away?

I want to be able to select multiple lines and move them up and down as a block, while "jumping" over the line in the direction of moving. Here's the code for moving up: (defun on-ctrl-shift-...
MatX's user avatar
  • 1
0 votes
1 answer
34 views

Exporting disjoint parts of Org document with marks

I am interested in exporting disjoint sections of my Org document via setting marks, as I find them most convenient. I am aware of the :export and :noexport tags, but seeing as how I have to ...
daedsidog's user avatar
  • 157
1 vote
2 answers
55 views

Why did C-SPC and C-M-SPC suddenly stopped working while M-h still works?

I have been comfortably using Emacs in MacOS 13.4.1 (M1 architecture) for a while. However, a few days ago, using the default keybinding of C-SPC for set-mark-command simply stopped working. Same for ...
Pedro Delfino's user avatar
0 votes
0 answers
21 views

Making global marks behave like in VIM

So, currently in Spacemacs, if i put mark on numbers or capital letters, mark is still local to the active buffer. In VIm, if you mark with said selection of characters, it will become a global mark ...
Matthey969's user avatar
0 votes
2 answers
54 views

How to mark and execute multiple table formula expressions to update an org table at once?

Suppose I have this org-mode table: | Ativo | Valor R$ | % Percentual | |-------+----------+--------------| | A | 13.0 | 0.1300 | | B | 33.0 | 0.3300 | | C | 54.0 | ...
Pedro Delfino's user avatar
0 votes
0 answers
27 views

`run-python` cannot hide *Python* buffer

When running (defun my/run-python () (interactive) (let ((buf (current-buffer))) (with-current-buffer buf (save-mark-and-excursion (run-python (python-shell-calculate-...
phoxd's user avatar
  • 231
1 vote
1 answer
258 views

How can I mark everything within brackets, quotes, etc.?

Please dont suggest expand-region. It regularly expands onto symbols which I don't intend to mark. I am looking for a way instead to simply mark all the text within matching delimiters.
CD86's user avatar
  • 543
2 votes
1 answer
102 views

How to make comment-dwim comment out the current line when there is no active region?

This question is about changing the behavior of comment-dwim when no active region is defined. The current behavior is defined below (from C-h k), which is kind of complicated and not what doing what ...
tinlyx's user avatar
  • 1,314
2 votes
4 answers
428 views

How to count the number of characters in the marked (selected) region?

I know how to count the number of words. How to count the number of characters in the marked (selected) region?
Pedro Delfino's user avatar
0 votes
1 answer
65 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 ...
Shahin's user avatar
  • 131
2 votes
2 answers
91 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/...
John Doe's user avatar
  • 169
3 votes
1 answer
185 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 ...
Pedro Delfino's user avatar
1 vote
1 answer
212 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 ...
tinlyx's user avatar
  • 1,314
2 votes
1 answer
52 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: ...
unvarnished's user avatar
0 votes
1 answer
186 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 ...
Edman's user avatar
  • 1,177
1 vote
0 answers
101 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?
Edman's user avatar
  • 1,177
1 vote
1 answer
146 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. ...
jsteinbach's user avatar
-1 votes
1 answer
153 views

mark-sexp (Wrong number of arguments)

((foo(bar)) ...
Jason Hunter's user avatar
0 votes
1 answer
71 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 ...
LUD's user avatar
  • 1
6 votes
2 answers
756 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 ...
Sake's user avatar
  • 325
0 votes
0 answers
128 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?
ideasman42's user avatar
  • 8,546
1 vote
1 answer
281 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-...
kdb's user avatar
  • 1,561
1 vote
2 answers
612 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 ...
Wizard's user avatar
  • 1,241
0 votes
0 answers
239 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 ...
Saurabh's user avatar
  • 211
1 vote
1 answer
128 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 ...
Sati's user avatar
  • 775
3 votes
1 answer
78 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, ...
ryan's user avatar
  • 47
4 votes
1 answer
444 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 ...
azzamsa's user avatar
  • 634
1 vote
0 answers
154 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 ...
Evan Aad's user avatar
  • 1,511
-1 votes
2 answers
327 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 ...
Joseph Morag's user avatar
0 votes
1 answer
72 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 ...
Reb.Cabin's user avatar
  • 711
2 votes
1 answer
218 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")) "...
Teemu Leisti's user avatar
1 vote
1 answer
68 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 ...
Arch Stanton's user avatar
  • 1,575
5 votes
0 answers
53 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 ...
soegaard's user avatar
  • 151
2 votes
1 answer
108 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 ...
Alien Life Form's user avatar
1 vote
1 answer
72 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 ...
jcarpenter2's user avatar
0 votes
1 answer
149 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 ...
smilingbuddha's user avatar
0 votes
0 answers
66 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-...
Gabriele Nicolardi's user avatar
2 votes
1 answer
217 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 ...
Charlie Martin's user avatar
1 vote
1 answer
241 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 ...
sandric's user avatar
  • 1,251
0 votes
1 answer
169 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 ...
Att Righ's user avatar
  • 745
10 votes
6 answers
11k 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 ...
Peter Hwang's user avatar
1 vote
2 answers
135 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 ...
thnx-236659's user avatar
1 vote
1 answer
344 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 ...
eflanigan00's user avatar
0 votes
2 answers
88 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 ...
Mathieu Marques's 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 ...
m33lky's user avatar
  • 297
1 vote
2 answers
259 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 ...
HippoMan's user avatar
  • 594
3 votes
1 answer
249 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-...
std_answ's user avatar
  • 191
3 votes
2 answers
559 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. ...
Kabali's user avatar
  • 31
7 votes
3 answers
2k 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 ...
rl1's user avatar
  • 346
3 votes
1 answer
436 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?
zeltak's user avatar
  • 1,695