emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: buffer.c/buffer.h: How to add new buffer-local variables?


From: Alan Mackenzie
Subject: Re: buffer.c/buffer.h: How to add new buffer-local variables?
Date: Sun, 31 Mar 2019 12:22:38 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]