diff options
| author | Helmut Eller | 2024-06-23 17:25:21 +0200 |
|---|---|---|
| committer | Helmut Eller | 2026-02-12 18:51:51 +0100 |
| commit | 3442fdd2a2d9702bf9ed856b9bf0a0b1d0992747 (patch) | |
| tree | 90340ebf9863356a779c96dd6ef810cd3aabd5c9 /src/data.c | |
| parent | 163dd21e7305bbd91aecb87cb4968970d1e1e873 (diff) | |
| download | emacs-3442fdd2a2d9702bf9ed856b9bf0a0b1d0992747.tar.gz emacs-3442fdd2a2d9702bf9ed856b9bf0a0b1d0992747.zip | |
Remove struct Lisp_Buffer_Objfwd
* src/lisp.h (struct Lisp_Buffer_Objfwd): Deleted.
(struct Lisp_Fwd): Add the fields bufoffset and bufpredicate.
Make the type a 1-byte bitfield so that the entire struct still
fits in two words.
(XBUFFER_OFFSET): Renamed from XBUFFER_OBJFWD.
* src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer)
(buffer_local_value): Update accordingly.
* src/data.c (do_symval_forwarding, store_symval_forwarding)
(set_internal, default_value, set_default_internal)
(Fmake_local_variable, Fkill_local_variable, Flocal_variable_): Use
XBUFFER_OFFSET.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/data.c b/src/data.c index 6b46a771ba8..5eda4f2f599 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1342,7 +1342,7 @@ do_symval_forwarding (lispfwd valcontents) | |||
| 1342 | 1342 | ||
| 1343 | case Lisp_Fwd_Buffer_Obj: | 1343 | case Lisp_Fwd_Buffer_Obj: |
| 1344 | return per_buffer_value (current_buffer, | 1344 | return per_buffer_value (current_buffer, |
| 1345 | XBUFFER_OBJFWD (valcontents)->offset); | 1345 | XBUFFER_OFFSET (valcontents)); |
| 1346 | 1346 | ||
| 1347 | case Lisp_Fwd_Kboard_Obj: | 1347 | case Lisp_Fwd_Kboard_Obj: |
| 1348 | return *(Lisp_Object *) (XKBOARD_OFFSET (valcontents) | 1348 | return *(Lisp_Object *) (XKBOARD_OFFSET (valcontents) |
| @@ -1457,9 +1457,8 @@ store_symval_forwarding (lispfwd valcontents, Lisp_Object newval, | |||
| 1457 | 1457 | ||
| 1458 | case Lisp_Fwd_Buffer_Obj: | 1458 | case Lisp_Fwd_Buffer_Obj: |
| 1459 | { | 1459 | { |
| 1460 | const struct Lisp_Buffer_Objfwd *fwd = XBUFFER_OBJFWD (valcontents); | 1460 | int offset = XBUFFER_OFFSET (valcontents); |
| 1461 | int offset = fwd->offset; | 1461 | Lisp_Object predicate = valcontents->u.bufpredicate; |
| 1462 | Lisp_Object predicate = fwd->predicate; | ||
| 1463 | 1462 | ||
| 1464 | if (!NILP (newval) && !NILP (predicate)) | 1463 | if (!NILP (newval) && !NILP (predicate)) |
| 1465 | { | 1464 | { |
| @@ -1774,7 +1773,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, | |||
| 1774 | 1773 | ||
| 1775 | if (BUFFER_OBJFWDP (innercontents)) | 1774 | if (BUFFER_OBJFWDP (innercontents)) |
| 1776 | { | 1775 | { |
| 1777 | int offset = XBUFFER_OBJFWD (innercontents)->offset; | 1776 | int offset = XBUFFER_OFFSET (innercontents); |
| 1778 | int idx = PER_BUFFER_IDX (offset); | 1777 | int idx = PER_BUFFER_IDX (offset); |
| 1779 | if (idx > 0 && bindflag == SET_INTERNAL_SET | 1778 | if (idx > 0 && bindflag == SET_INTERNAL_SET |
| 1780 | && !PER_BUFFER_VALUE_P (buf, idx)) | 1779 | && !PER_BUFFER_VALUE_P (buf, idx)) |
| @@ -1956,7 +1955,7 @@ default_value (Lisp_Object symbol) | |||
| 1956 | rather than letting do_symval_forwarding get the current value. */ | 1955 | rather than letting do_symval_forwarding get the current value. */ |
| 1957 | if (BUFFER_OBJFWDP (valcontents)) | 1956 | if (BUFFER_OBJFWDP (valcontents)) |
| 1958 | { | 1957 | { |
| 1959 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 1958 | int offset = XBUFFER_OFFSET (valcontents); |
| 1960 | if (PER_BUFFER_IDX (offset) != 0) | 1959 | if (PER_BUFFER_IDX (offset) != 0) |
| 1961 | return per_buffer_default (offset); | 1960 | return per_buffer_default (offset); |
| 1962 | } | 1961 | } |
| @@ -2051,7 +2050,7 @@ set_default_internal (Lisp_Object symbol, Lisp_Object value, | |||
| 2051 | Make them work apparently like Lisp_Buffer_Local_Value variables. */ | 2050 | Make them work apparently like Lisp_Buffer_Local_Value variables. */ |
| 2052 | if (BUFFER_OBJFWDP (valcontents)) | 2051 | if (BUFFER_OBJFWDP (valcontents)) |
| 2053 | { | 2052 | { |
| 2054 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 2053 | int offset = XBUFFER_OFFSET (valcontents); |
| 2055 | int idx = PER_BUFFER_IDX (offset); | 2054 | int idx = PER_BUFFER_IDX (offset); |
| 2056 | 2055 | ||
| 2057 | set_per_buffer_default (offset, value); | 2056 | set_per_buffer_default (offset, value); |
| @@ -2263,7 +2262,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 2263 | { | 2262 | { |
| 2264 | if (forwarded && BUFFER_OBJFWDP (valcontents.fwd)) | 2263 | if (forwarded && BUFFER_OBJFWDP (valcontents.fwd)) |
| 2265 | { | 2264 | { |
| 2266 | int offset = XBUFFER_OBJFWD (valcontents.fwd)->offset; | 2265 | int offset = XBUFFER_OFFSET (valcontents.fwd); |
| 2267 | int idx = PER_BUFFER_IDX (offset); | 2266 | int idx = PER_BUFFER_IDX (offset); |
| 2268 | eassert (idx); | 2267 | eassert (idx); |
| 2269 | if (idx > 0) | 2268 | if (idx > 0) |
| @@ -2335,7 +2334,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */) | |||
| 2335 | lispfwd valcontents = SYMBOL_FWD (sym); | 2334 | lispfwd valcontents = SYMBOL_FWD (sym); |
| 2336 | if (BUFFER_OBJFWDP (valcontents)) | 2335 | if (BUFFER_OBJFWDP (valcontents)) |
| 2337 | { | 2336 | { |
| 2338 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 2337 | int offset = XBUFFER_OFFSET (valcontents); |
| 2339 | int idx = PER_BUFFER_IDX (offset); | 2338 | int idx = PER_BUFFER_IDX (offset); |
| 2340 | 2339 | ||
| 2341 | if (idx > 0) | 2340 | if (idx > 0) |
| @@ -2416,7 +2415,7 @@ Also see `buffer-local-boundp'.*/) | |||
| 2416 | lispfwd valcontents = SYMBOL_FWD (sym); | 2415 | lispfwd valcontents = SYMBOL_FWD (sym); |
| 2417 | if (BUFFER_OBJFWDP (valcontents)) | 2416 | if (BUFFER_OBJFWDP (valcontents)) |
| 2418 | { | 2417 | { |
| 2419 | int offset = XBUFFER_OBJFWD (valcontents)->offset; | 2418 | int offset = XBUFFER_OFFSET (valcontents); |
| 2420 | int idx = PER_BUFFER_IDX (offset); | 2419 | int idx = PER_BUFFER_IDX (offset); |
| 2421 | if (idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) | 2420 | if (idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) |
| 2422 | return Qt; | 2421 | return Qt; |