/* Buffer manipulation primitives for GNU Emacs.
- Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000, 2001, 2002
+ Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000, 2001, 02, 2003
Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* List of functions to call that can query about killing a buffer.
If any of these functions returns nil, we don't kill it. */
Lisp_Object Vkill_buffer_query_functions;
+Lisp_Object Qkill_buffer_query_functions;
/* List of functions to call before changing an unmodified buffer. */
Lisp_Object Vfirst_change_hook;
Lisp_Object Qfirst_change_hook;
Lisp_Object Qbefore_change_functions;
Lisp_Object Qafter_change_functions;
+Lisp_Object Qucs_set_table_for_input;
/* If nonzero, all modification hooks are suppressed. */
int inhibit_modification_hooks;
Lisp_Object Qmodification_hooks;
Lisp_Object Qinsert_in_front_hooks;
Lisp_Object Qinsert_behind_hooks;
-Lisp_Object Qset_buffer_major_mode_hook;
static void alloc_buffer_text P_ ((struct buffer *, size_t));
static void free_buffer_text P_ ((struct buffer *b));
reset_buffer (b);
reset_buffer_local_variables (b, 1);
+ b->mark = Fmake_marker ();
+ BUF_MARKERS (b) = NULL;
+ b->name = name;
+
/* Put this in the alist of all live buffers. */
XSETBUFFER (buf, b);
Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
- b->mark = Fmake_marker ();
- BUF_MARKERS (b) = Qnil;
- b->name = name;
+ /* An error in calling the function here (should someone redfine it)
+ can lead to infinite regress until you run out of stack. rms
+ says that's not worth protecting against. */
+ if (!NILP (Ffboundp (Qucs_set_table_for_input)))
+ /* buf is on buffer-alist, so no gcpro. */
+ call1 (Qucs_set_table_for_input, buf);
+
return buf;
}
OVERLAY_START (overlay) = start;
OVERLAY_END (overlay) = end;
OVERLAY_PLIST (overlay) = Fcopy_sequence (OVERLAY_PLIST (old_overlay));
-
+
result = Fcons (overlay, result);
}
return Fnreverse (result);
}
-
+
/* Clone per-buffer values of buffer FROM.
int offset;
XSETBUFFER (to_buffer, to);
-
+
for (offset = PER_BUFFER_VAR_OFFSET (name) + sizeof (Lisp_Object);
offset < sizeof *to;
offset += sizeof (Lisp_Object))
}
bcopy (from->local_flags, to->local_flags, sizeof to->local_flags);
-
+
to->overlays_before = copy_overlays (to, from->overlays_before);
to->overlays_after = copy_overlays (to, from->overlays_after);
}
We ignore it here. */
b->major_mode = Qfundamental_mode;
b->keymap = Qnil;
- b->abbrev_table = Vfundamental_mode_abbrev_table;
b->mode_name = QSFundamental;
b->minor_modes = Qnil;
}
DEFUN ("buffer-local-value", Fbuffer_local_value,
- Sbuffer_local_value, 2, 2, 0,
+ Sbuffer_local_value, 2, 2, 0,
doc: /* Return the value of VARIABLE in BUFFER.
If VARIABLE does not have a buffer-local binding in BUFFER, the value
is the default binding of variable. */)
/* Look in local_var_list */
result = Fassoc (symbol, buf->local_var_alist);
- if (NILP (result))
+ if (NILP (result))
{
int offset, idx;
int found = 0;
{
idx = PER_BUFFER_IDX (offset);
if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx))
- && SYMBOLP (PER_BUFFER_SYMBOL (offset))
- && EQ (PER_BUFFER_SYMBOL (offset), symbol))
+ && SYMBOLP (PER_BUFFER_SYMBOL (offset))
+ && EQ (PER_BUFFER_SYMBOL (offset), symbol))
{
result = PER_BUFFER_VALUE (buf, offset);
found = 1;
#endif /* CLASH_DETECTION */
SAVE_MODIFF = NILP (flag) ? MODIFF : 0;
-
+
/* Set update_mode_lines only if buffer is displayed in some window.
Packages like jit-lock or lazy-lock preserve a buffer's modified
state by recording/restoring the state around blocks of code.
++update_mode_lines;
current_buffer->prevent_redisplay_optimizations_p = 1;
}
-
+
return flag;
}
{
#ifdef CLASH_DETECTION
Lisp_Object fn;
-
+
/* If buffer becoming modified, lock the file.
If buffer becoming unmodified, unlock the file. */
unlock_file (fn);
}
#endif /* CLASH_DETECTION */
-
+
SAVE_MODIFF = NILP (flag) ? MODIFF : 0;
return flag;
}
/* Consider buffers that have been seen in the selected frame
before other buffers. */
-
+
tem = frame_buffer_list (frame);
add_ons = Qnil;
while (CONSP (tem))
&& BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
{
GCPRO1 (buf);
- tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ",
- SDATA (b->name)));
+ tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ",
+ b->name, make_number (0)));
UNGCPRO;
if (NILP (tem))
return Qnil;
/* Run hooks with the buffer to be killed the current buffer. */
{
int count = SPECPDL_INDEX ();
- Lisp_Object list;
+ Lisp_Object arglist[1];
record_unwind_protect (save_excursion_restore, save_excursion_save ());
set_buffer_internal (b);
/* First run the query functions; if any query is answered no,
don't kill the buffer. */
- for (list = Vkill_buffer_query_functions; CONSP (list); list = XCDR (list))
- {
- tem = call0 (XCAR (list));
- if (NILP (tem))
- return unbind_to (count, Qnil);
- }
+ arglist[0] = Qkill_buffer_query_functions;
+ if (NILP (Frun_hook_with_args_until_failure (1, arglist)))
+ return unbind_to (count, Qnil);
/* Then run the hooks. */
Frun_hooks (1, &Qkill_buffer_hook);
UNGCPRO;
}
-
+
/* Make this buffer not be current.
In the process, notice if this is the sole visible buffer
and give up if so. */
/* Unchain all markers that belong to this indirect buffer.
Don't unchain the markers that belong to the base buffer
or its other indirect buffers. */
- for (tem = BUF_MARKERS (b); !NILP (tem); )
+ for (m = BUF_MARKERS (b); m; )
{
- Lisp_Object next;
- m = XMARKER (tem);
- next = m->chain;
+ struct Lisp_Marker *next = m->next;
if (m->buffer == b)
- unchain_marker (tem);
- tem = next;
+ unchain_marker (m);
+ m = next;
}
}
else
{
/* Unchain all markers of this buffer and its indirect buffers.
and leave them pointing nowhere. */
- for (tem = BUF_MARKERS (b); !NILP (tem); )
+ for (m = BUF_MARKERS (b); m; )
{
- m = XMARKER (tem);
+ struct Lisp_Marker *next = m->next;
m->buffer = 0;
- tem = m->chain;
- m->chain = Qnil;
+ m->next = NULL;
+ m = next;
}
- BUF_MARKERS (b) = Qnil;
+ BUF_MARKERS (b) = NULL;
BUF_INTERVALS (b) = NULL_INTERVAL;
/* Perhaps we should explicitly free the interval tree here... */
Vbuffer_alist = XCDR (Vbuffer_alist);
else
XSETCDR (prev, XCDR (XCDR (prev)));
-
+
XSETCDR (link, Vbuffer_alist);
Vbuffer_alist = link;
XCDR (frame_buffer_list (frame)));
else
XSETCDR (prev, XCDR (XCDR (prev)));
-
+
XSETCDR (link, frame_buffer_list (frame));
set_frame_buffer_list (frame, link);
}
&& NILP (Fget (current_buffer->major_mode, Qmode_class)))
function = current_buffer->major_mode;
}
-
+
+ if (NILP (function) || EQ (function, Qfundamental_mode))
+ return Qnil;
+
count = SPECPDL_INDEX ();
- /* To select a nonfundamental mode, select the buffer temporarily
- and then call the mode function. Run the hook anyhow. */
+ /* To select a nonfundamental mode,
+ select the buffer temporarily and then call the mode function. */
record_unwind_protect (save_excursion_restore, save_excursion_save ());
Fset_buffer (buffer);
- if (NILP (function) || EQ (function, Qfundamental_mode))
- call0 (function);
- Frun_hooks (1, &Qset_buffer_major_mode_hook);
+ call0 (function);
return unbind_to (count, Qnil);
}
Fset_window_buffer (EQ (selected_window, minibuf_window)
? Fnext_window (minibuf_window, Qnil, Qnil)
: selected_window,
- buf);
+ buf, Qnil);
return buf;
}
}
Fset_buffer (buf);
if (NILP (norecord))
- /* This seems bogus since Fselect_window will call record_buffer anyway. */
+ /* Why bother ? Fselect_window will do it for us anyway. -stef */
record_buffer (buf);
- Fselect_window (Fdisplay_buffer (buf, other_window, Qnil));
+ Fselect_window (Fdisplay_buffer (buf, other_window, Qnil), norecord);
return buf;
}
if (b->text->beg == NULL)
enlarge_buffer_text (b, 0);
#endif /* USE_MMAP_FOR_BUFFERS */
-
+
if (current_buffer == b)
return;
/* Look down buffer's list of local Lisp variables
to find and update any that forward into C variables. */
- for (tail = b->local_var_alist; !NILP (tail); tail = XCDR (tail))
+ for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
{
valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
if ((BUFFER_LOCAL_VALUEP (valcontents)
/* Do the same with any others that were local to the previous buffer */
if (old_buf)
- for (tail = old_buf->local_var_alist; !NILP (tail); tail = XCDR (tail))
+ for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
{
valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
if ((BUFFER_LOCAL_VALUEP (valcontents)
else
{
Lisp_Object buf1;
-
+
buf1 = Fget_buffer (buffer);
if (NILP (buf1))
nsberror (buffer);
(flag)
Lisp_Object flag;
{
- Lisp_Object tail, markers;
+ struct Lisp_Marker *tail, *markers;
struct buffer *other;
int undo_enabled_p = !EQ (current_buffer->undo_list, Qt);
- int begv = BEGV, zv = ZV;
- int narrowed = (BEG != begv || Z != zv);
+ int begv, zv;
+ int narrowed = (BEG != BEGV || Z != ZV);
int modified_p = !NILP (Fbuffer_modified_p (Qnil));
if (current_buffer->base_buffer)
/* If the cached position is for this buffer, clear it out. */
clear_charpos_cache (current_buffer);
+ if (NILP (flag))
+ begv = BEGV_BYTE, zv = ZV_BYTE;
+ else
+ begv = BEGV, zv = ZV;
+
if (narrowed)
Fwiden ();
GPT = GPT_BYTE;
TEMP_SET_PT_BOTH (PT_BYTE, PT_BYTE);
- tail = BUF_MARKERS (current_buffer);
- while (! NILP (tail))
- {
- XMARKER (tail)->charpos = XMARKER (tail)->bytepos;
- tail = XMARKER (tail)->chain;
- }
+
+ for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
+ tail->charpos = tail->bytepos;
/* Convert multibyte form of 8-bit characters to unibyte. */
pos = BEG;
p = GAP_END_ADDR;
stop = Z;
}
-
+
if (UNIBYTE_STR_AS_MULTIBYTE_P (p, stop - pos, bytes))
p += bytes, pos += bytes;
else
/* This prevents BYTE_TO_CHAR (that is, buf_bytepos_to_charpos) from
getting confused by the markers that have not yet been updated.
It is also a signal that it should never create a marker. */
- BUF_MARKERS (current_buffer) = Qnil;
+ BUF_MARKERS (current_buffer) = NULL;
- while (! NILP (tail))
+ for (; tail; tail = tail->next)
{
- XMARKER (tail)->bytepos
- = advance_to_char_boundary (XMARKER (tail)->bytepos);
- XMARKER (tail)->charpos = BYTE_TO_CHAR (XMARKER (tail)->bytepos);
-
- tail = XMARKER (tail)->chain;
+ tail->bytepos = advance_to_char_boundary (tail->bytepos);
+ tail->charpos = BYTE_TO_CHAR (tail->bytepos);
}
/* Make sure no markers were put on the chain
while the chain value was incorrect. */
- if (! EQ (BUF_MARKERS (current_buffer), Qnil))
+ if (BUF_MARKERS (current_buffer))
abort ();
BUF_MARKERS (current_buffer) = markers;
if (!modified_p && !NILP (Fbuffer_modified_p (Qnil)))
Fset_buffer_modified_p (Qnil);
+#ifdef subprocesses
+ /* Update coding systems of this buffer's process (if any). */
+ {
+ Lisp_Object process;
+
+ process = Fget_buffer_process (Fcurrent_buffer ());
+ if (PROCESSP (process))
+ setup_process_coding_systems (process);
+ }
+#endif /* subprocesses */
+
return flag;
}
\f
/* Any which are supposed to be permanent,
make local again, with the same values they had. */
-
+
for (alist = oalist; !NILP (alist); alist = XCDR (alist))
{
sym = XCAR (XCAR (alist));
}
\f
/* Find all the overlays in the current buffer that contain position POS.
- Return the number found, and store them in a vector in *VEC_PTR.
+ Return the number found, and store them in a vector in *VEC_PTR.
Store in *LEN_PTR the size allocated for the vector.
Store in *NEXT_PTR the next position after POS where an overlay starts,
or ZV if there are no more overlays.
/* Find all the overlays in the current buffer that overlap the range BEG-END
or are empty at BEG.
- Return the number found, and store them in a vector in *VEC_PTR.
+ Return the number found, and store them in a vector in *VEC_PTR.
Store in *LEN_PTR the size allocated for the vector.
Store in *NEXT_PTR the next position after POS where an overlay starts,
or ZV if there are no more overlays.
and we store only as many overlays as will fit.
But we still return the total number of overlays. */
-int
+static int
overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr)
int beg, end;
int extend;
int end = OVERLAY_POSITION (OVERLAY_END (overlay));
int n, i, size;
Lisp_Object *v, tem;
-
+
size = 10;
v = (Lisp_Object *) alloca (size * sizeof *v);
n = overlays_in (start, end, 0, &v, &size, NULL, NULL);
XOVERLAY (overlay)->end = end;
XOVERLAY (overlay)->plist = Qnil;
- /* Put the new overlay on the wrong list. */
+ /* Put the new overlay on the wrong list. */
end = OVERLAY_END (overlay);
if (OVERLAY_POSITION (end) < XINT (b->overlay_center))
b->overlays_after = Fcons (overlay, b->overlays_after);
}
BUF_COMPUTE_UNCHANGED (buf, start, end);
-
+
/* If this is a buffer not in the selected window,
we must do other windows. */
if (buf != XBUFFER (XWINDOW (selected_window)->buffer))
Fset_marker (OVERLAY_START (overlay), beg, buffer);
Fset_marker (OVERLAY_END (overlay), end, buffer);
- /* Put the overlay on the wrong list. */
+ /* Put the overlay on the wrong list. */
end = OVERLAY_END (overlay);
if (OVERLAY_POSITION (end) < XINT (b->overlay_center))
b->overlays_after = Fcons (overlay, b->overlays_after);
b = XBUFFER (buffer);
specbind (Qinhibit_quit, Qt);
-
+
b->overlays_before = Fdelq (overlay, b->overlays_before);
b->overlays_after = Fdelq (overlay, b->overlays_after);
modify_overlay (b,
}
DEFUN ("overlay-recenter", Foverlay_recenter, Soverlay_recenter, 1, 1, 0,
- doc: /* Recenter the overlays of the current buffer around position POS. */)
+ doc: /* Recenter the overlays of the current buffer around position POS.
+That makes overlay lookup faster for positions near POS (but perhaps slower
+for positions far away from POS). */)
(pos)
Lisp_Object pos;
{
{
Lisp_Object sym;
char *type_name;
-
+
switch (XINT (PER_BUFFER_TYPE (offset)))
{
case Lisp_Int:
type_name = "integers";
break;
-
+
case Lisp_String:
type_name = "strings";
break;
-
+
case Lisp_Symbol:
type_name = "symbols";
break;
-
+
default:
abort ();
}
{
/* User-specified size. */
size_t nbytes_specified;
-
+
/* Number of bytes mapped */
size_t nbytes_mapped;
{
struct mmap_region *r;
char *s = (char *) start, *e = (char *) end;
-
+
for (r = mmap_regions; r; r = r->next)
{
char *rstart = (char *) r;
r->prev->next = r->next;
else
mmap_regions = r->next;
-
+
if (munmap ((POINTER_TYPE *) r, r->nbytes_mapped) == -1)
{
fprintf (stderr, "munmap: %s\n", emacs_strerror (errno));
else if (npages > 0)
{
nbytes = npages * mmap_page_size;
-
+
/* Try to map additional pages at the end of the region. We
cannot do this if the address range is already occupied by
something else because mmap deletes any previous mapping.
if (!MMAP_ALLOCATED_P (region_end, region_end + nbytes))
{
POINTER_TYPE *p;
-
+
p = mmap (region_end, nbytes, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE | MAP_FIXED, mmap_fd, 0);
if (p == MAP_FAILED)
map = ROUND (nbytes + MMAP_REGION_STRUCT_SIZE, mmap_page_size);
p = mmap (NULL, map, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE,
mmap_fd, 0);
-
+
if (p == MAP_FAILED)
{
if (errno != ENOMEM)
else
{
struct mmap_region *r = (struct mmap_region *) p;
-
+
r->nbytes_specified = nbytes;
r->nbytes_mapped = map;
r->var = var;
if (r->next)
r->next->prev = r;
mmap_regions = r;
-
+
p = MMAP_USER_AREA (p);
}
-
+
return *var = p;
}
size_t nbytes;
{
POINTER_TYPE *result;
-
+
mmap_init ();
if (*var == NULL)
result = mmap_alloc (var, nbytes);
- else if (nbytes == 0)
+ else if (nbytes == 0)
{
mmap_free (var);
result = mmap_alloc (var, nbytes);
{
struct mmap_region *r = MMAP_REGION (*var);
size_t room = r->nbytes_mapped - MMAP_REGION_STRUCT_SIZE;
-
+
if (room < nbytes)
{
/* Must enlarge. */
POINTER_TYPE **var;
{
mmap_init ();
-
+
if (*var)
{
mmap_free_1 (MMAP_REGION (*var));
if (mmap_initialized_p)
return;
mmap_initialized_p = 1;
-
+
#if MAP_ANON != 0
mmap_fd = -1;
#endif
-
+
mmap_page_size = getpagesize ();
}
size_t nbytes;
{
POINTER_TYPE *p;
-
+
BLOCK_INPUT;
#if defined USE_MMAP_FOR_BUFFERS
p = mmap_alloc ((POINTER_TYPE **) &b->text->beg, nbytes);
#else
p = xmalloc (nbytes);
#endif
-
+
if (p == NULL)
{
UNBLOCK_INPUT;
#else
p = xrealloc (b->text->beg, nbytes);
#endif
-
+
if (p == NULL)
{
UNBLOCK_INPUT;
#else
xfree (b->text->beg);
#endif
-
+
BUF_BEG_ADDR (b) = NULL;
UNBLOCK_INPUT;
}
buffer_defaults.cache_long_line_scans = Qnil;
buffer_defaults.file_truename = Qnil;
XSETFASTINT (buffer_defaults.display_count, 0);
+ XSETFASTINT (buffer_defaults.left_margin_cols, 0);
+ XSETFASTINT (buffer_defaults.right_margin_cols, 0);
+ buffer_defaults.left_fringe_width = Qnil;
+ buffer_defaults.right_fringe_width = Qnil;
+ buffer_defaults.fringes_outside_margins = Qnil;
+ buffer_defaults.scroll_bar_width = Qnil;
+ buffer_defaults.vertical_scroll_bar_type = Qt;
buffer_defaults.indicate_empty_lines = Qnil;
buffer_defaults.scroll_up_aggressively = Qnil;
buffer_defaults.scroll_down_aggressively = Qnil;
XSETFASTINT (buffer_local_flags.cache_long_line_scans, idx); ++idx;
XSETFASTINT (buffer_local_flags.category_table, idx); ++idx;
XSETFASTINT (buffer_local_flags.direction_reversed, idx); ++idx;
- XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx);
+ XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx);
/* Make this one a permanent local. */
buffer_permanent_local_flags[idx++] = 1;
- XSETFASTINT (buffer_local_flags.left_margin_width, idx); ++idx;
- XSETFASTINT (buffer_local_flags.right_margin_width, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.left_margin_cols, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.right_margin_cols, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.left_fringe_width, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.right_fringe_width, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.fringes_outside_margins, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.scroll_bar_width, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.vertical_scroll_bar_type, idx); ++idx;
XSETFASTINT (buffer_local_flags.indicate_empty_lines, idx); ++idx;
XSETFASTINT (buffer_local_flags.scroll_up_aggressively, idx); ++idx;
XSETFASTINT (buffer_local_flags.scroll_down_aggressively, idx); ++idx;
if (idx >= MAX_PER_BUFFER_VARS)
abort ();
last_per_buffer_idx = idx;
-
+
Vbuffer_alist = Qnil;
current_buffer = 0;
all_buffers = 0;
Qpermanent_local = intern ("permanent-local");
Qkill_buffer_hook = intern ("kill-buffer-hook");
+ Fput (Qkill_buffer_hook, Qpermanent_local, Qt);
+
+ Qucs_set_table_for_input = intern ("ucs-set-table-for-input");
Vprin1_to_string_buffer = Fget_buffer_create (build_string (" prin1"));
text pointers will have been set to null in the dumped Emacs.
Map new memory. */
struct buffer *b;
-
+
for (b = all_buffers; b; b = b->next)
if (b->text->beg == NULL)
enlarge_buffer_text (b, 0);
}
#endif /* USE_MMAP_FOR_BUFFERS */
-
+
Fset_buffer (Fget_buffer_create (build_string ("*scratch*")));
if (NILP (buffer_defaults.enable_multibyte_characters))
Fset_buffer_multibyte (Qnil);
staticpro (&Qbefore_change_functions);
Qafter_change_functions = intern ("after-change-functions");
staticpro (&Qafter_change_functions);
- Qset_buffer_major_mode_hook = intern ("set-buffer-major-mode-hook");
- staticpro (&Qset_buffer_major_mode_hook);
+ staticpro (&Qucs_set_table_for_input);
+
+ Qkill_buffer_query_functions = intern ("kill-buffer-query-functions");
+ staticpro (&Qkill_buffer_query_functions);
Fput (Qprotected_field, Qerror_conditions,
Fcons (Qprotected_field, Fcons (Qerror, Qnil)));
DEFVAR_LISP_NOPRO ("default-direction-reversed",
&buffer_defaults.direction_reversed,
- doc: /* Default value of `direction_reversed' for buffers that do not override it.
+ doc: /* Default value of `direction-reversed' for buffers that do not override it.
This is the same as (default-value 'direction-reversed). */);
-
+
DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters",
&buffer_defaults.enable_multibyte_characters,
doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it.
This is the same as (default-value 'enable-multibyte-characters). */);
-
+
DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system",
&buffer_defaults.buffer_file_coding_system,
doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it.
This is the same as (default-value 'buffer-file-coding-system). */);
-
+
DEFVAR_LISP_NOPRO ("default-truncate-lines",
&buffer_defaults.truncate_lines,
doc: /* Default value of `truncate-lines' for buffers that do not override it.
This is the same as (default-value 'case-fold-search). */);
#ifdef DOS_NT
- DEFVAR_LISP_NOPRO ("default-buffer-file-type",
+ DEFVAR_LISP_NOPRO ("default-buffer-file-type",
&buffer_defaults.buffer_file_type,
doc: /* Default file type for buffers that do not override it.
This is the same as (default-value 'buffer-file-type).
#endif
DEFVAR_LISP_NOPRO ("default-left-margin-width",
- &buffer_defaults.left_margin_width,
+ &buffer_defaults.left_margin_cols,
doc: /* Default value of `left-margin-width' for buffers that don't override it.
This is the same as (default-value 'left-margin-width). */);
DEFVAR_LISP_NOPRO ("default-right-margin-width",
- &buffer_defaults.right_margin_width,
- doc: /* Default value of `right_margin_width' for buffers that don't override it.
+ &buffer_defaults.right_margin_cols,
+ doc: /* Default value of `right-margin-width' for buffers that don't override it.
This is the same as (default-value 'right-margin-width). */);
-
+
+ DEFVAR_LISP_NOPRO ("default-left-fringe-width",
+ &buffer_defaults.left_fringe_width,
+ doc: /* Default value of `left-fringe-width' for buffers that don't override it.
+This is the same as (default-value 'left-fringe-width). */);
+
+ DEFVAR_LISP_NOPRO ("default-right-fringe-width",
+ &buffer_defaults.right_fringe_width,
+ doc: /* Default value of `right-fringe-width' for buffers that don't override it.
+This is the same as (default-value 'right-fringe-width). */);
+
+ DEFVAR_LISP_NOPRO ("default-fringes-outside-margins",
+ &buffer_defaults.fringes_outside_margins,
+ doc: /* Default value of `fringes-outside-margins' for buffers that don't override it.
+This is the same as (default-value 'fringes-outside-margins). */);
+
+ DEFVAR_LISP_NOPRO ("default-scroll-bar-width",
+ &buffer_defaults.scroll_bar_width,
+ doc: /* Default value of `scroll-bar-width' for buffers that don't override it.
+This is the same as (default-value 'scroll-bar-width). */);
+
+ DEFVAR_LISP_NOPRO ("default-vertical-scroll-bar",
+ &buffer_defaults.vertical_scroll_bar_type,
+ doc: /* Default value of `vertical-scroll-bar' for buffers that don't override it.
+This is the same as (default-value 'vertical-scroll-bar). */);
+
DEFVAR_LISP_NOPRO ("default-indicate-empty-lines",
&buffer_defaults.indicate_empty_lines,
doc: /* Default value of `indicate-empty-lines' for buffers that don't override it.
This is the same as (default-value 'indicate-empty-lines). */);
-
+
DEFVAR_LISP_NOPRO ("default-scroll-up-aggressively",
&buffer_defaults.scroll_up_aggressively,
doc: /* Default value of `scroll-up-aggressively'.
This value applies in buffers that don't have their own local values.
This variable is an alias for (default-value 'scroll-up-aggressively). */);
-
+
DEFVAR_LISP_NOPRO ("default-scroll-down-aggressively",
&buffer_defaults.scroll_down_aggressively,
doc: /* Default value of `scroll-down-aggressively'.
This value applies in buffers that don't have their own local values.
This variable is an alias for (default-value 'scroll-down-aggressively). */);
-
+
DEFVAR_PER_BUFFER ("header-line-format",
¤t_buffer->header_line_format,
Qnil,
doc: /* Analogous to `mode-line-format', but controls the header line.
The header line appears, optionally, at the top of a window;
the mode line appears at the bottom. */);
-
+
DEFVAR_PER_BUFFER ("mode-line-format", ¤t_buffer->mode_line_format,
Qnil,
doc: /* Template for displaying mode line for current buffer.
For a symbol, its value is used (but it is ignored if t or nil).
A string appearing directly as the value of a symbol is processed verbatim
in that the %-constructs below are not recognized.
+ Note that unless the symbol is marked as a `risky-local-variable', all
+ properties in any strings, as well as all :eval and :propertize forms
+ in the value of that symbol will be ignored.
For a list of the form `(:eval FORM)', FORM is evaluated and the result
- is used as a mode line element.
+ is used as a mode line element. Be careful--FORM should not load any files,
+ because that can cause an infinite recursion.
+For a list of the form `(:propertize ELT PROPS...)', ELT is displayed
+ with the specified properties PROPS applied.
For a list whose car is a symbol, the symbol's value is taken,
and if that is non-nil, the cadr of the list is processed recursively.
Otherwise, the caddr of the list (if there is one) is processed.
DEFVAR_PER_BUFFER ("enable-multibyte-characters",
¤t_buffer->enable_multibyte_characters,
- make_number (-1),
+ Qnil,
doc: /* Non-nil means the buffer contents are regarded as multi-byte characters.
Otherwise they are regarded as unibyte. This affects the display,
file I/O and the behavior of various editing commands.
Changing its default value with `setq-default' is supported.
See also variable `default-enable-multibyte-characters' and Info node
`(elisp)Text Representations'. */);
+ XSYMBOL (intern ("enable-multibyte-characters"))->constant = 1;
DEFVAR_PER_BUFFER ("buffer-file-coding-system",
¤t_buffer->buffer_file_coding_system, Qnil,
See also the functions `display-table-slot' and `set-display-table-slot'. */);
- DEFVAR_PER_BUFFER ("left-margin-width", ¤t_buffer->left_margin_width,
+ DEFVAR_PER_BUFFER ("left-margin-width", ¤t_buffer->left_margin_cols,
Qnil,
doc: /* *Width of left marginal area for display of a buffer.
A value of nil means no marginal area. */);
-
- DEFVAR_PER_BUFFER ("right-margin-width", ¤t_buffer->right_margin_width,
+
+ DEFVAR_PER_BUFFER ("right-margin-width", ¤t_buffer->right_margin_cols,
Qnil,
doc: /* *Width of right marginal area for display of a buffer.
A value of nil means no marginal area. */);
-
+
+ DEFVAR_PER_BUFFER ("left-fringe-width", ¤t_buffer->left_fringe_width,
+ Qnil,
+ doc: /* *Width of this buffer's left fringe (in pixels).
+A value of 0 means no left fringe is shown in this buffer's window.
+A value of nil means to use the left fringe width from the window's frame. */);
+
+ DEFVAR_PER_BUFFER ("right-fringe-width", ¤t_buffer->right_fringe_width,
+ Qnil,
+ doc: /* *Width of this buffer's right fringe (in pixels).
+A value of 0 means no right fringe is shown in this buffer's window.
+A value of nil means to use the right fringe width from the window's frame. */);
+
+ DEFVAR_PER_BUFFER ("fringes-outside-margins", ¤t_buffer->fringes_outside_margins,
+ Qnil,
+ doc: /* *Non-nil means to display fringes outside display margins.
+A value of nil means to display fringes between margins and buffer text. */);
+
+ DEFVAR_PER_BUFFER ("scroll-bar-width", ¤t_buffer->scroll_bar_width,
+ Qnil,
+ doc: /* *Width of this buffer's scroll bars in pixels.
+A value of nil means to use the scroll bar width from the window's frame. */);
+
+ DEFVAR_PER_BUFFER ("vertical-scroll-bar", ¤t_buffer->vertical_scroll_bar_type,
+ Qnil,
+ doc: /* *Position of this buffer's vertical scroll bar.
+A value of left or right means to place the vertical scroll bar at that side
+of the window; a value of nil means that this window has no vertical scroll bar.
+A value of t means to use the vertical scroll bar type from the window's frame. */);
+
DEFVAR_PER_BUFFER ("indicate-empty-lines",
¤t_buffer->indicate_empty_lines, Qnil,
doc: /* *Visually indicate empty lines after the buffer end.
If non-nil, a bitmap is displayed in the left fringe of a window on
window-systems. */);
-
+
DEFVAR_PER_BUFFER ("scroll-up-aggressively",
¤t_buffer->scroll_up_aggressively, Qnil,
- doc: /* *If a number, scroll display up aggressively.
-If scrolling a window because point is below the window end, choose
-a new window start so that point ends up that fraction of the window's
-height from the bottom of the window. */);
-
+ doc: /* How far to scroll windows upward.
+If you move point off the bottom, the window scrolls automatically.
+This variable controls how far it scrolls. nil, the default,
+means scroll to center point. A fraction means scroll to put point
+that fraction of the window's height from the bottom of the window.
+When the value is 0.0, point goes at the bottom line, which in the simple
+case that you moved off with C-f means scrolling just one line. 1.0 means
+point goes at the top, so that in that simple case, the window
+window scrolls by a full window height. Meaningful values are
+between 0.0 and 1.0, inclusive. */);
+
DEFVAR_PER_BUFFER ("scroll-down-aggressively",
¤t_buffer->scroll_down_aggressively, Qnil,
- doc: /* *If a number, scroll display down aggressively.
-If scrolling a window because point is above the window start, choose
-a new window start so that point ends up that fraction of the window's
-height from the top of the window. */);
-
+ doc: /* How far to scroll windows downward.
+If you move point off the top, the window scrolls automatically.
+This variable controls how far it scrolls. nil, the default,
+means scroll to center point. A fraction means scroll to put point
+that fraction of the window's height from the top of the window.
+When the value is 0.0, point goes at the top line, which in the simple
+case that you moved off with C-b means scrolling just one line. 1.0 means
+point goes at the bottom, so that in that simple case, the window
+window scrolls by a full window height. Meaningful values are
+between 0.0 and 1.0, inclusive. */);
+
/*DEFVAR_LISP ("debug-check-symbol", &Vcheck_symbol,
"Don't ask.");
*/
DEFVAR_PER_BUFFER ("buffer-file-format", ¤t_buffer->file_format, Qnil,
doc: /* List of formats to use when saving this buffer.
Formats are defined by `format-alist'. This variable is
-set when a file is visited. Automatically local in all buffers. */);
+set when a file is visited. */);
DEFVAR_PER_BUFFER ("buffer-invisibility-spec",
¤t_buffer->invisibility_spec, Qnil,