Questions tagged [text-editing]
Questions about editing or manipulating text inside of Emacs.
0
votes
1answer
27 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
48 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
44 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
42 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 ...
4
votes
5answers
431 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
16 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 ...
3
votes
2answers
70 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
30 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, -...
2
votes
1answer
42 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
71 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
37 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
26 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
15 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
92 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
38 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
29 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
47 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
272 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
15 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
302 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
41 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
249 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
35 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
118 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
41 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
31 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
57 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
124 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
81 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
71 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 ...
3
votes
2answers
696 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
170 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
32 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
83 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
48 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
38 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
353 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
29 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
61 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
34 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
294 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
454 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
87 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
200 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
348 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 ...
-1
votes
0answers
72 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-...