From: Spencer Baugh <sbaugh@catern.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 48264@debbugs.gnu.org
Subject: bug#48264: [PATCH v3 07/15] Add BVAR_OR_DEFAULT macro as a stub
Date: Fri, 07 May 2021 09:05:26 -0400 [thread overview]
Message-ID: <87k0oar8x5.fsf@catern.com> (raw)
In-Reply-To: <837dkaddbc.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Spencer Baugh <sbaugh@catern.com>
>> Date: Thu, 6 May 2021 17:33:38 -0400
>> Cc: Spencer Baugh <sbaugh@catern.com>
>>
>> For buffer variables without a default, we still use BVAR. For any
>> buffer variable with a default, we use BVAR_OR_DEFAULT. A later
>> commit will statically enforce this.
>
> This part says they are the same:
>
>> --- a/src/buffer.h
>> +++ b/src/buffer.h
>> @@ -284,6 +284,8 @@ struct buffer_text
>>
>> #define BVAR(buf, field) ((buf)->field ## _)
>>
>> +#define BVAR_OR_DEFAULT(buf, field) BVAR (buf, field)
>
> What am I missing here?
The commit message is accurate - we indeed use BVAR for buffer variables
without a default, and BVAR_OR_DEFAULT for buffer variables with a
default.
It's just that in this commit, those two behave identically. The
immediate next commit makes them different.
I split it up in this way because this commit is the result of a big
tree-wide sed, no actual meaningful change; I think it's much easier to
understand the next commit when the two are kept separate.
> Also, I have a question: suppose we have a variable that is defined
> with DEFVAR_LISP, and then some Lisp calls make-variable-buffer-local:
> how will that work with these two macros when the C code needs to
> access the buffer-local value?
Nothing in these changes affect variables that are made into
buffer-locals from Lisp code; these changes only affect variables
built-in to Emacs that were defined with DEFVAR_PER_BUFFER. So that
will just work the same as it does today - accesses to such variables
don't go through BVAR today.
next prev parent reply other threads:[~2021-05-07 13:05 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 20:24 bug#48264: 28.0.50; Changing the default for DEFVAR_PER_BUFFER variables takes O(#buffers) time Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 00/15] Speeding up setting the default for DEFVAR_PER_BUFFER vars Spencer Baugh
2021-05-07 11:05 ` Eli Zaretskii
2021-05-08 2:08 ` bug#48264: [PATCH v4 " Spencer Baugh
2021-05-08 2:08 ` Spencer Baugh
2021-05-08 2:08 ` bug#48264: [PATCH v4 01/14] Stop checking the constant default for enable_multibyte_characters Spencer Baugh
2021-05-08 2:08 ` bug#48264: [PATCH v4 02/14] Take offset not idx in PER_BUFFER_VALUE_P Spencer Baugh
2021-05-08 2:08 ` bug#48264: [PATCH v4 03/14] Add and use BVAR_HAS_DEFAULT_VALUE_P Spencer Baugh
2021-05-08 2:08 ` bug#48264: [PATCH v4 04/14] Combine unnecessarily separate loops in buffer.c Spencer Baugh
2021-05-08 2:08 ` bug#48264: [PATCH v4 05/14] Add and use KILL_PER_BUFFER_VALUE Spencer Baugh
2021-05-08 2:08 ` bug#48264: [PATCH v4 06/14] Rearrange set_internal for buffer forwarded symbols Spencer Baugh
2021-05-08 2:08 ` bug#48264: [PATCH v4 07/14] Use BVAR_OR_DEFAULT for per-buffer vars with defaults Spencer Baugh
2021-05-08 2:08 ` bug#48264: [PATCH v4 08/14] Remove unnecessary Qunbound check Spencer Baugh
2021-05-08 2:09 ` bug#48264: [PATCH v4 09/14] Get rid of buffer_permanent_local_flags array Spencer Baugh
2021-05-08 2:09 ` bug#48264: [PATCH v4 10/14] Delete SET_PER_BUFFER_VALUE_P and buffer local_flags field Spencer Baugh
2021-05-08 2:09 ` bug#48264: [PATCH v4 11/14] Set buffer_defaults fields without a default to Qunbound Spencer Baugh
2021-05-08 2:09 ` bug#48264: [PATCH v4 12/14] Assert that PER_BUFFER_IDX for Lisp variables is not 0 Spencer Baugh
2021-05-08 2:09 ` bug#48264: [PATCH v4 13/14] Remove PER_BUFFER_IDX and buffer_local_flags Spencer Baugh
2021-05-08 2:09 ` bug#48264: [PATCH v4 14/14] Add and use BVAR_FIELD macros Spencer Baugh
2021-05-08 18:06 ` bug#48264: [PATCH v4 00/15] Speeding up setting the default for DEFVAR_PER_BUFFER vars Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-06 21:33 ` bug#48264: [PATCH v3 01/15] Stop checking the constant default for enable_multibyte_characters Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 02/15] Take offset not idx in PER_BUFFER_VALUE_P Spencer Baugh
2021-05-07 7:27 ` Eli Zaretskii
2021-05-07 12:45 ` Spencer Baugh
2021-05-07 12:54 ` Eli Zaretskii
2021-05-06 21:33 ` bug#48264: [PATCH v3 03/15] Add and use BUFFER_DEFAULT_VALUE_P Spencer Baugh
2021-05-07 7:29 ` Eli Zaretskii
2021-05-07 12:49 ` Spencer Baugh
2021-05-07 12:58 ` Eli Zaretskii
2021-05-07 13:38 ` Spencer Baugh
2021-05-07 13:42 ` Eli Zaretskii
2021-05-07 14:30 ` Spencer Baugh
2021-05-07 14:39 ` Eli Zaretskii
2021-05-06 21:33 ` bug#48264: [PATCH v3 04/15] Combine unnecessarily separate loops in buffer.c Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 05/15] Add and use KILL_PER_BUFFER_VALUE Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 06/15] Rearrange set_internal for buffer forwarded symbols Spencer Baugh
2021-05-07 10:45 ` Eli Zaretskii
2021-05-07 14:26 ` Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 07/15] Add BVAR_OR_DEFAULT macro as a stub Spencer Baugh
2021-05-07 10:54 ` Eli Zaretskii
2021-05-07 13:05 ` Spencer Baugh [this message]
2021-05-07 13:12 ` Eli Zaretskii
2021-05-07 13:24 ` Spencer Baugh
2021-05-07 13:32 ` Eli Zaretskii
2021-05-06 21:33 ` bug#48264: [PATCH v3 08/15] Set non-buffer-local BVARs to Qunbound Spencer Baugh
2021-05-07 10:37 ` Eli Zaretskii
2021-05-07 12:54 ` Spencer Baugh
2021-05-07 13:00 ` Eli Zaretskii
2021-05-06 21:33 ` bug#48264: [PATCH v3 09/15] Remove unnecessary Qunbound check Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 10/15] Get rid of buffer_permanent_local_flags array Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 11/15] Delete SET_PER_BUFFER_VALUE_P and buffer local_flags field Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 12/15] Set buffer_defaults fields without a default to Qunbound Spencer Baugh
2021-05-07 10:42 ` Eli Zaretskii
2021-05-07 13:20 ` Spencer Baugh
2021-05-07 13:29 ` Eli Zaretskii
2021-05-07 14:15 ` Spencer Baugh
2021-05-07 14:30 ` Eli Zaretskii
2021-05-07 21:35 ` Spencer Baugh
2021-05-08 6:40 ` Eli Zaretskii
2021-05-08 13:22 ` Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 13/15] Assert that PER_BUFFER_IDX for Lisp variables is not 0 Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 14/15] Remove PER_BUFFER_IDX and buffer_local_flags Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 15/15] Add and use BVAR_FIELD macros Spencer Baugh
2021-05-07 11:03 ` Eli Zaretskii
2021-05-07 12:59 ` Spencer Baugh
2021-05-07 13:08 ` Eli Zaretskii
2021-05-07 21:43 ` Spencer Baugh
2021-05-08 6:55 ` Eli Zaretskii
2021-05-08 13:35 ` Spencer Baugh
2021-05-08 13:58 ` Eli Zaretskii
2021-05-08 17:13 ` Spencer Baugh
2021-05-08 19:03 ` Spencer Baugh
2021-05-09 8:10 ` Eli Zaretskii
2021-05-09 17:09 ` Spencer Baugh
2021-05-09 17:09 ` bug#48264: [PATCH 1/2] Take buffer field name in DEFVAR_PER_BUFFER Spencer Baugh
2021-05-09 17:09 ` bug#48264: [PATCH 2/2] Add compile-time check that BVAR is used correctly Spencer Baugh
2021-05-09 18:09 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-09 18:29 ` Eli Zaretskii
2021-05-10 14:09 ` Spencer Baugh
2022-07-01 12:18 ` bug#48264: 28.0.50; Changing the default for DEFVAR_PER_BUFFER variables takes O(#buffers) time Lars Ingebrigtsen
2022-07-01 18:49 ` Spencer Baugh
2022-07-02 12:00 ` Lars Ingebrigtsen
2022-08-02 11:11 ` Lars Ingebrigtsen
2021-05-09 10:08 ` bug#48264: [PATCH v3 15/15] Add and use BVAR_FIELD macros Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k0oar8x5.fsf@catern.com \
--to=sbaugh@catern.com \
--cc=48264@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.