2022 Developer Survey is open! Take survey.

Questions tagged [words]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
39 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 ...
user avatar
  • 159
2 votes
1 answer
60 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 ...
user avatar
0 votes
1 answer
29 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 ...
user avatar
  • 101
2 votes
1 answer
84 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 ...
user avatar
  • 23
2 votes
3 answers
170 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 ...
user avatar
0 votes
1 answer
30 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{...
user avatar
2 votes
2 answers
93 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 ...
user avatar
2 votes
2 answers
112 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) ...
user avatar
0 votes
1 answer
27 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 ...
user avatar
  • 419
3 votes
1 answer
169 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-...
user avatar
  • 31
0 votes
1 answer
67 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.
user avatar
1 vote
1 answer
53 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 ...
user avatar
1 vote
1 answer
76 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 ...
user avatar
  • 1,102
1 vote
1 answer
814 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 ...
user avatar
  • 2,717
1 vote
1 answer
67 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 ...
user avatar
  • 1,668
2 votes
3 answers
707 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 ...
user avatar
1 vote
1 answer
69 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, ...
user avatar
  • 21
1 vote
2 answers
445 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 ...
user avatar
  • 1,668
6 votes
3 answers
853 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 ...
user avatar
3 votes
1 answer
40 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 ...
user avatar
1 vote
2 answers
127 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 ...
user avatar
0 votes
1 answer
120 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 ...
user avatar
  • 123
3 votes
1 answer
607 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 ...
user avatar
  • 199
1 vote
1 answer
116 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.
user avatar
1 vote
2 answers
169 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 ...
user avatar
2 votes
2 answers
1k 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 ...
user avatar
3 votes
2 answers
205 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 ...
user avatar
9 votes
5 answers
9k 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 ...
user avatar
2 votes
2 answers
205 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 ...
user avatar
1 vote
0 answers
56 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-...
user avatar
4 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) ...
user avatar
  • 43
3 votes
1 answer
914 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 ...
user avatar
  • 49
2 votes
0 answers
632 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 ...
user avatar
14 votes
3 answers
2k 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 ...
user avatar
  • 787
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 ...
user avatar
1 vote
2 answers
182 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 ...
user avatar
  • 17.6k
3 votes
1 answer
405 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 ...
user avatar
  • 1,517
1 vote
1 answer
197 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 ...
user avatar
  • 373
3 votes
2 answers
444 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 ...
user avatar
  • 1,887
2 votes
0 answers
502 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 ...
user avatar
  • 7,284
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 ...
user avatar
  • 7,284
2 votes
1 answer
246 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 ...
user avatar
  • 1,073
3 votes
4 answers
3k views

A quick way to copy the word before the cursor

By M-backspace (or by M-x backward-kill-word), I can remove the word before the cursor. Is there a built-in equivalent of this command for copying instead of deleting? Obviously one can do M-x ...
user avatar
  • 7,284
4 votes
3 answers
408 views

Is is possible to treat any symbol in the buffer as word when moving around?

When I move around specifically using M-f/b, I want to treat any symbol such as ", ', ., -, _, ?, !, *... as one word, so M-f/b will move around them instead of skipping them and jump to the next/...
user avatar
  • 2,559
1 vote
2 answers
2k views

how to search and replace an entire word?

I know the command isearch-forward-word, but there doesn't seem to be an isearch-replace-word. I'd like to search and replace every instance of a certain word in a buffer. For instance, search for ...
user avatar