aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorGerd Moellmann2000-03-27 12:51:06 +0000
committerGerd Moellmann2000-03-27 12:51:06 +0000
commit7313acd0d4b22b006ff245dd35ca12c1fe73c54f (patch)
tree83934f2289ad841f41e8aee7cfdbe30ab8b90060 /src/buffer.c
parentf6cd05276dad073b9299368e33ba02825bdae048 (diff)
downloademacs-7313acd0d4b22b006ff245dd35ca12c1fe73c54f.tar.gz
emacs-7313acd0d4b22b006ff245dd35ca12c1fe73c54f.zip
(buffer_permanent_local_flags): Use MAX_PER_BUFFER_VARS
instead of MAX_BUFFER_LOCAL_VARS. (last_per_buffer_idx): Renamed from max_buffer_local_idx.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/buffer.c b/src/buffer.c
index b57b9d8b183..d54555d3242 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -112,11 +112,11 @@ struct buffer buffer_local_types;
112 112
113/* Flags indicating which built-in buffer-local variables 113/* Flags indicating which built-in buffer-local variables
114 are permanent locals. */ 114 are permanent locals. */
115static char buffer_permanent_local_flags[MAX_BUFFER_LOCAL_VARS]; 115static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS];
116 116
117/* Number of per-buffer variables used. */ 117/* Number of per-buffer variables used. */
118 118
119int max_buffer_local_idx; 119int last_per_buffer_idx;
120 120
121Lisp_Object Fset_buffer (); 121Lisp_Object Fset_buffer ();
122void set_buffer_internal (); 122void set_buffer_internal ();
@@ -596,24 +596,24 @@ reset_buffer_local_variables (b, permanent_too)
596 596
597 /* Reset all (or most) per-buffer variables to their defaults. */ 597 /* Reset all (or most) per-buffer variables to their defaults. */
598 b->local_var_alist = Qnil; 598 b->local_var_alist = Qnil;
599 for (i = 0; i < max_buffer_local_idx; ++i) 599 for (i = 0; i < last_per_buffer_idx; ++i)
600 if (permanent_too || buffer_permanent_local_flags[i] == 0) 600 if (permanent_too || buffer_permanent_local_flags[i] == 0)
601 SET_BUFFER_HAS_LOCAL_VALUE_P (b, i, 0); 601 SET_PER_BUFFER_VALUE_P (b, i, 0);
602 602
603 /* For each slot that has a default value, 603 /* For each slot that has a default value,
604 copy that into the slot. */ 604 copy that into the slot. */
605 605
606 for (offset = BUFFER_LOCAL_VAR_OFFSET (name); 606 for (offset = PER_BUFFER_VAR_OFFSET (name);
607 offset < sizeof *b; 607 offset < sizeof *b;
608 offset += sizeof (Lisp_Object)) 608 offset += sizeof (Lisp_Object))
609 { 609 {
610 int idx = BUFFER_LOCAL_IDX (offset); 610 int idx = PER_BUFFER_IDX (offset);
611 if ((idx > 0 611 if ((idx > 0
612 && (permanent_too 612 && (permanent_too
613 || buffer_permanent_local_flags[idx] == 0)) 613 || buffer_permanent_local_flags[idx] == 0))
614 /* Is -2 used anywhere? */ 614 /* Is -2 used anywhere? */
615 || idx == -2) 615 || idx == -2)
616 BUFFER_LOCAL_VALUE (b, offset) = BUFFER_LOCAL_DEFAULT_VALUE (offset); 616 PER_BUFFER_VALUE (b, offset) = PER_BUFFER_DEFAULT (offset);
617 } 617 }
618} 618}
619 619
@@ -760,16 +760,16 @@ No argument or nil as argument means use current buffer as BUFFER.")
760 { 760 {
761 int offset, idx; 761 int offset, idx;
762 762
763 for (offset = BUFFER_LOCAL_VAR_OFFSET (name); 763 for (offset = PER_BUFFER_VAR_OFFSET (name);
764 offset < sizeof (struct buffer); 764 offset < sizeof (struct buffer);
765 /* sizeof EMACS_INT == sizeof Lisp_Object */ 765 /* sizeof EMACS_INT == sizeof Lisp_Object */
766 offset += (sizeof (EMACS_INT))) 766 offset += (sizeof (EMACS_INT)))
767 { 767 {
768 idx = BUFFER_LOCAL_IDX (offset); 768 idx = PER_BUFFER_IDX (offset);
769 if ((idx == -1 || BUFFER_HAS_LOCAL_VALUE_P (buf, idx)) 769 if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx))
770 && SYMBOLP (BUFFER_LOCAL_SYMBOL (offset))) 770 && SYMBOLP (PER_BUFFER_SYMBOL (offset)))
771 result = Fcons (Fcons (BUFFER_LOCAL_SYMBOL (offset), 771 result = Fcons (Fcons (PER_BUFFER_SYMBOL (offset),
772 BUFFER_LOCAL_VALUE (buf, offset)), 772 PER_BUFFER_VALUE (buf, offset)),
773 result); 773 result);
774 } 774 }
775 } 775 }
@@ -3823,7 +3823,7 @@ buffer_slot_type_mismatch (offset)
3823 Lisp_Object sym; 3823 Lisp_Object sym;
3824 char *type_name; 3824 char *type_name;
3825 3825
3826 switch (XINT (BUFFER_LOCAL_TYPE (offset))) 3826 switch (XINT (PER_BUFFER_TYPE (offset)))
3827 { 3827 {
3828 case Lisp_Int: 3828 case Lisp_Int:
3829 type_name = "integers"; 3829 type_name = "integers";
@@ -3841,7 +3841,7 @@ buffer_slot_type_mismatch (offset)
3841 abort (); 3841 abort ();
3842 } 3842 }
3843 3843
3844 sym = BUFFER_LOCAL_SYMBOL (offset); 3844 sym = PER_BUFFER_SYMBOL (offset);
3845 error ("Only %s should be stored in the buffer-local variable %s", 3845 error ("Only %s should be stored in the buffer-local variable %s",
3846 type_name, XSYMBOL (sym)->name->data); 3846 type_name, XSYMBOL (sym)->name->data);
3847} 3847}
@@ -3978,9 +3978,9 @@ init_buffer_once ()
3978 XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx; 3978 XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx;
3979 3979
3980 /* Need more room? */ 3980 /* Need more room? */
3981 if (idx >= MAX_BUFFER_LOCAL_VARS) 3981 if (idx >= MAX_PER_BUFFER_VARS)
3982 abort (); 3982 abort ();
3983 max_buffer_local_idx = idx; 3983 last_per_buffer_idx = idx;
3984 3984
3985 Vbuffer_alist = Qnil; 3985 Vbuffer_alist = Qnil;
3986 current_buffer = 0; 3986 current_buffer = 0;