From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: How do I tell when the current buffer is the minibuffer? Date: Sun, 06 Mar 2016 00:03:50 +0100 Message-ID: <87d1r834tl.fsf@linux-m68k.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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1457219052 14643 80.91.229.3 (5 Mar 2016 23:04:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Mar 2016 23:04:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 06 00:04:04 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 1acLEw-0000JB-NQ for ged-emacs-devel@m.gmane.org; Sun, 06 Mar 2016 00:04:02 +0100 Original-Received: from localhost ([::1]:48309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acLEv-0005qh-T7 for ged-emacs-devel@m.gmane.org; Sat, 05 Mar 2016 18:04:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acLEs-0005qI-RX for emacs-devel@gnu.org; Sat, 05 Mar 2016 18:03:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acLEn-0005Xh-N1 for emacs-devel@gnu.org; Sat, 05 Mar 2016 18:03:58 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.9]:52529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acLEn-0005XX-Gg for emacs-devel@gnu.org; Sat, 05 Mar 2016 18:03:53 -0500 Original-Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3qHhLw30Npz3hjNf; Sun, 6 Mar 2016 00:03:52 +0100 (CET) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3qHhLv5Wz2zvhMR; Sun, 6 Mar 2016 00:03:51 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id SvPONeBEpOVk; Sun, 6 Mar 2016 00:03:51 +0100 (CET) X-Auth-Info: VZCcaI0f57UBhPVBDzx6SdP2h0A9h5wk79Zbn2lilmr4A1MK1S8GE0oVycYBGzDX Original-Received: from igel.home (ppp-88-217-5-227.dynamic.mnet-online.de [88.217.5.227]) by mail.mnet-online.de (Postfix) with ESMTPA; Sun, 6 Mar 2016 00:03:50 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 1000) id A03BE2C1EDD; Sun, 6 Mar 2016 00:03:50 +0100 (CET) X-Yow: .. I wonder if I ought to tell them about my PREVIOUS LIFE as a COMPLETE STRANGER? In-Reply-To: <20160305225126.GC26757@acm.fritz.box> (Alan Mackenzie's message of "Sat, 5 Mar 2016 22:51:26 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 212.18.0.9 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:200980 Archived-At: Alan Mackenzie writes: > Hello, Andreas. > > 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. 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."