Skip to main content
Share Your Experience: Take the 2024 Developer Survey
5 votes
Accepted

alphabetic keyboard macro "counter"?

You can use the function kmacro-set-format, normally bound to C-x C-k C-f, to change the (printf-style) format used to insert the macro counter. You can set it to %c to treat the value of the macro ...
Omar's user avatar
  • 4,832
4 votes
Accepted

count-matches' result in kill-ring?

Assume you have two buffers: one with a list of strings to look for, one string per line, the other the buffer to search for the strings. Invoke this command in the buffer that lists the strings to ...
Drew's user avatar
  • 77.9k
4 votes
Accepted

How to count the number of characters in the marked (selected) region?

The command name count-words is a bit misleading. It shows the number of words. But, it also counts the number of lines and the number of characters. An output illustration: Region has 1 line, 51 ...
Pedro Delfino's user avatar
2 votes

How to count the number of characters in the marked (selected) region?

M-x region-length shows you the number of characters. It does this using: (abs (- (mark) (point)))
jagrg's user avatar
  • 3,944
2 votes

How to exclude whole headings and their contents from word counting

One option is to use the org-wc package. Then, you can exclude sections from counting by customizing org-wc-ignore-commented-trees and commenting out the sections using org-toggle-comment. Of course, ...
dalanicolai's user avatar
  • 7,855
1 vote
Accepted

How to exclude whole headings and their contents from word counting

Nothing built-in, but you can easily write a function to do so, using org-map-entries. Let's say that headings that are tagged :wcignore: are to be ignored. Then what you need to do is visit each ...
NickD's user avatar
  • 30.5k
1 vote

How to count the number of characters in the marked (selected) region?

The command shell-command-on-region (bound to M-|) passes the region to the standard input of any shell command you want. The output is sent to the echo area if it is short enough or to a buffer whose ...
NickD's user avatar
  • 30.5k
1 vote

How to count the number of characters in the marked (selected) region?

At the risk of sounding like an idiot: (length (buffer-substring-no-properties START END)) If you want to know how many characters it contains, including whatever properties and space they take up, ...
daveboss's user avatar
1 vote
Accepted

Sorting counts in descending order

Use the sort function with the appropriate predicate. Since the list that you want to sort is a list of pairs, (word . count), you cannot compare using < which can only compare numbers: (< '(&...
NickD's user avatar
  • 30.5k
1 vote

count-matches' result in kill-ring?

If you really just wanted to use an "Emacs Keyboard Macro" you could cheat it via copying the output from the "count-matches" within the *Messages* buffer: i.e. Macro: ...
Brian's user avatar
  • 11
1 vote

Display word count in modeline without lag

Solution 1, add (setq wc-idle-wait 2) into ~/.emacs if you need get updated with the data in real time, Please note wc-idle-wait should be set before loading wc-mode.el because of below code in wc-...
chen bin's user avatar
  • 4,877

Only top scored, non community-wiki answers of a minimum length are eligible