From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: How do I tell when the current buffer is the minibuffer? Date: Sat, 5 Mar 2016 22:19:14 +0000 Message-ID: <20160305221914.GB26757@acm.fritz.box> References: <20160305210248.GA26757@acm.fritz.box> <87lh5w37jq.fsf@linux-m68k.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457216237 7218 80.91.229.3 (5 Mar 2016 22:17:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Mar 2016 22:17:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 05 23:17:08 2016 Return-path: Envelope-to: ged-emacs-devel@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 1acKVU-0002Ac-Iw for ged-emacs-devel@m.gmane.org; Sat, 05 Mar 2016 23:17:04 +0100 Original-Received: from localhost ([::1]:48211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acKVT-0004cR-JB for ged-emacs-devel@m.gmane.org; Sat, 05 Mar 2016 17:17:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acKVG-0004bm-E7 for emacs-devel@gnu.org; Sat, 05 Mar 2016 17:16:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acKVB-00040p-7i for emacs-devel@gnu.org; Sat, 05 Mar 2016 17:16:50 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:25628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acKVA-0003zT-Uw for emacs-devel@gnu.org; Sat, 05 Mar 2016 17:16:45 -0500 Original-Received: (qmail 58893 invoked by uid 3782); 5 Mar 2016 22:16:42 -0000 Original-Received: from acm.muc.de (p579E8370.dip0.t-ipconnect.de [87.158.131.112]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 05 Mar 2016 23:16:40 +0100 Original-Received: (qmail 28674 invoked by uid 1000); 5 Mar 2016 22:19:14 -0000 Content-Disposition: inline In-Reply-To: <87lh5w37jq.fsf@linux-m68k.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200976 Archived-At: Hello, Andreas. On Sat, Mar 05, 2016 at 11:04:57PM +0100, Andreas Schwab wrote: > Alan Mackenzie writes: > > Part of my program is being called from `signal_after_change' after > > activity in the minibuffer. However, in that program the buffer local > > variables for the main buffer (not the minibuffer) are still in scope. > How can that happen? A minibuffer is a buffer on its own, with its own > local variables. What is happening is that the variable location (created in C) is being shared by all buffers until a buffer local value is "primed" in a buffer with a `setq' invocation. How does one correctly create a buffer local variable in C? What I have at the moment is: DEFSYM (Qcomment_depth_hwm, "comment-depth-hwm"); DEFVAR_LISP ("comment-depth-hwm", Vcomment_depth_hwm, doc: /* Buffer position below which the `comment-depth' property is valid. */); Vcomment_depth_hwm = make_number (1); Fmake_variable_buffer_local (Qcomment_depth_hwm); This is clearly inadequate, of itself, to create a buffer local variable. > Andreas. > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 > "And now for something completely different." -- Alan Mackenzie (Nuremberg, Germany).