Stack Exchange Network

Stack Exchange network consists of 174 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 about editing or manipulating text inside of Emacs.

1
vote
1answer
31 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
23 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
13 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
80 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
30 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
22 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
34 views

company-ispell-dictionary does not load plain txt dictionary automatically

I tried following setup for text completion in company-mode that I found here https://emacs.stackexchange.com/a/18522/19743 (require 'company) (add-hook 'after-init-hook 'global-company-mode) (...
0
votes
1answer
145 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
14 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
57 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
188 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
20 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
23 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
86 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
33 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
90 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
29 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
0answers
24 views

How to use move-text in markdown-mode?

I use move-text to move lines up and down using M-up and M-down, but it doesn't work in markdown-mode, except in lists. Can I make it work for all text?
0
votes
1answer
32 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
112 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
65 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
60 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
25 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 ...
3
votes
2answers
581 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
138 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
29 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
61 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
47 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
35 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
233 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
22 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
53 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
26 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
176 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
267 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 ...
1
vote
1answer
76 views

Tracking instantaneous chages

is there any package that tracks changes made on an instantaneous basis? That is, just like handwriting captures edits, I would like to see all the changes as a buffer is developing. So, there is no ...
0
votes
1answer
143 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 ...
4
votes
0answers
264 views

Send a text from Emacs to Grammarly

Is there a nice way to bind Emacs and Grammarly. This is what I wrote to myself. A very simple plugin that helps you to send a marked text to Grammarly. It is a very simple plugin, is there a better ...
0
votes
0answers
53 views

Highlight code in Text mode

I'm a newcomer, I use emacs for less than a week, but I'm already familiar with the basics. I've started to use the Feynman Technique to study and I'm doing my annotations in Text-mode with auto-fill-...
1
vote
3answers
445 views

Insert the value of a variable into the buffer I'm editing

I asked How can I script emacs to install packages from list? and got this answer. (setq package-selected-packages '(async epl evil goto-chg helm helm-ag ...
0
votes
0answers
31 views

Is there a way to convert an array of bytes into a UTF-8 string?

There are now some files which contain raw bytes which are valid UTF-8 characters, e.g. a line of the file could be '@\u0915\u0941\u091b@ \u092c\u093f\u0902\u0926\u0941 \u0938\u095e\u0947\u0926 \u0939\...
6
votes
1answer
259 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? ...
1
vote
1answer
137 views

Binding a series of commands to a key

After a few trials and errors, I finally managed to find a series of customization for my Emacs to be the almost perfect distraction free environment. However, I don't want these settings to load ...
0
votes
1answer
23 views

Shift text after cursor to specified column

If I have a line like: vec3 pos; // May not be defined. And I want to shift the comment to a specific column number, say 27, such that I get: vec3 pos; // May not be defined. Is ...
4
votes
1answer
48 views

is there a `transpose-page` command?

Does Emacs or any packages provide a transpose-page command? I know the C-x [ and C-x ] and forward or backward page, but many times I just want to transpose two adjacent pages, especially when in ...
4
votes
3answers
107 views

What kinds of mistakes does transpose fix?

The only times I've ever found a use for transpose-words or transpose-chars is when I accidentally hit one of them unintentionally, in which case a backward-word followed by transpose-words again ...
2
votes
0answers
33 views

Is there a way to get copy & paste to be context-aware wrt whitespace and formatting?

When I copy a word and paste it at the end of an existing sentence (between the last word and the full stop), I'd like it to be pasted in such a way that the space between the pasted word and the ...
1
vote
0answers
75 views

Can I edit several files synchronously?

Emacs has the scroll-all-mode, which scrolls two buffers synchronously. I would like to edit about 8 files on 8 different hosts synchronously. This can be achieved by running vi in cssh. Is the ...
2
votes
1answer
110 views

Emacs - Lisp to parser text block to plantuml

Some document said emacs-lisp is more powerful than perl/Python to parser text file, but I still didn't see good example for reference. For example, if input below text block: 12-22 07:43:14.699 ...
4
votes
1answer
108 views

How can I execute a function every time I insert certain characters in the buffer?

I write a lot of text in German and English and I'm getting tired of switching the dictionary of my spell-checker all the time. In true Emacs spirit, I decided to do something about this and dusted ...