#include <config.h>
+#define BUFFER_INLINE EXTERN_INLINE
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
Setting the default value also goes through the alist of buffers
and stores into each buffer that does not say it has a local value. */
-DECL_ALIGN (struct buffer, buffer_defaults);
+struct buffer alignas (GCALIGNMENT) buffer_defaults;
/* A Lisp_Object pointer to the above, used for staticpro */
/* This structure holds the names of symbols whose values may be
buffer-local. It is indexed and accessed in the same way as the above. */
-DECL_ALIGN (struct buffer, buffer_local_symbols);
+struct buffer alignas (GCALIGNMENT) buffer_local_symbols;
/* A Lisp_Object pointer to the above, used for staticpro */
static Lisp_Object Vbuffer_local_symbols;
Lisp_Object args[3];
CHECK_FRAME (frame);
- framelist = Fcopy_sequence (XFRAME (frame)->buffer_list);
+ framelist = Fcopy_sequence (FVAR (XFRAME (frame), buffer_list));
prevlist = Fnreverse (Fcopy_sequence
- (XFRAME (frame)->buried_buffer_list));
+ (FVAR (XFRAME (frame), buried_buffer_list)));
/* Remove from GENERAL any buffer that duplicates one in
FRAMELIST or PREVLIST. */
Lisp_Object overlay, start, end;
struct Lisp_Marker *m;
- eassert (MARKERP (list->start));
- m = XMARKER (list->start);
+ eassert (MARKERP (MVAR (list, start)));
+ m = XMARKER (MVAR (list, start));
start = build_marker (b, m->charpos, m->bytepos);
XMARKER (start)->insertion_type = m->insertion_type;
- eassert (MARKERP (list->end));
- m = XMARKER (list->end);
+ eassert (MARKERP (MVAR (list, end)));
+ m = XMARKER (MVAR (list, end));
end = build_marker (b, m->charpos, m->bytepos);
XMARKER (end)->insertion_type = m->insertion_type;
- overlay = build_overlay (start, end, Fcopy_sequence (list->plist));
+ overlay = build_overlay (start, end, Fcopy_sequence (MVAR (list, plist)));
if (tail)
tail = tail->next = XOVERLAY (overlay);
else
static void
drop_overlay (struct buffer *b, struct Lisp_Overlay *ov)
{
- eassert (b == XBUFFER (Fmarker_buffer (ov->start)));
- modify_overlay (b, marker_position (ov->start), marker_position (ov->end));
- Fset_marker (ov->start, Qnil, Qnil);
- Fset_marker (ov->end, Qnil, Qnil);
+ eassert (b == XBUFFER (Fmarker_buffer (MVAR (ov, start))));
+ modify_overlay (b, marker_position (MVAR (ov, start)),
+ marker_position (MVAR (ov, end)));
+ Fset_marker (MVAR (ov, start), Qnil, Qnil);
+ Fset_marker (MVAR (ov, end), Qnil, Qnil);
}
pred = frame_buffer_predicate (frame);
/* Consider buffers that have been seen in the frame first. */
- tail = XFRAME (frame)->buffer_list;
+ tail = FVAR (XFRAME (frame), buffer_list);
for (; CONSP (tail); tail = XCDR (tail))
{
buf = XCAR (tail);
/* Skip dead buffers, indirect buffers and buffers
which aren't changed since last compaction. */
- if (!NILP (buffer->BUFFER_INTERNAL_FIELD (name))
+ if (!NILP (buffer->INTERNAL_FIELD (name))
&& (buffer->base_buffer == NULL)
&& (buffer->text->compact != buffer->text->modiff))
{
turned off in that buffer. Calling truncate_undo_list on
Qt tends to return NULL, which effectively turns undo back on.
So don't call truncate_undo_list if undo_list is Qt. */
- if (!EQ (buffer->BUFFER_INTERNAL_FIELD (undo_list), Qt))
+ if (!EQ (buffer->INTERNAL_FIELD (undo_list), Qt))
truncate_undo_list (buffer);
/* Shrink buffer gaps. */
since anything can happen within do_yes_or_no_p. */
/* Don't kill the minibuffer now current. */
- if (EQ (buffer, XWINDOW (minibuf_window)->buffer))
+ if (EQ (buffer, WVAR (XWINDOW (minibuf_window), buffer)))
return Qnil;
/* When we kill an ordinary buffer which shares it's buffer text
/* If the buffer now current is shown in the minibuffer and our buffer
is the sole other buffer give up. */
XSETBUFFER (tem, current_buffer);
- if (EQ (tem, XWINDOW (minibuf_window)->buffer)
+ if (EQ (tem, WVAR (XWINDOW (minibuf_window), buffer))
&& EQ (buffer, Fother_buffer (buffer, Qnil, Qnil)))
return Qnil;
Vinhibit_quit = tem;
/* Update buffer list of selected frame. */
- f->buffer_list = Fcons (buffer, Fdelq (buffer, f->buffer_list));
- f->buried_buffer_list = Fdelq (buffer, f->buried_buffer_list);
+ FVAR (f, buffer_list) = Fcons (buffer, Fdelq (buffer, FVAR (f, buffer_list)));
+ FVAR (f, buried_buffer_list) = Fdelq (buffer, FVAR (f, buried_buffer_list));
/* Run buffer-list-update-hook. */
if (!NILP (Vrun_hooks))
Vinhibit_quit = tem;
/* Update buffer lists of selected frame. */
- f->buffer_list = Fdelq (buffer, f->buffer_list);
- f->buried_buffer_list = Fcons (buffer, Fdelq (buffer, f->buried_buffer_list));
+ FVAR (f, buffer_list) = Fdelq (buffer, FVAR (f, buffer_list));
+ FVAR (f, buried_buffer_list)
+ = Fcons (buffer, Fdelq (buffer, FVAR (f, buried_buffer_list)));
/* Run buffer-list-update-hook. */
if (!NILP (Vrun_hooks))
while (NILP (Fmemq (w, ws)))
{
ws = Fcons (w, ws);
- if (MARKERP (XWINDOW (w)->pointm)
- && (EQ (XWINDOW (w)->buffer, buf1)
- || EQ (XWINDOW (w)->buffer, buf2)))
- Fset_marker (XWINDOW (w)->pointm,
- make_number (BUF_BEGV (XBUFFER (XWINDOW (w)->buffer))),
- XWINDOW (w)->buffer);
+ if (MARKERP (WVAR (XWINDOW (w), pointm))
+ && (EQ (WVAR (XWINDOW (w), buffer), buf1)
+ || EQ (WVAR (XWINDOW (w), buffer), buf2)))
+ Fset_marker (WVAR (XWINDOW (w), pointm),
+ make_number
+ (BUF_BEGV (XBUFFER (WVAR (XWINDOW (w), buffer)))),
+ WVAR (XWINDOW (w), buffer));
w = Fnext_window (w, Qt, Qt);
}
}
/* If this is a buffer not in the selected window,
we must do other windows. */
- if (buf != XBUFFER (XWINDOW (selected_window)->buffer))
+ if (buf != XBUFFER (WVAR (XWINDOW (selected_window), buffer)))
windows_or_buffers_changed = 1;
/* If multiple windows show this buffer, we must do other windows. */
else if (buffer_shared > 1)
{
CHECK_OVERLAY (overlay);
- return Fcopy_sequence (XOVERLAY (overlay)->plist);
+ return Fcopy_sequence (MVAR (XOVERLAY (overlay), plist));
}
\f
(Lisp_Object overlay, Lisp_Object prop)
{
CHECK_OVERLAY (overlay);
- return lookup_char_property (XOVERLAY (overlay)->plist, prop, 0);
+ return lookup_char_property (MVAR (XOVERLAY (overlay), plist), prop, 0);
}
DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0,
buffer = Fmarker_buffer (OVERLAY_START (overlay));
- for (tail = XOVERLAY (overlay)->plist;
+ for (tail = MVAR (XOVERLAY (overlay), plist);
CONSP (tail) && CONSP (XCDR (tail));
tail = XCDR (XCDR (tail)))
if (EQ (XCAR (tail), prop))
}
/* It wasn't in the list, so add it to the front. */
changed = !NILP (value);
- XOVERLAY (overlay)->plist
- = Fcons (prop, Fcons (value, XOVERLAY (overlay)->plist));
+ MVAR (XOVERLAY (overlay), plist)
+ = Fcons (prop, Fcons (value, MVAR (XOVERLAY (overlay), plist)));
found:
if (! NILP (buffer))
{
doc: /* Non-nil if searches and matches should ignore case. */);
DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column),
- make_number (LISP_INT_TAG),
+ make_number (Lisp_Int0),
doc: /* Column beyond which automatic line-wrapping should happen.
Interactively, you can set the buffer local value using \\[set-fill-column]. */);
DEFVAR_PER_BUFFER ("left-margin", &BVAR (current_buffer, left_margin),
- make_number (LISP_INT_TAG),
+ make_number (Lisp_Int0),
doc: /* Column for the default `indent-line-function' to indent to.
Linefeed indents to this column in Fundamental mode. */);
DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width),
- make_number (LISP_INT_TAG),
+ make_number (Lisp_Int0),
doc: /* Distance between tab stops (for display of tab characters), in columns.
This should be an integer greater than zero. */);
Backing up is done before the first time the file is saved. */);
DEFVAR_PER_BUFFER ("buffer-saved-size", &BVAR (current_buffer, save_length),
- make_number (LISP_INT_TAG),
+ make_number (Lisp_Int0),
doc: /* Length of current buffer when last read in, saved or auto-saved.
0 initially.
-1 means auto-saving turned off until next real save.