Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [text-editing]

Questions about editing or manipulating text inside of Emacs.

3
votes
1answer
125 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. ...
6
votes
3answers
40 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
128 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.
5
votes
1answer
136 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
37 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
94 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
39 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
61 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
47 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
47 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
455 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
90 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
35 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
32 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
44 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?
0
votes
0answers
112 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
39 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
30 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 ...
0
votes
0answers
18 views

“xah-find” not find and not replace

To find and replace text in files in folder I use package "xah-find". Here content of folder "/wiremock/_mapping/". lc_get_ad_notifications_merchant_mapping_response.json ...
5
votes
1answer
102 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
41 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
35 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
360 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
17 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
59 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
388 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
0answers
21 views

How to achieve this for a major-mode in Emacs

Sorry, not a searchable title. Wanna achieve a something slightly resembling abbrev-mode, like this: Type my(my+SPACE,SPACE was swallowed by stackexchange), then you type SPACE again, it'll expand to ...
0
votes
1answer
49 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
331 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
36 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
132 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
47 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
65 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
127 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
87 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
81 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
26 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
861 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
179 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
34 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
98 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
51 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
40 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) ...
2
votes
1answer
435 views

Prevent Emacs from overwriting text

In this example: If I add for example '0.5' where the cursor is, instead of adding '0.5' while moving the remaining text to the right, Emacs will delete the part '}{ckt1}' while adding '0.5'. Is it ...
0
votes
0answers
32 views

mirror/auto populate a section of text in another location in the same buffer/other file

Im looking for a way to to mirror/auto populate a section of text in another location in the same buffer and/or other file. for example, i manage my config files in org mode for multiple machines. i ...
0
votes
1answer
64 views

function to add/split a new line each time a dot (.) is present?

Im looking for a way (function) to add/split a new line each time a dot (.) is present? for example turn this When a user wants to communicate with the computer, the user interacts with an ...
1
vote
0answers
38 views

Tab or auto completion of command while editing a .tex file

Seeing if there is a way for auto or tab complete specifically while editing a .tex file. For example \text.... (tab or autocomplete) in some editors will allow you to quickly choose from '\textbf'...
2
votes
3answers
364 views

org - keyboard shortcut to promote text to heading

How to promote a text line to a heading in org-mode? ie: I start writing text and only later wants to structure it: here's a start typing some text. and continue on a 2nd line and even a 3rd line. ...
1
vote
1answer
557 views

How to permanently change the default spelling dictionary?

In Aquamacs, the Emacs for macs, the dictionary can be changed in the Menu by going to Edit -> Spelling -> Change Dictionary... In my case, I enter en_GB. How do I avoid doing this for every file ...