From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Roehler Newsgroups: gmane.emacs.devel Subject: Re: How to debug modification to a variable value? Date: Wed, 27 Jan 2010 09:51:25 +0100 Message-ID: <4B5FFE8D.1040305@online.de> References: <87636pvrdj.fsf@thinkpad.tsdh.de> <9131EBDDBDBF4BC384201871CA79A2BE@us.oracle.com> <87d40x5m9b.fsf@thinkpad.tsdh.de> <4B5FED4D.60000@online.de> <871vhcarax.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1264583270 26834 80.91.229.12 (27 Jan 2010 09:07:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Jan 2010 09:07:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 27 10:07:42 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Na3sC-0003jv-DF for ged-emacs-devel@m.gmane.org; Wed, 27 Jan 2010 10:07:40 +0100 Original-Received: from localhost ([127.0.0.1]:60845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Na3sD-0004YM-FJ for ged-emacs-devel@m.gmane.org; Wed, 27 Jan 2010 04:07:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Na3bP-0002LK-IW for emacs-devel@gnu.org; Wed, 27 Jan 2010 03:50:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Na3bJ-0002IQ-TY for emacs-devel@gnu.org; Wed, 27 Jan 2010 03:50:18 -0500 Original-Received: from [199.232.76.173] (port=54632 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Na3bH-0002Ha-LN for emacs-devel@gnu.org; Wed, 27 Jan 2010 03:50:11 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]:60248) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Na3bH-0002QW-4r for emacs-devel@gnu.org; Wed, 27 Jan 2010 03:50:11 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.171]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Na3bG-0001Dn-AM for emacs-devel@gnu.org; Wed, 27 Jan 2010 03:50:10 -0500 Original-Received: from [192.168.178.27] (p54BE9DD3.dip0.t-ipconnect.de [84.190.157.211]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MURN9-1NQKR22IsN-00RMC1; Wed, 27 Jan 2010 09:50:08 +0100 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: <871vhcarax.fsf@thinkpad.tsdh.de> X-Provags-ID: V01U2FsdGVkX1+J8pzueZMYhP7ffUiu1ABjwCGNnbxyk0i7ydA 5Dps7jbhjAprYO7Ebi8dE1oxScYmvSiftwliHe1w1yEiXM/x1H Hi8RwL3O6BhNFLiscn0uIw89/wC951KrfTKTzWlpzg= X-detected-operating-system: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:120488 Archived-At: Tassilo Horn wrote: > Andreas Roehler 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