From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: How to debug modification to a variable value? Date: Mon, 25 Jan 2010 21:52:56 +0100 Message-ID: <87636pvrdj.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1264452831 831 80.91.229.12 (25 Jan 2010 20:53:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jan 2010 20:53:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 25 21:53:43 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 1NZVwG-0000Wl-91 for ged-emacs-devel@m.gmane.org; Mon, 25 Jan 2010 21:53:36 +0100 Original-Received: from localhost ([127.0.0.1]:51084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZVwH-0007Si-JQ for ged-emacs-devel@m.gmane.org; Mon, 25 Jan 2010 15:53:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZVvl-00076B-TJ for emacs-devel@gnu.org; Mon, 25 Jan 2010 15:53:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZVvg-00072X-U3 for emacs-devel@gnu.org; Mon, 25 Jan 2010 15:53:05 -0500 Original-Received: from [199.232.76.173] (port=57225 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZVvg-00072J-Np for emacs-devel@gnu.org; Mon, 25 Jan 2010 15:53:00 -0500 Original-Received: from out2.smtp.messagingengine.com ([66.111.4.26]:46377) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZVvg-0001GB-Hj for emacs-devel@gnu.org; Mon, 25 Jan 2010 15:53:00 -0500 Original-Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 7CEA8CE3E8 for ; Mon, 25 Jan 2010 15:52:59 -0500 (EST) Original-Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Mon, 25 Jan 2010 15:52:59 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:to:subject:date:message-id:mime-version:content-type; s=smtpout; bh=GmZ54WN65Nzik/miGE6L5iF1U7A=; b=nAVKLff9K+Y5YAz2pjo2mHAQmxbu7ibHZ3214dbMLwAkCcC55aJ8k9mmrDIraBnQpIexiCe3IGeZPdNaIik+C9J2YhaLBW13Be1jVOXYdmI6mdiEklX8F18gqNZ1sfomUY/xwER6wvJKRm9loyb5R3qFFU2yUi6MGtCgjzfz5y8= X-Sasl-enc: 0ShAR6LmrrI+wBMwXxsF5fvwY8MP3Q+wM3xZT8jwQ7+x 1264452779 Original-Received: from thinkpad.tsdh.de (p54AF275F.dip0.t-ipconnect.de [84.175.39.95]) by mail.messagingengine.com (Postfix) with ESMTPA id AB7AB29A6C7 for ; Mon, 25 Jan 2010 15:52:58 -0500 (EST) Mail-Copies-To: never Mail-Followup-To: emacs-devel@gnu.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:120392 Archived-At: Hi all, today I had some strange problems with a major mode we use at my institute, and that I created and maintain. This mode defines some buffer-local variable: --8<---------------cut here---------------start------------->8--- (defvar tg-schema-alist nil "The schema of the current TG file.") (make-variable-buffer-local 'tg-schema-alist) --8<---------------cut here---------------end--------------->8--- This variable is set once, when a new graph is loaded (whatever that means, but there is only one function that setqs the variable). Also, there's a function, which refreshes some font-locking stuff when saving. This function is added to `after-save-hook' locally. --8<---------------cut here---------------start------------->8--- after-save-hook is a variable defined in `files.el'. Its value is (t greql-set-fontlock-types-regex) Local in buffer method-calls-per-activity.greql; global value is nil --8<---------------cut here---------------end--------------->8--- Now, my problem was that under some circumstances after saving, the buffer-local value of `tg-schema-alist' was gone, i.e. set to nil. I double-checked `greql-set-fontlock-types-regex' that it doesn't modify `tg-schema-alist', and it doesn't. I also removed all destructive function calls in there, although it operates only on a list created by `mapcar', and that's a copy anyway, right? Till now, I couldn't reproduce this behavior. After restarting emacs, the problem was gone first. Suddenly, it appeared again. Maybe it has something to do with using the same buffer in many frames (tty and X), but I cannot tell for sure... So what I need is some way to be put in the debugger when the value of `tg-schema-alist' is modified. Is that feasible? I tried adding an after advice to `setq' which does exactly that, but that screwed my emacs instance. I guess it's no good idea to advice such primitives... Bye, Tassilo