From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: buffer.c/buffer.h: How to add new buffer-local variables? Date: Sun, 31 Mar 2019 12:22:38 +0000 Message-ID: <20190331122238.GA4612@ACM> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="37376"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Emacs Devel To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 31 14:23:24 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hAZUh-0009bM-7Y for ged-emacs-devel@m.gmane.org; Sun, 31 Mar 2019 14:23:23 +0200 Original-Received: from localhost ([127.0.0.1]:48010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAZUf-00015l-IL for ged-emacs-devel@m.gmane.org; Sun, 31 Mar 2019 08:23:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAZU6-00015d-9s for emacs-devel@gnu.org; Sun, 31 Mar 2019 08:22:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAZU4-0007z6-LB for emacs-devel@gnu.org; Sun, 31 Mar 2019 08:22:46 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:48377 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hAZU2-0007yN-Up for emacs-devel@gnu.org; Sun, 31 Mar 2019 08:22:44 -0400 Original-Received: (qmail 40103 invoked by uid 3782); 31 Mar 2019 12:22:39 -0000 Original-Received: from acm.muc.de (p2E5D59DF.dip0.t-ipconnect.de [46.93.89.223]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 31 Mar 2019 14:22:38 +0200 Original-Received: (qmail 30336 invoked by uid 1000); 31 Mar 2019 12:22:38 -0000 Content-Disposition: inline In-Reply-To: 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 [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:234838 Archived-At: Hello, Keith. On Sat, Mar 30, 2019 at 16:19:50 -0700, Keith David Bershatsky wrote: > I am working on feature requests #22873 (multiple fake cursors) and > #17684 (crosshairs that track the cursor position). > In an earlier version of the Emacs master branch from a few months ago, > I was able to increase the number of buffer-local variables in > buffer.c/buffer.h by changing the value of MAX_PER_BUFFER_VARS from 50 > to 60. That approach does not permit me to build a current version of > the Emacs master branch, which fails with the following error: > Dumping under the name bootstrap-emacs.pdmp > dumping fingerprint: 50894efcc2cdb17747a4536c9f53c4d093895712c3604daa88d068c383ea4780 > pdumper.c:1786: Emacs fatal error: assertion failed: relpos < 1024 > Fatal error 6: Abort trapmake[1]: *** [bootstrap-emacs.pdmp] Abort trap > make[1]: *** Deleting file `bootstrap-emacs.pdmp' > make: *** [src] Error 2 > Compilation exited abnormally with code 2 at Sat Mar 30 15:53:18 > I have narrowed the issue down to adding just one (1) more buffer local > variable, which breaks the camel's back. Attached are git diffs for a > working build and a broken build. I am using Emacs master branch from > 03/28/2019: 2da9f8bf4222fda504f43b4757e154999cdbbf2c > My config options are as follows: [ .... ] > How can I increase the number of buffer local variables in > buffer.c/buffer.h without breaking the ability to build Emacs? You're surely aware that you can add a new local variable in C source by declaring it with DEFVAR, then calling Fmake_variable_buffer_local in syms_of_foo? Or something like that (I've forgotten the exact details). Is there some pressing reason why the new variable has to be part of struct buffer rather than an "ordinary" buffer local? It's worth noting that there's nothing in the elisp manual about how to create buffer local variables in the C source. It may be that there're BL variables in struct buffer that don't really need to be there, and could be converted to "ordinary" variables. I think I might have added one or two of these myself, but don't remember. > Keith -- Alan Mackenzie (Nuremberg, Germany).