From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: How to debug strange value changes of a variable? Date: Wed, 31 Dec 2014 02:03:54 +0100 Message-ID: <87mw64ocjp.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1419987883 12433 80.91.229.3 (31 Dec 2014 01:04:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Dec 2014 01:04:43 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 31 02:04:38 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y67iH-0004Jt-0k for geh-help-gnu-emacs@m.gmane.org; Wed, 31 Dec 2014 02:04:37 +0100 Original-Received: from localhost ([::1]:38734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y67iG-0003gd-3R for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Dec 2014 20:04:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y67hy-0003dX-Pr for help-gnu-emacs@gnu.org; Tue, 30 Dec 2014 20:04:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y67hv-0000bK-JJ for help-gnu-emacs@gnu.org; Tue, 30 Dec 2014 20:04:18 -0500 Original-Received: from msg.wmi.amu.edu.pl ([150.254.78.50]:60542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y67hv-0000aW-DR for help-gnu-emacs@gnu.org; Tue, 30 Dec 2014 20:04:15 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 0A01B414B1 for ; Wed, 31 Dec 2014 02:04:11 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JnPCcJgF+Jhc for ; Wed, 31 Dec 2014 02:04:10 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id AE4ED414B0 for ; Wed, 31 Dec 2014 02:04:09 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 150.254.78.50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101776 Archived-At: Hi there, a few weeks ago I sent an email to the mu/mu4e mailing list, but got no answer. (Not that I blame anyone, my problem might just be hard...) I'd like to debug the issue myself, but have no clue how. Here's (more or less) what happens: I define a buffer-local variable (by make-variable-buffer-local), and define its default value (by setq-default). Then, I have a function which updates its value. (Use case: I have a few signatures, and I want to be able to cycle between them. The variable is the number of the signature, which is incremented with each cycle, and returns to zero when it reaches the length of the list of signatures.) Now somehow mu4e (I know it is to blame, since in stock message-mode, with emacs -Q, and without mu4e, everything works as expected!) messes around with the value of this variable /after the first increment/ (or so it seems: it looks like that after some initialization - including incf'ing that variable from its inital value of -1 - it somehow comes back to its original (default) value). I'd like to check what function and when changes its value. Is there any way to use Edebug (or anything else) for this? I know about edebug-set-global-break-condition, but this doesn't help a lot: it can stop when the variable has some value, but does not tell me /which/ piece of code changed it. I also know about edebug-backtrace, but I'm not sure whether it will help me. (I tried it, but it didn't seem to help.) (A similar question is to find out what calls such-and-such function. This one seems easier: I can just instrument the said function and then press `d' in Edebug to see the backtrace. Am I right?) TIA, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University