Questions tagged [words]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
52 views

define a new evil command

I'm trying to reverse some words, and I have it set up where I can visually select them and hit ,rw to reverse them. How do I set it up so ,rw also works with a motion. E.g. ,rw3w to reverse 3 words? ...
Zaz's user avatar
  • 123
1 vote
2 answers
99 views

How to exclude whole headings and their contents from word counting

For certain articles, one does not need certain sections to be counted in the final word count. How to signal this in an Orgmode buffer? Perhaps there is a tag or similar feature to do this on the ...
Emmanuel Goldstein's user avatar
2 votes
1 answer
105 views

How to get emacs count text words only without counting words in comments, code blocks, and markups in markdown?

Publishers set a word count limit you have to meet in writing a manuscirpt. I am trying to write up the manuscript using markdown in emacs. Consider the example below. MWE # Results {-} ## Topic 1 {-}...
doctorate's user avatar
  • 1,799
0 votes
1 answer
36 views

Why do Emacs Lisp regular expressions match the percentage and dollar sign as word characters?

I ran into this behavior by accident and it seems quite unusual to me. Why do Emacs Lisp regular expressions match the percentage and dollar sign as word characters? One theory I had was that this is ...
fap's user avatar
  • 141
0 votes
0 answers
26 views

Getting Magit to Show Word Count Diff

I'm aware that by setting (setq magit-diff-refine-hunk 'all) we can get magit to show the words added/changed: Question: Is there a way to force the display the total number of words added, total ...
George's user avatar
  • 879
0 votes
1 answer
41 views

Capturing the next N words and elements

I want to do two things. Starting at point, get the next N words and store them in a list. Starting at point, get the next N elements (any isolated text sequence) and store them in a list.
Dilna's user avatar
  • 1,183
-2 votes
6 answers
138 views

How do I break a large piece of text in to a list of 5-word phrases, and identify the oft-repeated phrases [closed]

I would like a function that finds repeating sequences of text sections. Would start with defining a number N. Let I have (setq N 5) say. I would take the first five text sections, then look for ...
Dilna's user avatar
  • 1,183
-3 votes
1 answer
28 views

Taking word at point interactively

I would like to adapt this function for the interactive case, that takes the word at point. (defun rules-tablet (word) "Shorten word at point according to specific rules." (interactive) ...
Dilna's user avatar
  • 1,183
1 vote
1 answer
51 views

Sorting counts in descending order

Have the following code that counts the number of times words are used. I want to list the results sorted by the number of counts. (defun rk-word-analysis (reg-beg reg-end) "Count ...
Dilna's user avatar
  • 1,183
2 votes
1 answer
201 views

How to match two consecutive identical words except for the case of the initial characters?

I'm looking for a solution to match two consecutive identical words except for the case of the initial characters with query-replace-regexp: The the the The I can't figure out how to match these ...
Onner Irotsab's user avatar
0 votes
1 answer
49 views

Find and recursively delete (with query) consecutive duplicate words not necessarily in the same line and/or same case

I would like to scan through a (latex) document and recursively delete -- WITH QUERY -- all consecutive, repeated words that need not be on the same line and/or the same case. Here is a simple ...
underflow's user avatar
  • 111
2 votes
1 answer
164 views

Count words under subtree ignoring the properties drawer and the subheading

How can we count the number of words inside a heading? (excluding the properties drawer and the actual heading title) An example: **Answer :PROPERTIES: :ID: <guid> :END: This is some text here ...
mon's user avatar
  • 23
2 votes
3 answers
435 views

Is there a command to wrap a characters in a word using Emacs? Or something to insert "/" around a word while using org-mode?

In org-mode, writing a word wrapped by / makes it italic. For instance, /word/ becomes word. Is there a command in Emacs to make something go from ẁord to /word/? Maybe some org related command only ...
Pedro Delfino's user avatar
0 votes
1 answer
37 views

evil mode: delete word starting with backslash leaves the last character

I am using evil mode. In org-mode files, when I try to delete a word with dw and the word starts with a \, the last letter of the word is not deleted. For example, if my cursor is on the b of \begin{...
Anthony Scemama's user avatar
2 votes
2 answers
150 views

I want when "C-w" is pressed, execute delete-backward-char when no region is selected and kill-region when the region is selected

Similarly, I want to delete word backward when C-u C-w is pressed. I would also value recommendation on cut/paste/kill conventions. I tried to bind C-w to delete-backward-char, but kill-region stopped ...
deepanshu's user avatar
  • 141
3 votes
2 answers
251 views

Deleting words while preserving clipboard

Is there a way to keep the clipboard contents when deleting entire words with M-DEL? For instance, I'd like to delete a word (M-DEL) and then paste (C-y) what I had previously copied (with ctrl+c) ...
Ricky Robinson's user avatar
0 votes
1 answer
33 views

highlight occurences for thing under point also for substrings

With point over a word, pressing C-u C-s highlights this word and any identical words. How can I make this work for substring search as well, i.e. if highlighting the word house, occurrences of houses ...
CD86's user avatar
  • 543
4 votes
1 answer
313 views

How to change Emacs' word movement behaviour?

I want to do this on forward-word: (| shows the cursor position) Normal Behaviour: int main(int argc, char *args[]) { int a = 45|; printf|("%i", a); } What I want to do: //forward-...
shigi's user avatar
  • 41
0 votes
1 answer
182 views

Treat hyphens as part of a word?

I use: (global-superword-mode t) in my init.el because I don't want Emacs to treat _ as a word delimiter. How do I do the same thing for -? I'd like to enable this globally.
WickedJargon's user avatar
1 vote
1 answer
124 views

tools for camelcase and other means of word separation

Often I am involved with transforming text with one system of word separation (e.g., camelcase) into another system (e.g., hyphen separation, space separation, underscore separation. For example, if I ...
user3705389's user avatar
1 vote
1 answer
99 views

How to jump to backward found word when switched into reverse incremental search?

When I do I-search: or I-search-backward , it starts right away from the first word it find. Original behavior: word1 |[cursor]word1 ; cursor moves here ...
alper's user avatar
  • 1,238
1 vote
1 answer
962 views

How to regexp-search for a word surrounded by spaces

I'm looking at this One use of regexp-quote is to combine an exact string match with context described as a regular expression. For example, this searches for the string that is the value of ...
147pm's user avatar
  • 2,927
1 vote
1 answer
72 views

Emacs counts words incorrectly

Here is an interesting discovery. Copy the following text into a buffer: 'hello world' 'नमस्कार नमस्कार' One can see that there are four words, two on line 1 and two on line 2. Emacs count these as ...
deshmukh's user avatar
  • 1,852
2 votes
3 answers
1k views

Display word count in modeline without lag

Problem Stopped using wc-mode as it is not snappy anymore (as text writing usually is) with text document of 10k words. It appears that it counts the whole buffer after every change which seems to ...
Pandian Le's user avatar
1 vote
1 answer
101 views

forward-word and non-letter "words"

Using forward-word with this line: foo *** *** bar, I want to have the folowing behavior: foo| ***| ***| bar|, Not: foo| *** *** bar|, So, if between spaces there are only non-letter symbols, ...
A.King's user avatar
  • 53
1 vote
2 answers
626 views

Doom Emacs does not display wordcount

Running Doom Emacs 2.0.9. If I make a selection, I can see the word-count. This is as expected because doom-modeline-enable-word-count is set to t. However, I was expecting to see a word-count as I ...
deshmukh's user avatar
  • 1,852
6 votes
3 answers
1k views

Get Emacs to jump to the start of a word after isearch

If I use isearch to search for the word "accommodating" in my document, I have to type acc before the cursor jumps to the word. When I press enter the cursor is on the the second "c" as in ...
Edman's user avatar
  • 1,167
3 votes
1 answer
45 views

Viewing the number of words in org or text files in one of the details columns in Emacs Dired

Is there a way to display the number of words in org or text files in one of the details columns in Dired? This would save having to open each file individually and count the words by selecting the ...
Edman's user avatar
  • 1,167
2 votes
3 answers
183 views

Make isearch commands search only at the beginning of words

How to make C-s (isearch-forward) and C-r (isearch-backward) search only for words that start with the argument passed to them, instead of searching for the argument even if it's in the middle of a ...
Bite Bytes's user avatar
0 votes
1 answer
161 views

How to convert paragraph into the line?

I've need a function which convert a paragraph into the line, sort each space separated set of characters and fill it back to paragraph. In: Supposedly there are over one million words in the ...
Hellseher's user avatar
  • 123
4 votes
1 answer
702 views

Find and remove consecutive duplicated words while ignoring case

I am trying to find and remove duplicated words in a LaTeX file. Right now I am using query-replace-regexp with the regular expression \b\(\w+\)[ #]+\1 where # stands for line-break (C-q C-j). This ...
Tássio's user avatar
  • 209
1 vote
1 answer
131 views

English dictionary IPA or/and sound

I was wondering if one can look-up English words in Emacs from an English dictionary that includes IPA or plays a sound. I am using define-word.el package, which is very good but doesn't have IPA.
Arktik's user avatar
  • 932
1 vote
2 answers
217 views

how to make emacs think semicolon and brackets are words?

i've came on emacs from Sublime Text, and there ;[]{}()., etc are counts as word, and when you move in your document with Ctrl+Arrow you never skip these characters. I want make emacs recognize all ...
justicecurcian's user avatar
2 votes
2 answers
2k views

Split line every n characters

I have a long binary string that I would like to split every 32 characters. Is there a command that can do this for me? I have tried word wrapping, but it splits per word. It has no effect since a ...
Stewart Smith's user avatar
3 votes
2 answers
354 views

What is the best way to search forward/backward for a token?

Sometimes I want to search for a specific word but I don't want to find words which have my search string as a substring. For example, if I search for "pan" (bread, in Spanish), I don't want to find ...
pedrormjunior's user avatar
10 votes
6 answers
11k views

Best way to select a word

I want to select current word under the cursor without using mouse. After searching this forum, I learned how double click works. (I noticed that it is a bit complicated and there were no direct key ...
Peter Hwang's user avatar
2 votes
2 answers
211 views

Replace whole words in string

replace-string has the DELIMITED parameter, which can be used to replace only whole words. replace-in-string does not have such a parameter. Is there an easy work-around besides creating a temporary ...
AlwaysLearning's user avatar
1 vote
0 answers
57 views

Setting syntax table leads to high CPU load

I want to set - as a word character for all reStructuredText files. In order to do this, I acted according to the wiki and added the following to my .emacs file: (require 'misc) (defvar my-...
Zelphir Kaltstahl's user avatar
6 votes
2 answers
1k views

backward-kill-word kills too much, how to make it more intelligent?

I'm looking for a way to reduce what Emacs kills when I use backward-kill-word. protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) { if (PropertyChanged != null) ...
gvelasq's user avatar
  • 63
3 votes
1 answer
1k views

Fast/efficient way to keep a running word count

I am trying to implement a minor mode that displays in the modeline the current word count and the number of new words since the file was last opened. There are some existing implementations with ...
B. Bub's user avatar
  • 49
2 votes
0 answers
633 views

How to show word diffs in Magit? [duplicate]

Some people put one sentence or even one paragraph on one line. When someone fixes a spelling error in such a line it is difficult to spot the change in Magit log. How can I toggle Magit log to show ...
Wouter Beek's user avatar
16 votes
3 answers
3k views

Get word at point

It's a simple thing. My cursor is over a word and I want to get the word so that I can do something with it. I see a few different ways to do this but want to avoid reinvention and use a standard ...
deadghost's user avatar
  • 807
1 vote
0 answers
32 views

Word boundaries in mixed-alphabet words [duplicate]

By default (e.g., in fundamental mode), emacs seems to treat the sequence of characters abcαβγ in a buffer as two separate words. In particular, a command like M-f done at the beginning will only move ...
Guillaume Brunerie's user avatar
1 vote
2 answers
213 views

Toggle letter case -- exclude custom words from a list

Xah Lee wrote (some time ago) the following function that toggles the letter-case of the selected region or the current word. When toggling to initial caps, some words should not be capitalized such ...
lawlist's user avatar
  • 18.9k
3 votes
1 answer
500 views

Is there a way to set arbitrary characters as the word boundary?

I know I can do this kind of thing with the sentence boundary, using (setq sentence-end "[regexp]"), but how can I do this with the word boundary? I'd like to add capital letters to the default word ...
stacko's user avatar
  • 1,577
1 vote
1 answer
200 views

How to match only a word when using `re-search-backward` function

I want to replace a character inside a word, so I wrote: (setq regexp "[ab]") (and (re-search-backward regexp nil t 1) (replace-match "c")) This replaces a or b to c as I wish, but I want to ...
ironsand's user avatar
  • 403
3 votes
2 answers
515 views

Make forward-word not to jump over newline character

I have a text like this, testStatus['id'] = elt.$.id^^''&&&& testStatus$$['suite_id'] = "" where ^^ is my cursor position. When I press M-f, it uses forward-word and end up in the ...
Madhavan's user avatar
  • 1,957
2 votes
0 answers
663 views

How to go to the beginning of a word/sexp?

When the point is not at the beginning of a word/sexp, backward-word / backward-sexp places the cursor at the beginning of that word/sexp. If the point is already at the beginning of a word/sexp, this ...
Name's user avatar
  • 7,709
2 votes
1 answer
1k views

How to remove the duplicate words in Emacs?

One can find here various ways to remove all duplicate lines in Emacs by preserving the first occurrence. Also Emacs 24.4 introduces the command delete-duplicate-lines. I am wondering if there is a ...
Name's user avatar
  • 7,709
2 votes
1 answer
298 views

Is there a case aware way to select words?

Is there a way to select words respecting the case... camelCase, snakeCase... e.g.: i have a word "trullyAwesomeFunction" and cursor is on "w", is there an Emacs function I could use that would ...
iLemming's user avatar
  • 1,223