help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : How to detect words being added and removed to a buffer


From: Drew Adams
Subject: RE: [External] : How to detect words being added and removed to a buffer in a minor mode?
Date: Sat, 19 Nov 2022 23:31:08 +0000

> As far as I know, none of the existing Emacs
> word counters offers this functionality.

Vanilla Emacs offers you the word count in the
region, with `M-=' (`count-words-region').  As
you say, that doesn't provide what you request.
But may help somewhat.
___

This too doesn't offer what you request, but it
might help you nevertheless: `modeline-region.el'.
___

https://www.emacswiki.org/emacs/ModeLineRegion

https://www.emacswiki.org/emacs/modeline-region.el
___

1. Customize option `mlr-non-rectangle-style' to
   "Lines, words, and chars" (`lines+words+chars').

2. To get the same effect with a rectangular region
   (selection), customize `mlr-rectangle-style' to
   "Rows, columns, words, and chars"
   (`rows+cols+words+chars').

3. Enable minor mode `modeline-region-mode' or
   `global-modeline-region-mode'.

Whenever the region is active, the number of words
(and more) selected is shown in the mode line.  So
`C-x C-x' shows you the count any time.

Works even for a rectangular region.  (Option
`mlr-count-partial-words-flag' controls whether to
count words that straddle rectangle boundaries.)

As usual, `C-x h' to select the whole buffer, to
see buffer counts.

<<attachment: winmail.dat>>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]