[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/16] Add BVAR_DEFAULT for access to buffer defaults
From: |
Spencer Baugh |
Subject: |
[PATCH v2 05/16] Add BVAR_DEFAULT for access to buffer defaults |
Date: |
Sat, 21 Nov 2020 21:34:34 -0500 |
This is more direct. This macro can stay as an lvalue even when we
change BVAR to be a function call - directly changing and accessing
buffer_defaults is always fine.
---
src/buffer.h | 3 +++
src/category.h | 2 +-
src/syntax.h | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/buffer.h b/src/buffer.h
index fe549c5dac..2999036300 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -284,6 +284,9 @@ struct buffer_text
#define BVAR(buf, field) ((buf)->field ## _)
+/* Access a BVAR from buffer_defaults */
+#define BVAR_DEFAULT(field) (buffer_defaults.field ## _)
+
/* Max number of builtin per-buffer variables. */
enum { MAX_PER_BUFFER_VARS = 50 };
diff --git a/src/category.h b/src/category.h
index cc32990478..85e872a940 100644
--- a/src/category.h
+++ b/src/category.h
@@ -94,7 +94,7 @@ CHAR_HAS_CATEGORY (int ch, int category)
/* The standard category table is stored where it will automatically
be used in all new buffers. */
-#define Vstandard_category_table BVAR (&buffer_defaults, category_table)
+#define Vstandard_category_table BVAR_DEFAULT (category_table)
/* Return the doc string of CATEGORY in category table TABLE. */
#define CATEGORY_DOCSTRING(table, category) \
diff --git a/src/syntax.h b/src/syntax.h
index a2ec3301ba..9c2bf32057 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -31,7 +31,7 @@ extern void update_syntax_table_forward (ptrdiff_t, bool,
Lisp_Object);
/* The standard syntax table is stored where it will automatically
be used in all new buffers. */
-#define Vstandard_syntax_table BVAR (&buffer_defaults, syntax_table)
+#define Vstandard_syntax_table BVAR_DEFAULT (syntax_table)
/* A syntax table is a chartable whose elements are cons cells
(CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char
--
2.28.0
- Re: ido-switch-buffer is slow with many buffers; others are fast, (continued)
- Re: ido-switch-buffer is slow with many buffers; others are fast, Spencer Baugh, 2020/11/15
- Re: ido-switch-buffer is slow with many buffers; others are fast, Arnold Noronha, 2020/11/15
- [PATCH 02/10] Add bset_save_length and use it, Spencer Baugh, 2020/11/19
- [PATCH 04/10] Use bset_enable_multibyte_characters everywhere, Spencer Baugh, 2020/11/19
- [PATCH 00/10] Speeding up DEFVAR_PER_BUFFER (Was: ido-switch-buffer is slow), Spencer Baugh, 2020/11/19
- Re: [PATCH 00/10] Speeding up DEFVAR_PER_BUFFER, Stefan Monnier, 2020/11/19
- [PATCH v2 00/16] Speeding up DEFVAR_PER_BUFFER, Spencer Baugh, 2020/11/21
- [PATCH v2 01/16] Add a test for let-binding unwinding, Spencer Baugh, 2020/11/21
- Re: [PATCH v2 01/16] Add a test for let-binding unwinding, Stefan Monnier, 2020/11/25
- Re: [PATCH v2 01/16] Add a test for let-binding unwinding, Spencer Baugh, 2020/11/30
- [PATCH v2 05/16] Add BVAR_DEFAULT for access to buffer defaults,
Spencer Baugh <=
- [PATCH v2 02/16] Assert not local-variable-p after setq in let_default binding, Spencer Baugh, 2020/11/21
- Re: [PATCH v2 02/16] Assert not local-variable-p after setq in let_default binding, Stefan Monnier, 2020/11/25
- [PATCH v2 03/16] Stop checking the constant default for enable_multibyte_characters, Spencer Baugh, 2020/11/21
- Re: [PATCH v2 03/16] Stop checking the constant default for enable_multibyte_characters, Stefan Monnier, 2020/11/25
- [PATCH v2 04/16] Take buffer field name in DEFVAR_PER_BUFFER, Spencer Baugh, 2020/11/21
- [PATCH v2 08/16] Combine unnecessarily separate loops in buffer.c, Spencer Baugh, 2020/11/21
- [PATCH v2 09/16] Add and use BUFFER_DEFAULT_VALUE_P, Spencer Baugh, 2020/11/21
- [PATCH v2 06/16] Use bset_* functions instead of BVAR, Spencer Baugh, 2020/11/21
- [PATCH v2 07/16] Take offset not idx in PER_BUFFER_VALUE_P, Spencer Baugh, 2020/11/21
- [PATCH v2 11/16] Assert that PER_BUFFER_IDX for Lisp variables is not 0, Spencer Baugh, 2020/11/21