Questions tagged [text-editing]

Questions about editing or manipulating text inside of Emacs.

Filter by
Sorted by
Tagged with
0
votes
1answer
71 views

Why emacs loses its config settings when editing tex files

I'm facing a rather peculiar situation where my emacs settings seem to be lost every time that I open a .tex file. That's doesn't happen when I'm editing .el or .py files. Heres some examples with ...
0
votes
1answer
33 views

Punctuation abbrevs for writing prose, and automatic full stops at the end of line?

I'm a beginner Emacs user, and English isn't my first language so please bear with me. I use Emacs for writing prose, and I need help with punctuation. To put it short, I want to turn this: --hello ...
3
votes
1answer
148 views

How remove lines which are not equal in two buffers?

Consider the following buffers buffer_1: 11111111 22222222 33333333 44444444 buffer_2: 55555555 66666666 22222222 44444444 I need to remove all lines which are not equal in buffer_1 and buffer_2. ...
1
vote
1answer
28 views

Replace placeholder by incremental value [duplicate]

Windows 10 Emacs 26.1 I has the next text [ { "id": N, "name": "Agent#N", "address": "N Tabernacle St, London EC2A 4DD, UK" }, { "id": N, "name": "Agent#N", "address": "...
7
votes
1answer
224 views

Increment days / months / dates, etc. within buffer

In a text document, while editing, I often need to increment/ decrement calendar data. So, Friday will need to become Monday, December will need to become March, etc. Or 28 Apr after adding 5 will ...
0
votes
1answer
82 views

ryo-modal defining keybind jump a word and insert character

I'm using the ryo-modal package that enables you to define your own keys in modal editing. I'm trying to makemf move the cursor to the end of the word, insert a whitespace and then exit the modal mode....
10
votes
3answers
392 views

Editing multiple source blocks in one buffer

I've got multiple source blocks which are all tangled to the same file. When I invoke C-c ' inside one block, only this specific block is shown in a new buffer. Is there a possibility to show all ...
0
votes
0answers
31 views

Edit a portion of YAML file (a multi-line string) with a different mode

I'm constantly editing a big yaml file with many multi-line strings, which are BASH scripts. In org-mode I would use something like: #+begin_src sh echo "cool" #+end_src And then just to C-c ' (org-...
3
votes
3answers
101 views

Is it possible to shuffle paragraphs?

I'd like to be able to quickly "shuffle" the order in which all paragraphs in a region occur. Can this be easily accomplished in emacs? For example, consider the following region. Hello world. This ...
1
vote
0answers
26 views

fixed file size mode

Is there an emacs mode/package/whatever where a specific file size (and/or number of lines) is enforced in a visual way? Something like this: 1st line 2nd line where adding some text to the 2nd ...
1
vote
1answer
43 views

Dual-language text mode using the original interpretation of tabs

Does there exist an Emacs mode that replaces the contemporary interpretation of tabs (move to 8, 16, 24, .. or a multiple of some constant) with their original typewriter interpretation (set stops at ...
0
votes
1answer
32 views

smartparens how to stop behaviour of inserting backslash \ before I type a single quote '

I'm in C major mode, editing source files. Whenever I want to type a single quote ' smartparens automatically gives me the following: \'|\' , where | is the cursor position. What I want exactly is ...
3
votes
2answers
131 views

kill the current line and preserving cursor position

I'm using the slick-cut function (as answered here by itsjeyd) for killing the entire line with minimal keystrokes. It's defined like so :- (defun slick-cut (beg end) (interactive (if mark-...
7
votes
3answers
60 views

How to blockquote text in one go

With this text: Play with it a few times you will see my point. The command you need is: $ echo hello How do I make it into: > Play with it a few times you will see my point. The > command ...
0
votes
4answers
153 views

Can someone recommend a good text editor for Emacs? [closed]

I'm looking for a good way to edit text within Emacs. Can someone give some good recommendations for text-editors for Emacs.
6
votes
1answer
195 views

How do I delete all blank lines in a buffer? [duplicate]

Emacs 26.1 In buffer 1 2 3 4 I use command "delete-blank-lines". But it NOT delete ALL BLANK LINES. It's delete ONLY ONE BLANK LINE. Why? I need to delete ALL BLANK LINES. The result must be ...
5
votes
1answer
891 views

Drag selected text with the mouse

In many editors it is standard to move selected text by dragging and dropping it with the mouse. In emacs dragging selection with the mouse starts a new selection by default. This is extremely ...
4
votes
4answers
1k views

How to add a suffix to every line of a text?

Windows 10, Emacs 25.1 Suppose I have the following text (about 100 rows): ic_m_sales ic_m_activity_report ic_m_messanges ic_m_products_name ic_m_change_store ic_m_faq ... How ...
13
votes
1answer
2k views

How to edit crontab directly within emacs when I already have emacs open?

I know I can set the EDITOR variable and edit my crontab with emacs but that requires starting the process from a shell with $ crontab -e My question is how can I directly modify my crontab if I'm ...
0
votes
1answer
38 views

Stop automatic removal of space before point when inserting `.` (dot)

The following gif shows the behaviour quite nicely: Whenever I type a space followed by a dot (.) in any mode derived from text-mode, emacs will replace the space with the dot. I could not want this ...
32
votes
10answers
7k views

Kill or copy current line with minimal keystrokes

I do C-a C-k C-k to kill the entire line point is on. If I want to copy the line instead of killing it, I can hit C-/ C-/ right after typing the sequence above. Alternatively, I can do C-a C-SPC C-...
1
vote
0answers
35 views

Quoting selected text using email conventions?

Is there any existing elisp function which will quote any selected text using email quoting conventions? For example, suppose the following text appears in a buffer ... This is some text that I want ...
2
votes
2answers
115 views

How keep only duplicate lines?

Emacs 26.1. Windows 10 In buffer I has text like this: 3333333 1111111 $PAC_LTC 1337_BTC 1337_LTC 404_BTC 42_BTC 222222 42_LTC 808_ETH 8BIT_BTC ...
11
votes
3answers
1k views

How to transpose two arguments of a function in Python?

How I can I swap two arguments in a call to a Python function? If I put point on the space between these two arguments: self.assertEqual(json.loads(some.data), json_data) and then M-t (transpose-...
0
votes
1answer
84 views

Why after save *Occur* buffer I can't edit editable file? [duplicate]

Emacs 26.1, Windows 10 (64 bit) I open file trace.log. User occur to find text. Save occur buffer to file NXS_ETH.txt. Do some manipulations. See screenshots. But I can't edit EDITABLE file. Here ...
6
votes
3answers
175 views

What is the difference between refill-mode and auto-fill-mode in emacs?

I swear I tried to read documentations, but in practice, I could not tell the difference. I feel they are doing the same thing. I can turn both modes on, but I am not sure in what circumstance I need ...
1
vote
1answer
47 views

Turn array from one-line into element-per-line

Say I have PHP array like this: $arr = ['one', 'two', 'three']; and I want to convert it to $arr = [ 'one', 'two', 'three' ]; real quick. Is there any ready to use soluions?
2
votes
2answers
70 views

Result of math. operation - replace math. formula

If I want to do some math. operation I do next: (* 5 3) C-x C-e (eval-last-sexp) Here result: As you can see the result is in the minibuffer. Nice. But I need result to REPLACE math. formula. I ...
4
votes
1answer
50 views

Compose characters

I have some copied text from a pdf which renders like this with my current font: I know I could use a different font that handles Unicode characters better, but I would rather find a function to ...
3
votes
5answers
546 views

How to swap strings in all lines?

Emacs 26.1 I have this text: "ADA-SGD" "ADT-SGD" "ADX-SGD" "AID-SGD" "AMP-SGD" "ANT-SGD" "ARDR-SGD" "ARK-SGD" I want to swap text in all these lines. The result must be like this: "SGD-ADA" "SGD-...
1
vote
0answers
18 views

Why I can't delete first line after save *occur* buffer to separate file? [duplicate]

Windows 10, Emacs 26.1 I have file - file_first.txt: I want to find all line content word hello. So I use occur for this Nice. Now I want to save result to SEPARATE file: file_second.txt To do ...
4
votes
2answers
142 views

Next word prediction

Autocomplete and company completes the word . But is there any package which helps predict the next word expected in the sentence.
0
votes
1answer
38 views

How to combine change `key: foo`, `key: bar`, `key: baz` to `key: foo bar baz`?

To clarify this is what I'd like to do: Text Before: key: foo key: bar key: baz Text After: key: foo bar baz Wondering if anyone has a good technique for this type of operation (simpler the ...
1
vote
0answers
53 views

Align elements of a matrix to the right

I have a matrix in C++ Matrix<double> A = { {31, -13, 0, 0, 0, -10, 0, 0, 0}, {-13, 35, -9, 0, -11, 0, 0, 0, 0}, {0, -9, 31, -10, 0, 0, 0, 0, 0}, {0, 0, -10, 79, -30, 0, 0, 0, -...
1
vote
0answers
270 views

how to convert camel case to snake case with vanilla emacs

When editing for example a ruby file, can't emacs toggle CamelCase to snake_case out of the box? Example ruby file def SecDecGov puts "abort" end
9
votes
1answer
676 views

unicode.txt slowness

Moving around point (using the cursor keys) in Xah’s unicode.txt in fundamental-mode is noticeably slower than in an ordinary text file. Are the many non-ASCII characters the issue? Anything else? ...
0
votes
1answer
363 views

Remove linebreak arrow and move last word to next line

When I write text in the emacs editor and the text reaches the right border of the program, emacs continues on the next line and puts an arrow on both sides of its borders. I want to know if its ...
2
votes
3answers
143 views

Reorder function definitions in a file

Adapting to a rather functional programming style, I often end up with files consisting of a lot of individual function definitions. Oftentimes, I then decide at some later point that I want to ...
1
vote
1answer
62 views

In-sync editing the same file in two frames

For a lecture, I'll have a setup with two frames (one on my notebooks's screen, the other on the projector) showing the same file. When editing the file in the "master" frame I need the "slave" frame ...
5
votes
1answer
146 views

Edit simultaneously many buffers and save all of them after edit

Windows 10, Emacs 25.1, Helm I open 3 different files: I need: Edit simultaneously all buffers. Add text "customer/" to the node "bodyFileName"in all buffers. After edit save all buffers, Here ...
0
votes
1answer
287 views

In Spacemacs, how can I conditionally set line-wrapping on only for text files (i.e. in text mode)?

I want to have Spacemacs wrap around long lines, but only in text files (i.e. text mode), not in programming language files (i.e. program mode). How could one achieve that? I know that to turn on ...
0
votes
1answer
48 views

How to trim text on each line, starting with the first space

Windows 10, Emacs 25.1 Suppose I has text: Advertisment d184f52a-14d7-dddddddddd ZAnelik 1c970d12-6c67-44e1-cccccccccccc Avers b0f0dd6b-a43f-4e40-b0ebbbbbbbbb BAVERS_MIGOM_OLD ...
0
votes
1answer
606 views

How to use an ispell dictionary in company mode?

I am writing in LaTeX at the moment and I want to use company-mode for word completion. I found this solution: https://emacs.stackexchange.com/a/18522. I was thinking about using the ispell ...
0
votes
1answer
50 views

How remove all rows contain specific text?

Windows 10, Emacs 25.1 Suppose I has the next text 111111111111111111 hello 22222222 aaaahello 3333333333333333333333333333333 aabbbbbbbbhellocccccdddddddd aaaaaaaaaaaaaaa cccccccccccccccc ...
0
votes
0answers
18 views

reshape one column text of n rows into into m columns of n/m rows

I have tried the following function (defun test3 (size column cnt) (interactive "p") (if (eq cnt 0) (progn (setq start (point)) (forward-line (- (/ size column) 1)) ...
0
votes
1answer
88 views

pressing return in paragraph-indent-text-mode deletes whitespace indenting beginning of paragraph

I'm currently using emacs 25.3 on Mac OSX installed using Homebrew, and without any modifications in my .emacs file or anywhere else. I think I may be fundamentally misunderstanding what paragraph-...
1
vote
2answers
65 views

Writing a small elisp function

Could someone here write a small Elisp function for me? What I would like Emacs to do is the following: I have a region like this: [0.04579] [0.06569] [0.09507] [0.12696] [0.27929] [0....
3
votes
1answer
576 views

Printing/exporting to PDF from text-mode

I have been googling and searching for the answer to this question for a while but cannot find a definitive solution. In fact I am more confused than ever. I have no doubt that I am not the first ...
58
votes
5answers
6k views

What options are there for writing better non-programming text in Emacs?

This is a fork from the question What options are there for doing spell-checking in Emacs? Because I'm currently doing a lot of non-programming tasks in Emacs I'm wondering whether Emacs can support ...
5
votes
2answers
716 views

Incrementing characters in Emacs, next to numbers?

You can place a pointer on a number, like 1, and increment it to 2. There are many alternatives on this. See also the Emacs Wiki: https://www.emacswiki.org/emacs/IncrementNumber 7 alternatives to ...