Questions tagged [words]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
10
votes
3answers
1k 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 ...
7
votes
5answers
5k 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 ...
4
votes
3answers
281 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/...
3
votes
4answers
2k 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 ...
3
votes
3answers
277 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 ...
3
votes
1answer
392 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 ...
3
votes
2answers
649 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) ...
3
votes
2answers
295 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 ...
3
votes
1answer
39 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 ...
3
votes
1answer
627 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 ...
2
votes
2answers
780 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 ...
2
votes
1answer
146 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 ...
2
votes
2answers
120 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 ...
2
votes
2answers
195 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 ...
2
votes
1answer
740 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 ...
2
votes
0answers
521 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 ...
2
votes
0answers
357 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 ...
1
vote
2answers
71 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 ...
1
vote
1answer
257 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 ...
1
vote
1answer
94 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 ...
1
vote
1answer
156 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 ...
1
vote
1answer
55 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 ...
1
vote
1answer
23 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, ...
1
vote
1answer
84 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.
1
vote
2answers
112 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 ...
1
vote
2answers
121 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 ...
1
vote
0answers
54 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-...
1
vote
0answers
29 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 ...
0
votes
2answers
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 ...
0
votes
1answer
86 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 ...
0
votes
1answer
85 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 ...
0
votes
0answers
90 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 ...