[Top][All Lists]

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

bug#15692: 24.3.50; rcirc activity mode-line indicator gets cleared auto

From: Stefan Monnier
Subject: bug#15692: 24.3.50; rcirc activity mode-line indicator gets cleared automatically
Date: Wed, 23 Oct 2013 16:10:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> No.  It wouldn't be very hard to add, tho.
> It's definititely not the first time where I could need something like
> that.  Maybe it could also be a bit more general, e.g., one could add a
> watcher function to a symbol that's called whenever the symbol-value is
> set.

The way to implement it, I think is to take the "read-only" bit of
symbols, and extend it with a third value ("watched").
So assignment to such a variable would be a variation of "read-only",
except that instead of signally an error, it would call some Elisp code.
The point being that the "normal execution path" can stay unchanged, so
we don't slow down normal execution.

Of course, it wouldn't work on those Elisp variable that are defined in
C (i.e. defined via DEFVAR_LISP, DEFVAR_BOOL, or DEFVAR_INT), where the
value can be directly changed by the C code without going through
those tests.  Kind of like advice on subrs.


reply via email to

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