unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Roehler <andreas.roehler@online.de>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: emacs-devel@gnu.org
Subject: Re: How to debug modification to a variable value?
Date: Wed, 27 Jan 2010 09:51:25 +0100	[thread overview]
Message-ID: <4B5FFE8D.1040305@online.de> (raw)
In-Reply-To: <871vhcarax.fsf@thinkpad.tsdh.de>

Tassilo Horn wrote:
> Andreas Roehler <andreas.roehler@online.de> 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







  reply	other threads:[~2010-01-27  8:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25 20:52 How to debug modification to a variable value? Tassilo Horn
2010-01-25 21:08 ` Drew Adams
2010-01-26  8:00   ` Tassilo Horn
2010-01-26 15:17     ` Stefan Monnier
2010-01-26 16:49       ` Richard Stallman
2010-01-26 21:02         ` Stefan Monnier
2010-01-26 18:02       ` alin.s
2010-01-27  7:37     ` Andreas Roehler
2010-01-27  8:24       ` Tassilo Horn
2010-01-27  8:51         ` Andreas Roehler [this message]
2010-01-25 22:30 ` Davis Herring
2010-01-26  8:43   ` Tassilo Horn
2010-01-26 21:04     ` Davis Herring
2010-01-27  7:50       ` Tassilo Horn
2010-01-27 15:42         ` Davis Herring
2010-01-26 15:52 ` alin.s
2010-01-26 20:26   ` Tassilo Horn
2010-01-27  8:13     ` alin.s

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=4B5FFE8D.1040305@online.de \
    --to=andreas.roehler@online.de \
    --cc=emacs-devel@gnu.org \
    --cc=tassilo@member.fsf.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).