From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: How to debug modification to a variable value? Date: Mon, 25 Jan 2010 14:30:45 -0800 (PST) Message-ID: <52428.130.55.118.19.1264458645.squirrel@webmail.lanl.gov> References: <87636pvrdj.fsf@thinkpad.tsdh.de> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1264458766 28921 80.91.229.12 (25 Jan 2010 22:32:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jan 2010 22:32:46 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 25 23:32:38 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 1NZXU4-0008DH-QF for ged-emacs-devel@m.gmane.org; Mon, 25 Jan 2010 23:32:37 +0100 Original-Received: from localhost ([127.0.0.1]:53023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZXU5-0001Sw-NG for ged-emacs-devel@m.gmane.org; Mon, 25 Jan 2010 17:32:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZXU0-0001R4-4v for emacs-devel@gnu.org; Mon, 25 Jan 2010 17:32:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZXTv-0001NE-1v for emacs-devel@gnu.org; Mon, 25 Jan 2010 17:32:31 -0500 Original-Received: from [199.232.76.173] (port=39225 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZXTu-0001N6-SU for emacs-devel@gnu.org; Mon, 25 Jan 2010 17:32:26 -0500 Original-Received: from proofpoint1.lanl.gov ([204.121.3.25]:55948) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NZXTu-0005vh-Ew for emacs-devel@gnu.org; Mon, 25 Jan 2010 17:32:26 -0500 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by proofpoint1.lanl.gov (8.14.3/8.14.3) with ESMTP id o0PMUllj010348 for ; Mon, 25 Jan 2010 15:30:51 -0700 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay1.lanl.gov (Postfix) with ESMTP id D4A551C4FCF for ; Mon, 25 Jan 2010 15:30:45 -0700 (MST) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay1.lanl.gov Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (Postfix) with ESMTP id C204D1C4FCB for ; Mon, 25 Jan 2010 15:30:45 -0700 (MST) Original-Received: by webmail1.lanl.gov (Postfix, from userid 48) id BC6211DE01F7; Mon, 25 Jan 2010 15:30:45 -0700 (MST) Original-Received: from 130.55.118.19 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Mon, 25 Jan 2010 14:30:45 -0800 (PST) In-Reply-To: <87636pvrdj.fsf@thinkpad.tsdh.de> User-Agent: SquirrelMail/1.4.8-5.7.lanl7 X-Priority: 3 (Normal) Importance: Normal X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2010-01-25_18:2010-01-20, 2010-01-25, 2010-01-25 signatures=0 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:120398 Archived-At: > 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. There's a difference between "gone" and "set to nil", even for automatically-buffer-local variables. Does it still have a buffer-local value (which is wrong), or is it using the default (again)? C-h v will say. > 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? Destructive operations on lists can't set the value of a variable to nil, nor can they invoke `kill-local-variable'. `set[qf]?' is of course destructive, as are `kill-local-variable' and `kill-all-local-variables'; have you looked for all of those? > 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... I don't that you can do this in the Emacs debugger, but you should be able to use a watchpoint in gdb for this purpose. Find where the buffer-local value of the variable is stored, set the watchpoint, and then save. Meanwhile, my psychic powers suggest that you have a `let' binding of the variable in question and switch buffers within the `let', or else that something is reasserting your major mode so that `kill-all-local-variables' is getting called. You could test for the latter with the `permanent-local' property. Davis PS - Sorry if some of these instructions are obvious; I don't know just what you know! -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.