Questions tagged [region]
The text between the point and mark in a buffer.
171
questions
0
votes
0
answers
29
views
mark minor-mode
I'm searching for a minor mode that will let me mark positions and region coordinates to eventually generate a buffer of sed or awk script.
Is there already something that exist to do such a way of ...
0
votes
2
answers
50
views
How do I write a function to copy a region to the MacOS clipboard?
I'd like to be able to mark a region in a text buffer, hit an F-key, and have the contents of the region copied into the MacOS clipboard. From the shell you can do this by piping the text into the ...
0
votes
1
answer
24
views
How do I remove a protected region or line?
Apparently I cannot find the correct word for this problem. I tried searching for:
protected
non-editable
blocked
but none of those bring up anything.
I was writing some code when my cat jumped on my ...
0
votes
1
answer
51
views
alphanumeric sort of a region
Assuming your buffer content is similar to this:
x1_y1_text_x3_y1
x1_y1_text_x3_y10
x1_y1_text_x3_y11
x1_y1_text_x3_y12
x1_y1_text_x3_y2
x1_y1_text_x3_y3
x2_y1_text_x3_y20
....
how to get the region ...
0
votes
1
answer
43
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-...
0
votes
2
answers
74
views
How to select a noncontiguous region of arbitrary rows in a rectangle?
I can use Rectangle commands (https://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html) to operate over a text region.
What if I want to select text from columns COL to COL+4 over ...
1
vote
1
answer
41
views
function needed to replace short, static list of keywords
In my workflow I copy emails into an orgmode file. I'd like to have head of the email formatted. In english emails (just as an explanation) I'd like to have *To:* instead of To:, because orgmode then ...
1
vote
1
answer
80
views
How can a region matched by "string-match" be commented out with "comment-region"?
I have this code:
(when (string-match "^[ ]*\\\\usepackage{url}" (buffer-string))
(comment-region (match-beginning 0) (match-end 0)))
I tested it on these lines:
%% LaTeX file test
The ...
0
votes
1
answer
35
views
Promoting org mode headings in a region with a numeric prefix
Suppose I have a few org mode headings I would like to promote a few times
* Heading 1
* Heading 2
If I only wanted to demote these headings once, I could select both in a region and call org-...
1
vote
1
answer
83
views
Strange behaviour using C-<spc> to select multiple lines - first line is skipped if it starts with whitespace
EDIT:
The issue wasn't related to whitespace, rather it was my lack of understanding of how region selection works. The selected answer answers the question clearly.
I'm basically looking for the same ...
0
votes
1
answer
29
views
Highlight code between specified tags
how can I write extension for existing major mode, e.g. dart-mode to highlight block of codes. For example:
// $done>
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:ui';
...
0
votes
1
answer
34
views
Selecting phrases in Emacs rather than words or sentences
Notabene word processor has an interesting command that allows one to select phrases, i.e. one selects text up to the next punctuation mark.
Hence, in this example:
Lorem ipsum dolor sit amet, ...
2
votes
1
answer
179
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 ...
2
votes
1
answer
72
views
How to create buffer for custom source code region (e.g for each function)?
Objective :
Frame some areas in a source code file, with custom pattern (e.g "# - Name of Region - #"),
and then having the choice to type the name of region to directly open a buffer ...
0
votes
0
answers
116
views
format a region of text file with cc mode
I have a textfile.txt with content like the following
*decltype with two or more arguments
decltype does not take two arguments. Simply it can have an expression as its argument, and the comma ...