From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Tassilo Horn <tsdh@gnu.org>
Cc: 15692@debbugs.gnu.org, Leo Liu <sdl.web@gmail.com>
Subject: bug#15692: 24.3.50; rcirc activity mode-line indicator gets cleared automatically
Date: Wed, 23 Oct 2013 16:10:25 -0400 [thread overview]
Message-ID: <jwvli1j4usj.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <878uxk9jeo.fsf@tsdh.uni-koblenz.de> (Tassilo Horn's message of "Wed, 23 Oct 2013 16:00:31 +0200")
>> 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.
Stefan
prev parent reply other threads:[~2013-10-23 20:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-23 8:18 bug#15692: 24.3.50; rcirc activity mode-line indicator gets cleared automatically Tassilo Horn
2013-10-23 8:39 ` Leo Liu
2013-10-23 9:13 ` Tassilo Horn
2013-10-23 12:46 ` Stefan Monnier
2013-10-23 14:00 ` Tassilo Horn
2013-10-23 15:09 ` Tassilo Horn
2013-10-25 1:12 ` Stefan Monnier
2013-10-25 6:54 ` Tassilo Horn
2013-10-23 20:10 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvli1j4usj.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=15692@debbugs.gnu.org \
--cc=sdl.web@gmail.com \
--cc=tsdh@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).