From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How do I tell when the current buffer is the minibuffer? Date: Sun, 06 Mar 2016 19:44:25 +0200 Message-ID: <83y49vv6va.fsf@gnu.org> References: <20160305210248.GA26757@acm.fritz.box> <87lh5w37jq.fsf@linux-m68k.org> <20160305221914.GB26757@acm.fritz.box> <87h9gk35ww.fsf@linux-m68k.org> <20160305225126.GC26757@acm.fritz.box> <87d1r834tl.fsf@linux-m68k.org> <20160305232043.GD26757@acm.fritz.box> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1457286275 9830 80.91.229.3 (6 Mar 2016 17:44:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Mar 2016 17:44:35 +0000 (UTC) Cc: schwab@linux-m68k.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 06 18:44:30 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 1accjF-0001SU-KY for ged-emacs-devel@m.gmane.org; Sun, 06 Mar 2016 18:44:29 +0100 Original-Received: from localhost ([::1]:51495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1accjE-0001D8-VD for ged-emacs-devel@m.gmane.org; Sun, 06 Mar 2016 12:44:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1accjB-0001D1-I8 for emacs-devel@gnu.org; Sun, 06 Mar 2016 12:44:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1accj8-0008MF-9S for emacs-devel@gnu.org; Sun, 06 Mar 2016 12:44:25 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1accj8-0008MB-6B; Sun, 06 Mar 2016 12:44:22 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3524 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1accj7-0008QF-DH; Sun, 06 Mar 2016 12:44:21 -0500 In-reply-to: <20160305232043.GD26757@acm.fritz.box> (message from Alan Mackenzie on Sat, 5 Mar 2016 23:20:43 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:201005 Archived-At: > Date: Sat, 5 Mar 2016 23:20:43 +0000 > From: Alan Mackenzie > Cc: emacs-devel@gnu.org > > On Sun, Mar 06, 2016 at 12:03:50AM +0100, Andreas Schwab wrote: > > Alan Mackenzie writes: > > > > On Sat, Mar 05, 2016 at 11:40:15PM +0100, Andreas Schwab wrote: > > >> Alan Mackenzie writes: > > > >> > 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. > > > >> In which way? > > > > Until a `setq' (or the like) is done on the variable for a particular > > > buffer, C code reading/writing from Vcomment_depth_hwm reads and writes > > > the same piece of RAM that all other buffers do. > > > That seems to work for deactivate-mark. > > It's not working for comment-depth-hwm. > > Perhaps somebody who understands this will chip in, here. It could > really do with being in the Elisp manual. Is there still a problem? If so, please describe the details, because I don't think I understand them well enough to try helping you. (Yes, I've read what you wrote, but your description was too general and didn't include any code you tried to use, so I'm not sure what exactly did you try and how.)