Questions tagged [text]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
27 views

Surround a line with slashes

So, I am writing a function to italize/unitalize the current line (without the surrounding blanks) by surrounding it with slashes /. (defun my-italize-line-dwim () (interactive) (save-...
2
votes
2answers
74 views

How convert text to hex value?

I has some sybmol, e.g. O and I want to convert it to hex value. The result must be 4f How I can do this in Emacs 26.1 ?
1
vote
1answer
31 views

Generate different uuid in every line?

I need to replace guid_here by different uuid. provider [guid_here] [guid_here] provider test again [guid_here] test again2 [guid_here] test [guid_here] again2 I use this approach. Install package ...
1
vote
2answers
91 views

How check that text in quotes are lowercase text

example1: test "one" hi this is test "two" check I need to "three" this example2: test "one" hi this is test "Two" check I need to "three" this Is it possible to check that text (some function) in ...
3
votes
1answer
138 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. ...
3
votes
1answer
153 views

regexp: exclude repeated characters for highlight - hi-lock-mode

I want to search using regexp to capture plain text. I want to capture passages that begin with opening quotation marks and end at the end of the paragraph, and even though the quote continues onto a ...
1
vote
2answers
32 views

How show (filter) only text lines with all uppercase chars?

Suppose I has the next text: test HELLO help HOW ARE YOU buy I need to get (filter) only text lines with all uppercase chars. So result must be like this: HELLO HOW ARE YOU
1
vote
2answers
61 views

Count the number of paragraphs

There are plenty of ways to count lines, words, and characters in Emacs. For instance, invoking M-= (AKA count-words-region) does that very thing on a given region. However, I am having trouble ...
0
votes
4answers
248 views

How remove whitespaces in the beginning of lines?

Emacs 26.1 I has the next text: I need to remove all whitespaces in the beginning of the lines. Every line has different count of whitespaces. The result must be like this:
4
votes
1answer
83 views

Width of string as if it were displayed

From the documentation of string-width string: This function returns the width in columns of the string string, if it were displayed in the current buffer and the selected window. For me this ...
4
votes
2answers
70 views

Is there a function in emacs that centers an input text and fills the line with the comment symbol as one would use it for headings in a file?

I want to have a quick way of writing a heading in an arbitrary file. So in Emacs-lisp mode the selction of Heading in a file and a call of the function would result in: ;;;;;;;;;;;;;;;;;;;; Heading ;...
2
votes
1answer
30 views

turn coherent string into individual characters

I have a text with a number of coherent strings, e.g.: ax923fasd asidna1 xxa008 Is there a quick way to convert these so that there be a space between each of them, i.e.: a x 9 2 3 f a s d a s i d ...
1
vote
0answers
85 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
1answer
36 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 ...
1
vote
2answers
155 views

Find and replace a text among the files of a project

How can I do a "find and replace a string" in the files of a project? Is there a standard, built-in way?
1
vote
1answer
36 views

What is the mode or the command to selectively display selected region?

There seems to be a command to display only the text in the selected region, leaving the rest of the text hidden. What is the command?
0
votes
0answers
43 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\...
2
votes
1answer
449 views

org-mode how to export raw text no formatting?

Any quick way to export an org-mode document into a text file with no formatting and no org markup characters? I am aware of C-c C-e [t] Export to Plain Text unfortunatly those options add formatting ...
1
vote
1answer
306 views

Elisp search and delete

Interspersed in a text file I have 0:36Skip to 0 minutes and 36 seconds blah blah, always at the beginning of a line. I am looking for a function to search and delete these. Failing, I have (defun ...
4
votes
1answer
69 views

Clone content in another part of document?

Is it possible to clone a part of a document in another part of the document? So that changing one, changes both?
0
votes
1answer
477 views

Calculating the length of a line in a buffer

Simple question, I think: How can I calculate the length of a line in emacs lisp? It seems like there should be a function for this, but I can't find it. What I'm using right now is something like ...
3
votes
2answers
316 views

Convert a word into an acronym

I have a buffer with this line of text: This is a random test I want to convert test in T.E.S.T., like this: This is a random T.E.S.T. So far, I came up with this function: (defun mu-convert-...
22
votes
3answers
1k views

Fixing DOuble CApitals as I type

I have a bit of a slow pinky. As my other fingers get faster and faster at typing, my pinky just can't keep up. This frequently leads me to type sentences whose first word starts with two uppercase ...
7
votes
2answers
677 views

How to obtain the statistic of the the frequency of words in a buffer

For linguists and many other scientists, analyzing the frequency of the words appearing in a text is an great tool. Some commercial text editors and some websites provide this tool. The word ...
5
votes
1answer
64 views

Is there a built-in or package solution for managing references in text files?

I'm currently writing up a design document and I want to include a number of references to external documents/URLs. I can manually add reference brackets and links so that: See the external file blah....
2
votes
1answer
523 views

Always view *.pdb files as text file

I frequently work with Protein Data Bank files. These are text files that contain atomic level structure information of molecules. They can be recognized by their '.pdb' extension. Whenever editing ...
4
votes
1answer
884 views

Turn off fringes in text-mode

How do I turn off fringes in text-mode? The closest I've gotten is this: (add-hook 'text-mode-hook (lambda () (set-fringe-mode '(0 . 0)))) But that turns off fringes ...
4
votes
1answer
250 views

How to obtain the statistics of the frequency of characters in a buffer

Are there some Emacs' packages which can be used for analysing the frequency of the characters and the words used in the current buffer. As a particular example it would be interesting to have a ...
1
vote
1answer
94 views

Why don't insert-in-front-hooks run?

Open a scratch buffer, paste the following an evaluate it: (insert (propertize "hello" 'insert-in-front-hooks (list (lambda (&rest unused) (message "test"))))) Typing ...
1
vote
1answer
167 views

Green lines are invisible in diff output for some files in *shell*

I use Emacs a lot including for most terminal sessions. One of activities includes typing git commands inside a shell buffer. I found a very interesting color puzzle. After downloading forked ...
4
votes
2answers
123 views

Hi-lighting common grammar mistakes in all prose across modes with English text

I already make extensive use of flyspell-mode to keep my errant spelling in check. However I'm currently trying to break the bad habit of using "it's" for possessive statements. I've had a brief look ...
56
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 ...
10
votes
1answer
207 views

Recognizing sentences that don't end in two spaces

I'm not going to weigh in on whether ending sentences with two spaces is the One True Way or an abomination. All I know is that I show no signs of establishing a consistent habit of hitting the ...