From f3c77d11af65f3b319b1784b4c3cf08c51aa7997 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Mon, 5 Dec 2016 21:42:20 -0800 Subject: stash --- src/data.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'src/data.c') diff --git a/src/data.c b/src/data.c index 8e07bf01b44..26ff9948828 100644 --- a/src/data.c +++ b/src/data.c @@ -1304,6 +1304,56 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, default: emacs_abort (); } + + const char* symname = SDATA(sym->name); + + if( EQ(Vwatch_object, symbol) ) + { + static int nest_level = 0; + if(nest_level++ == 0) + { + switch(sym->redirect) + { + case SYMBOL_PLAINVAL: + { + AUTO_STRING (format, "Setting symbol '%s'; redirect: SYMBOL_PLAINVAL"); + CALLN (Fmessage, format, SYMBOL_NAME (symbol)); + break; + } + case SYMBOL_VARALIAS: + { + AUTO_STRING (format, "Setting symbol '%s'; redirect: SYMBOL_VARALIAS"); + CALLN (Fmessage, format, SYMBOL_NAME (symbol)); + break; + } + case SYMBOL_LOCALIZED: + { + AUTO_STRING (format, "Setting symbol '%s'; redirect: SYMBOL_LOCALIZED"); + CALLN (Fmessage, format, SYMBOL_NAME (symbol)); + break; + } + case SYMBOL_FORWARDED: + { + AUTO_STRING (format, "Setting symbol '%s'; redirect: SYMBOL_FORWARDED"); + CALLN (Fmessage, format, SYMBOL_NAME (symbol)); + break; + } + + default: + { + AUTO_STRING (format, "Setting symbol '%s'; redirect: UNKNOWN"); + CALLN (Fmessage, format, SYMBOL_NAME (symbol)); + break; + } + } + } + nest_level--; + } + + + + + start: switch (sym->redirect) { -- cgit v1.2.1