From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: RFM: How to make a buffer-local var in C layer Date: Tue, 15 Sep 2015 16:27:29 +0100 Message-ID: <874mivln32.fsf@russet.org.uk> References: <20150821093606.11577.60349@vcs.savannah.gnu.org> <87d1y272f9.fsf@russet.org.uk> <87a8t6jbuy.fsf@russet.org.uk> <878u89njw6.fsf_-_@russet.org.uk> <87io7bnavl.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442330958 26310 80.91.229.3 (15 Sep 2015 15:29:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Sep 2015 15:29:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 15 17:29:17 2015 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 1ZbsAU-0004jt-49 for ged-emacs-devel@m.gmane.org; Tue, 15 Sep 2015 17:29:14 +0200 Original-Received: from localhost ([::1]:43841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbsAT-00078L-Hq for ged-emacs-devel@m.gmane.org; Tue, 15 Sep 2015 11:29:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zbs91-0005k3-PO for emacs-devel@gnu.org; Tue, 15 Sep 2015 11:27:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zbs8v-0000cY-Pi for emacs-devel@gnu.org; Tue, 15 Sep 2015 11:27:43 -0400 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:56236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zbs8v-0000Yt-K4 for emacs-devel@gnu.org; Tue, 15 Sep 2015 11:27:37 -0400 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1Zbs8p-0001DP-EW; Tue, 15 Sep 2015 16:27:31 +0100 Original-Received: from jangai.ncl.ac.uk ([10.66.67.223] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1Zbs8p-0001bN-CK; Tue, 15 Sep 2015 16:27:31 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 15 Sep 2015 10:20:38 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.22 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:189979 Archived-At: Stefan Monnier writes: > Both are C variables of type Lisp_Object. > The "V" one contains the value of the variable > `fontification-functions', while the Q one contains the symbol > `fontification-functions'. Ah, yes, okay. >> Fsetq(Qfontification_functions,Qt) > > BTW, one notable difference (other than performance) between > > Fset (Qfontification_functions, Qt); > and > Vfontification_functions = Qt; > > is that the former will obey make-variable-buffer-local while the > latter won't. So if you want the var to be buffer-local, either use the > former, or make sure to call Fmake_local_variable explicitly at > some point. Okay. Performance is irrelevant here, to be honest, so I've gone for Fset. I've pushed those changes up to my branch now and they appear to be working. I think that I have all the C support that I need, and I'd welcome any comments that you have (don't worry about all the commits and change messages -- I'm planning on squashing before I'd think about moving to master). I'll add the emacs-lisp support next, which should be relatively simple(.el). Phil