From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Kost Newsgroups: gmane.emacs.help Subject: Re: How to debug strange value changes of a variable? Date: Thu, 01 Jan 2015 17:00:22 +0300 Message-ID: <8761cqwqh5.fsf@gmail.com> References: <87mw64ocjp.fsf@mbork.pl> <87bnmj7chm.fsf@web.de> <874msbnybl.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1420120855 30946 80.91.229.3 (1 Jan 2015 14:00:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Jan 2015 14:00:55 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 01 15:00:48 2015 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 1Y6gIy-0006VU-GN for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Jan 2015 15:00:48 +0100 Original-Received: from localhost ([::1]:48680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6gIy-0001RK-08 for geh-help-gnu-emacs@m.gmane.org; Thu, 01 Jan 2015 09:00:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6gIh-0001QO-Bk for help-gnu-emacs@gnu.org; Thu, 01 Jan 2015 09:00:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y6gId-0000KS-BO for help-gnu-emacs@gnu.org; Thu, 01 Jan 2015 09:00:31 -0500 Original-Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:60549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6gId-0000KL-2i for help-gnu-emacs@gnu.org; Thu, 01 Jan 2015 09:00:27 -0500 Original-Received: by mail-la0-f50.google.com with SMTP id pn19so14764491lab.37 for ; Thu, 01 Jan 2015 06:00:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=nuBFAEAAEfUevYI27VJHdgfSbVlb1eBV+ix3h/7ef2U=; b=fwAMS1XkFOf2bccscwltIfbGfbh9hSMWRTVBWD/VapMSfHcKZA7VPsegfz7mdYn5g6 Cmg5ngC6lQjfNyMBMsTGPqDU8UkW7OuZtfqM0htH7DNf54hwSlQC6eT/VLaGJwJowxfg pH8ofijNvRGLXBVBZKYj/VbaQ8xg/ZI8zQFoq6KCGhDIFy9t/4LY3RzhxmWnnpyuZSoh BNlRLD4W2RyH7jz40BroM1riAMQv9ENgN7g4gtQwb40WbXob7OR4fQSiM0sdae4TnUa4 JAZ5ajZ3IKQbifW/27NpUmntZ+C3/UrgoCMuGf+kyQ3nwltBKUwcKJ/c6fXVztUHS7gY BXkA== X-Received: by 10.152.234.35 with SMTP id ub3mr71870173lac.70.1420120825286; Thu, 01 Jan 2015 06:00:25 -0800 (PST) Original-Received: from leviafan ([217.107.192.158]) by mx.google.com with ESMTPSA id m9sm12029228laa.28.2015.01.01.06.00.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jan 2015 06:00:24 -0800 (PST) In-Reply-To: <874msbnybl.fsf@mbork.pl> (Marcin Borkowski's message of "Thu, 01 Jan 2015 01:23:26 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::232 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:101823 Archived-At: Marcin Borkowski (2015-01-01 03:23 +0300) wrote: > On 2014-12-31, at 22:09, Michael Heerdegen wrote: [...] >> Also note that changing a buffer's major mode removes all buffer local >> bindings in the current buffer. That could maybe happen in your case. > > Thank you, thank you, thank you, thank you so much! I'd *never* think > of that (I didn't even know that). That was it! The first time my > function was called, the buffer was in fundamental mode; all subsequent > times, it was in mu4e-compose-mode. That should explain everything. > > Now the question is: what to do. I could dive into mu4e sources (which > I'm just a bit too lazy to do now). I could just start > mu4e-compose-mode myself in my function and see what happens (I'll try > that). Other than that, I don't have many ideas. [...] I didn't follow the thread but IIUC you want your variable to survive a changing of a major-mode. If so, you can do it using 'permanent-local' property: (put ' 'permanent-local t) See (info "(elisp) Creating Buffer-Local"). -- Alex