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: Wed, 27 Jan 2010 07:42:54 -0800 (PST) Message-ID: <58701.130.55.118.19.1264606974.squirrel@webmail.lanl.gov> References: <87636pvrdj.fsf@thinkpad.tsdh.de> <52428.130.55.118.19.1264458645.squirrel@webmail.lanl.gov> <87636p5k9u.fsf@thinkpad.tsdh.de> <45732.130.55.118.19.1264539889.squirrel@webmail.lanl.gov> <87aaw0asvd.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 1264607005 13764 80.91.229.12 (27 Jan 2010 15:43:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Jan 2010 15:43:25 +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 16:43:22 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.69) (envelope-from ) id 1NaA2x-0005AE-Hu for ged-emacs-devel@m.gmane.org; Wed, 27 Jan 2010 16:43:11 +0100 Original-Received: from localhost ([127.0.0.1]:34856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaA2x-0003tx-34 for ged-emacs-devel@m.gmane.org; Wed, 27 Jan 2010 10:43:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaA2s-0003td-Ae for emacs-devel@gnu.org; Wed, 27 Jan 2010 10:43:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaA2n-0003sd-TO for emacs-devel@gnu.org; Wed, 27 Jan 2010 10:43:06 -0500 Original-Received: from [199.232.76.173] (port=50759 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaA2n-0003sa-LU for emacs-devel@gnu.org; Wed, 27 Jan 2010 10:43:01 -0500 Original-Received: from proofpoint1.lanl.gov ([204.121.3.25]:54059) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NaA2n-0004K7-4V for emacs-devel@gnu.org; Wed, 27 Jan 2010 10:43:01 -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 o0RFgoHD026136; Wed, 27 Jan 2010 08:42:56 -0700 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 74E5B1C55CF; Wed, 27 Jan 2010 08:42:54 -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 5C8C11C55CB; Wed, 27 Jan 2010 08:42:54 -0700 (MST) Original-Received: by webmail1.lanl.gov (Postfix, from userid 48) id 5AB7A1DE023E; Wed, 27 Jan 2010 08:42:54 -0700 (MST) Original-Received: from 130.55.118.19 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Wed, 27 Jan 2010 07:42:54 -0800 (PST) In-Reply-To: <87aaw0asvd.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-27_09:2010-01-20, 2010-01-27, 2010-01-27 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:120513 Archived-At: >> and that `tg-initialize' adds -that- to `eldoc-mode-hook' (globally!), >> and that `tg-mode' calls -that-. > > No, `tg-eldoc-init' is added locally, but I guess you mean that as a > result, `tg-init-schema' ends up globally in `after-save-hook' as soon > as `eldoc-mode-hook' was run, and you are right. Actually, I just didn't notice that one of the `add-hook's was local; since I had noticed the other one was global, I didn't double-check this one. > Absolutely. How much time did you spend on that, and how did you debug > it? Using a watchpoint in gdb as you suggested? While I clearly see > that the global `add-hook' is plain wrong, I wouldn't have found it by > looking carefully at the code. Maybe 15 minutes? I wasn't counting. I just thought it was odd that the "only" function that set `tg-schema-alist' wasn't even in the same file where it was defvar-ed, so I looked in tg-mode.el, found `tg-init-schema' (which I could really have guessed from `greql-set-graph'), and then looked for references to that function. As soon as I saw it put on `after-save-hook', it was obvious (though I had to look at the other hook to understand the whole sequence). I never left the browser window wherein I browsed your SVN repository except to check Emacs' documentation. > Thanks a lot, I evaled > > (cons "Davis Herring" list-of-extremely-helpful-guys). Am I to be garbage collected, then? You need a `setq' (like `push' does); perhaps I can still be rescued from `values'. ;) Glad I could help, Davis PS - Your messages to me (and the list) bear the header Mail-Followup-To: herring@lanl.gov, emacs-devel@gnu.org ...which seems wrong (especially when I am the one replying!); surely Mail-Followup-To: tassilo@member.fsf.org, emacs-devel@gnu.org is what you want? -- 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.