[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to debug modification to a variable value?
From: |
Andreas Roehler |
Subject: |
Re: How to debug modification to a variable value? |
Date: |
Wed, 27 Jan 2010 09:51:25 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081227) |
Tassilo Horn wrote:
> Andreas Roehler <address@hidden> writes:
>
> Hi Andreas,
>
>> what about to run a form with "assert MY-Values last-command
>> this-command" with a timer in background, so it's signaled as soon the
>> var is changed?
>
> I think that timer would need to run every fraction of a second to have
> a chance to point me in the right direction.
>
> Have a look at Davis last message. He spotted the error: a small
> function was added to `after-save-hook' globally, but it must be there
> only buffer-locally. The assert has to be evaluated exactly when that
> function is executed, to point me into the right direction.
>
> I guess the watchpoint approach is more exact,
[ ... ]
Probably,
anyway, as my small test case works so far, here the example tracking
the value of var "count":
(BTW form with "assert" don't work, why?)
(setq count '1)
(defvar zeit nil)
(defun ausgabe ()
;; (assert (eq count 1))
(message "%s" "increase count, assert should fail")
(setq count (1+ count))
(message "%s %s %s %d" this-command last-command (eq count 1) count))
(if zeit
(progn (cancel-timer zeit) (setq zeit nil))
(setq zeit (run-with-timer 0.5 1 'ausgabe)))
Andreas
Re: How to debug modification to a variable value?, Davis Herring, 2010/01/25
Re: How to debug modification to a variable value?, alin.s, 2010/01/26