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

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

Re: How to detect words being added and removed to a buffer in a minor m


From: Marcin Borkowski
Subject: Re: How to detect words being added and removed to a buffer in a minor mode?
Date: Mon, 21 Nov 2022 18:21:45 +0100
User-agent: mu4e 1.1.0; emacs 29.0.50

On 2022-11-21, at 18:17, Marcin Borkowski <mbork@mbork.pl> wrote:

> Would a mode which displays the number of words in the current buffer
> whenever you stop typing for a few seconds be enough?  (I am not sure
> how exactly you want to obtain the "number of words typed in today".)

Ah, ok.  I reread your initial message.  I don't think yours is the
easiest way to do that.  Here's how I would do it: I would /store/ the
number of words in a buffer somewhere (a buffer-local variable is one
possible idea) every time the counting function is called /the first
time on any given day/.  This way you wouldn't have to set the counter
to zero etc. - Emacs could even plot a graph showing your progress
during several days?

And now I'm /very/ much tempted to actually write this piece of code.
It could be quite fun!

It's even better.  It /might/ be a good idea ot turn it into an
educational blog post about Elisp or something similar.

WDYT?  I think I could come up with a prototype within a few days...

Best,

-- 
Marcin Borkowski
http://mbork.pl



reply via email to

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