struct buffer *current_buffer; /* the current buffer */
/* First buffer in chain of all buffers (in reverse order of creation).
- Threaded through ->next. */
+ Threaded through ->header.next.buffer. */
struct buffer *all_buffers;
int last_per_buffer_idx;
+static Lisp_Object Fset_buffer_major_mode (Lisp_Object);
+static Lisp_Object Fdelete_overlay (Lisp_Object);
static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay,
int after, Lisp_Object arg1,
Lisp_Object arg2, Lisp_Object arg3);
to prevent lossage due to user rplac'ing this alist or its elements. */
Lisp_Object Vbuffer_alist;
-Lisp_Object Qkill_buffer_query_functions;
+static Lisp_Object Qkill_buffer_query_functions;
/* Hook run before changing a major mode. */
-Lisp_Object Qchange_major_mode_hook;
+static Lisp_Object Qchange_major_mode_hook;
Lisp_Object Qfirst_change_hook;
Lisp_Object Qbefore_change_functions;
Lisp_Object Qafter_change_functions;
-Lisp_Object Qucs_set_table_for_input;
+static Lisp_Object Qucs_set_table_for_input;
-Lisp_Object Qfundamental_mode, Qmode_class, Qpermanent_local;
-Lisp_Object Qpermanent_local_hook;
+static Lisp_Object Qfundamental_mode, Qmode_class, Qpermanent_local;
+static Lisp_Object Qpermanent_local_hook;
-Lisp_Object Qprotected_field;
+static Lisp_Object Qprotected_field;
-Lisp_Object QSFundamental; /* A string "Fundamental" */
+static Lisp_Object QSFundamental; /* A string "Fundamental" */
-Lisp_Object Qkill_buffer_hook;
+static Lisp_Object Qkill_buffer_hook;
-Lisp_Object Qget_file_buffer;
+static Lisp_Object Qget_file_buffer;
-Lisp_Object Qoverlayp;
+static Lisp_Object Qoverlayp;
-Lisp_Object Qpriority, Qevaporate, Qbefore_string, Qafter_string;
+Lisp_Object Qpriority, Qbefore_string, Qafter_string;
+static Lisp_Object Qevaporate;
Lisp_Object Qmodification_hooks;
Lisp_Object Qinsert_in_front_hooks;
return Qnil;
}
-/* Incremented for each buffer created, to assign the buffer number. */
-int buffer_count;
-
DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0,
doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new one if needed.
If BUFFER-OR-NAME is a string and a live buffer with that name exists,
b->prevent_redisplay_optimizations_p = 1;
/* Put this on the chain of all buffers including killed ones. */
- b->next = all_buffers;
+ b->header.next.buffer = all_buffers;
all_buffers = b;
/* An ordinary buffer normally doesn't need markers
BVAR (b, width_table) = Qnil;
/* Put this on the chain of all buffers including killed ones. */
- b->next = all_buffers;
+ b->header.next.buffer = all_buffers;
all_buffers = b;
name = Fcopy_sequence (name);
/* Make sure the base buffer has markers for its narrowing. */
if (NILP (BVAR (b->base_buffer, pt_marker)))
{
- eassert (NILP (BVAR (b, begv_marker)));
- eassert (NILP (BVAR (b, zv_marker)));
+ eassert (NILP (BVAR (b->base_buffer, begv_marker)));
+ eassert (NILP (BVAR (b->base_buffer, zv_marker)));
BVAR (b->base_buffer, pt_marker) = Fmake_marker ();
set_marker_both (BVAR (b->base_buffer, pt_marker), base_buffer,
and set-visited-file-name ought to be able to use this to really
rename the buffer properly. */
-DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name, Sgenerate_new_buffer_name,
- 1, 2, 0,
+DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name,
+ Sgenerate_new_buffer_name, 1, 2, 0,
doc: /* Return a string that is the name of no existing buffer based on NAME.
If there is no live buffer named NAME, then return NAME.
Otherwise modify name by appending `<NUMBER>', incrementing NUMBER
If BUFFER is omitted or nil, some interesting buffer is returned. */)
(register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame)
{
- Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer);
register Lisp_Object tail, buf, notsogood, tem, pred, add_ons;
notsogood = Qnil;
GCPRO1 (buffer);
- for (other = all_buffers; other; other = other->next)
+ for (other = all_buffers; other; other = other->header.next.buffer)
/* all_buffers contains dead buffers too;
don't re-kill them. */
if (other->base_buffer == b && !NILP (BVAR (other, name)))
{ /* This is probably harder to make work. */
struct buffer *other;
- for (other = all_buffers; other; other = other->next)
+ for (other = all_buffers; other; other = other->header.next.buffer)
if (other->base_buffer == other_buffer
|| other->base_buffer == current_buffer)
error ("One of the buffers to swap has indirect buffers");
/* Copy this buffer's new multibyte status
into all of its indirect buffers. */
- for (other = all_buffers; other; other = other->next)
+ for (other = all_buffers; other; other = other->header.next.buffer)
if (other->base_buffer == current_buffer && !NILP (BVAR (other, name)))
{
BVAR (other, enable_multibyte_characters)
return flag;
}
\f
-DEFUN ("kill-all-local-variables", Fkill_all_local_variables, Skill_all_local_variables,
- 0, 0, 0,
+DEFUN ("kill-all-local-variables", Fkill_all_local_variables,
+ Skill_all_local_variables, 0, 0, 0,
doc: /* Switch to Fundamental mode by killing current buffer's local variables.
Most local variable bindings are eliminated so that the default values
become effective once more. Also, the syntax table is set from
the normal hook `change-major-mode-hook'. */)
(void)
{
- if (!NILP (Vrun_hooks))
- call1 (Vrun_hooks, Qchange_major_mode_hook);
+ Frun_hooks (1, &Qchange_major_mode_hook);
/* Make sure none of the bindings in local_var_alist
remain swapped in, in their symbols. */
fix_start_end_in_overlays (register EMACS_INT start, register EMACS_INT end)
{
Lisp_Object overlay;
- struct Lisp_Overlay *before_list, *after_list;
+ struct Lisp_Overlay *before_list IF_LINT (= NULL);
+ struct Lisp_Overlay *after_list IF_LINT (= NULL);
/* These are either nil, indicating that before_list or after_list
should be assigned, or the cons cell the cdr of which should be
assigned. */
/* If parent is nil, replace overlays_before; otherwise, parent->next. */
struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair;
Lisp_Object tem;
- EMACS_INT end;
+ EMACS_INT end IF_LINT (= 0);
/* After the insertion, the several overlays may be in incorrect
order. The possibility is that, in the list `overlays_before',
the value is (point-min). */)
(Lisp_Object pos)
{
- int noverlays;
EMACS_INT prevpos;
Lisp_Object *overlay_vec;
int len;
/* Put all the overlays we want in a vector in overlay_vec.
Store the length in len.
prevpos gets the position of the previous change. */
- noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len,
- (EMACS_INT *) 0, &prevpos, 1);
+ overlays_at (XINT (pos), 1, &overlay_vec, &len,
+ (EMACS_INT *) 0, &prevpos, 1);
xfree (overlay_vec);
return make_number (prevpos);
static void
add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay)
{
- int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
+ int oldsize = ASIZE (last_overlay_modification_hooks);
if (last_overlay_modification_hooks_used == oldsize)
last_overlay_modification_hooks = larger_vector
buffer_local_symbols.text = &buffer_local_symbols.own_text;
BUF_INTERVALS (&buffer_defaults) = 0;
BUF_INTERVALS (&buffer_local_symbols) = 0;
- XSETPVECTYPE (&buffer_defaults, PVEC_BUFFER);
+ XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, 0);
XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
- XSETPVECTYPE (&buffer_local_symbols, PVEC_BUFFER);
+ XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, 0);
XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols);
/* Set up the default values of various buffer slots. */
#define DEFVAR_PER_BUFFER(lname, vname, type, doc) \
do { \
static struct Lisp_Buffer_Objfwd bo_fwd; \
- defvar_per_buffer (&bo_fwd, lname, vname, type, 0); \
+ defvar_per_buffer (&bo_fwd, lname, vname, type); \
} while (0)
static void
defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring,
- Lisp_Object *address, Lisp_Object type, char *doc)
+ Lisp_Object *address, Lisp_Object type)
{
struct Lisp_Symbol *sym;
int offset;
bo_fwd->type = Lisp_Fwd_Buffer_Obj;
bo_fwd->offset = offset;
bo_fwd->slottype = type;
+ sym->declared_special = 1;
sym->redirect = SYMBOL_FORWARDED;
{
/* I tried to do the job without a cast, but it seems impossible.
DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width),
make_number (LISP_INT_TAG),
- doc: /* *Distance between tab stops (for display of tab characters), in columns. */);
+ doc: /* *Distance between tab stops (for display of tab characters), in columns.
+This should be an integer greater than zero. */);
DEFVAR_PER_BUFFER ("ctl-arrow", &BVAR (current_buffer, ctl_arrow), Qnil,
doc: /* *Non-nil means display control chars with uparrow.