We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [text-editing]

Questions about editing or manipulating text inside of Emacs.

Filter by
Sorted by
Tagged with
0
votes
1answer
34 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 ...
0
votes
1answer
82 views

Why does emacs not apply some 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 ...
1
vote
1answer
32 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": "...
0
votes
0answers
33 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 ...
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 ...
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 ...
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. ...
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
155 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
198 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 ...
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 ...
2
votes
2answers
116 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 ...
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
176 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 ...
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
548 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
146 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
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
0answers
275 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
1
vote
1answer
63 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 ...
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 ...
5
votes
1answer
148 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
50 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
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
1answer
607 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
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)) ...
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
577 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 ...
0
votes
1answer
84 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....
0
votes
0answers
467 views

Can I “insert” a backspace character into a buffer?

I'm trying to tail the output from a command into a buffer, and I just learned that the command occasionally uses long strings of ^H to backspace over previous lines. Like, the command stdout will ...
0
votes
1answer
39 views

Wrap one line of text into a multiple line block

I have a very long line of text (8000 characters). I would like to format this nicely so it splits across multiple lines in a block. Where the line breaks occurs does not matter for this purpose. ...
3
votes
3answers
151 views

How to paste-then-copy?

I'm not sure whether anyone has ever implemented what I'm looking for, but maybe I'm just using the wrong terms to search for it. What I want to achieve is essentially a reverse copy and paste: I'm ...
2
votes
1answer
61 views

auto-loading ruler-mode while in text-mode

I have configured evolution to use Emacs for me to edit my replies to emails I receive. However, I need to limit my line length to around 72 characters to avoid the odd-ball line wrapping by the ...
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-...
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 ...
0
votes
2answers
110 views

Quick/electric text expansion

I've seen in some Emacs videos, the author would type #+BEGIN_SRC in their buffer, and emacs auto inserts #+END_SRC. Is this a feature I can "turn on" in vanilla Emacs? If not, which package can I ...
1
vote
0answers
103 views

Setting margins in `text-mode`

I use text files for most of my work. But for printing them on letterhead, I need to set margins to say 3 cm for upper margin and 2.5 cm for lower. Is there any way I can define them in text-mode. ...
0
votes
0answers
29 views

How do you remove the last few characters from all lines in a txt file in spacemacs?

How do you remove the last few characters from all lines in a text file? Example: 23193 123252 1 1238 123 1 34356363 11238080123 1 Should become: 23193 123252 1238 123 34356363 11238080123 I'm ...
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 ...
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
45 views

Swap text before and after “=” in properties file

Windows 10, Emacs 25.1 Suppose I have properties file: 1=10 2=BS.30 3=BS.20A Before "=" are numbers, but after "=" has any text(without spaces) I want to swap text before and after "=". So the ...
3
votes
1answer
148 views

Move selected sentence, word left/right by equivalent unit?

More broadly, should work by the selected semantic unit (incl. paragraphs in text mode, and the relevant units in other modes). I.e., if a sentence is selected, then the notional "move-left" would ...
0
votes
2answers
64 views

How do I track the number of lines added/deleted in an emacs session?

I am looking towards tracking the number of lines of text that I have added or removed in a session of emacs, is there any simple way to do this? If not what would be the right direction towards ...
0
votes
1answer
47 views

Yanking line copies past kill-ring lines along with current

I'm using Emacs to create text to copy to another program, but I need to copy line by line. I'm using a variation of kill-ring-save I provide below. (defun my-kill-ring-save () (interactive) ...