[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: |
Jean Louis |
Subject: |
Re: How to detect words being added and removed to a buffer in a minor mode? |
Date: |
Mon, 21 Nov 2022 13:08:30 +0300 |
User-agent: |
Mutt/2.2.7+37 (a90f69b) (2022-09-02) |
* Eric S Fraga <e.fraga@ucl.ac.uk> [2022-11-21 12:40]:
> On Saturday, 19 Nov 2022 at 20:44, Dmitrii Pisarenko wrote:
> > 1. How can I create an "event listener" (sorry for the non-Emacsian
> > terminology) which would be called whenever the user types something
> > in the buffer?
>
> Naïvely (i.e. I may be totally ignorant of a proper solution), there is
> post-command-hook which can be used to process every single key event.
There are 2 conditions here, one is that user wish to see the number
of words visualy, other is that one wants to compare that once editing
is finished.
One need not see every single word counted. What if user enters 500
words at once, then it would be futil to slow down the process until
every single word has been counted.
It implies, one could invoke function with number of words each in a
while.
In that case, one could use this function:
run-with-timer is an interactive byte-compiled Lisp function in
‘timer.el’.
(run-with-timer SECS REPEAT FUNCTION &rest ARGS)
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
- How to detect words being added and removed to a buffer in a minor mode?, Pravles Redneсkoff, 2022/11/19
- How to detect words being added and removed to a buffer in a minor mode?, Dmitrii Pisarenko, 2022/11/20
- Re: How to detect words being added and removed to a buffer in a minor mode?, Eric S Fraga, 2022/11/21
- Re: How to detect words being added and removed to a buffer in a minor mode?, Emanuel Berg, 2022/11/21
- Re: How to detect words being added and removed to a buffer in a minor mode?, Marcin Borkowski, 2022/11/21
- Re: How to detect words being added and removed to a buffer in a minor mode?, Marcin Borkowski, 2022/11/21
- RE: [External] : Re: How to detect words being added and removed to a buffer in a minor mode?, Drew Adams, 2022/11/21
- Re: How to detect words being added and removed to a buffer in a minor mode?, Emanuel Berg, 2022/11/24
- Re: How to detect words being added and removed to a buffer in a minor mode?, Marcin Borkowski, 2022/11/26
- Re: How to detect words being added and removed to a buffer in a minor mode?, Emanuel Berg, 2022/11/26