/* Buffer manipulation primitives for GNU Emacs.
- Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000, 2001, 02, 03, 2004
- Free Software Foundation, Inc.
+ Copyright (C) 1985, 86, 87, 88, 89, 93, 94, 95, 97, 98, 99,
+ 2000, 01, 02, 03, 04, 2005 Free Software Foundation, Inc.
This file is part of GNU Emacs.
static void free_buffer_text P_ ((struct buffer *b));
static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Overlay *));
static void modify_overlay P_ ((struct buffer *, EMACS_INT, EMACS_INT));
+static Lisp_Object buffer_lisp_local_variables P_ ((struct buffer *));
extern char * emacs_strerror P_ ((int));
to->overlays_before = copy_overlays (to, from->overlays_before);
to->overlays_after = copy_overlays (to, from->overlays_after);
- /* Copy the alist of local variables,
- and all the alist elements too. */
- to->local_var_alist
- = Fcopy_sequence (from->local_var_alist);
- for (tem = to->local_var_alist; CONSP (tem);
- tem = XCDR (tem))
- XSETCAR (tem, Fcons (XCAR (XCAR (tem)), XCDR (XCAR (tem))));
+ /* Get (a copy of) the alist of Lisp-level local variables of FROM
+ and install that in TO. */
+ to->local_var_alist = buffer_lisp_local_variables (from);
}
-
DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
2, 3,
"bMake indirect buffer (to buffer): \nBName of indirect buffer: ",
XMARKER (b->zv_marker)->insertion_type = 1;
}
else
- clone_per_buffer_values (b->base_buffer, b);
+ {
+ struct buffer *old_b = current_buffer;
+
+ clone_per_buffer_values (b->base_buffer, b);
+ b->filename = Qnil;
+ b->file_truename = Qnil;
+ b->display_count = make_number (0);
+ b->backed_up = Qnil;
+ b->auto_save_file_name = Qnil;
+ set_buffer_internal_1 (b);
+ Fset (intern ("buffer-save-without-query"), Qnil);
+ Fset (intern ("buffer-file-number"), Qnil);
+ Fset (intern ("buffer-stale-function"), Qnil);
+ set_buffer_internal_1 (old_b);
+ }
return buf;
}
return result;
}
+/* Return an alist of the Lisp-level buffer-local bindings of
+ buffer BUF. That is, don't include the variables maintained
+ in special slots in the buffer object. */
+
+static Lisp_Object
+buffer_lisp_local_variables (buf)
+ struct buffer *buf;
+{
+ Lisp_Object result = Qnil;
+ register Lisp_Object tail;
+ for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
+ {
+ Lisp_Object val, elt;
+
+ elt = XCAR (tail);
+
+ /* Reference each variable in the alist in buf.
+ If inquiring about the current buffer, this gets the current values,
+ so store them into the alist so the alist is up to date.
+ If inquiring about some other buffer, this swaps out any values
+ for that buffer, making the alist up to date automatically. */
+ val = find_symbol_value (XCAR (elt));
+ /* Use the current buffer value only if buf is the current buffer. */
+ if (buf != current_buffer)
+ val = XCDR (elt);
+
+ /* If symbol is unbound, put just the symbol in the list. */
+ if (EQ (val, Qunbound))
+ result = Fcons (XCAR (elt), result);
+ /* Otherwise, put (symbol . value) in the list. */
+ else
+ result = Fcons (Fcons (XCAR (elt), val), result);
+ }
+
+ return result;
+}
+
DEFUN ("buffer-local-variables", Fbuffer_local_variables,
Sbuffer_local_variables, 0, 1, 0,
doc: /* Return an alist of variables that are buffer-local in BUFFER.
buf = XBUFFER (buffer);
}
- result = Qnil;
-
- {
- register Lisp_Object tail;
- for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
- {
- Lisp_Object val, elt;
-
- elt = XCAR (tail);
-
- /* Reference each variable in the alist in buf.
- If inquiring about the current buffer, this gets the current values,
- so store them into the alist so the alist is up to date.
- If inquiring about some other buffer, this swaps out any values
- for that buffer, making the alist up to date automatically. */
- val = find_symbol_value (XCAR (elt));
- /* Use the current buffer value only if buf is the current buffer. */
- if (buf != current_buffer)
- val = XCDR (elt);
-
- /* If symbol is unbound, put just the symbol in the list. */
- if (EQ (val, Qunbound))
- result = Fcons (XCAR (elt), result);
- /* Otherwise, put (symbol . value) in the list. */
- else
- result = Fcons (Fcons (XCAR (elt), val), result);
- }
- }
+ result = buffer_lisp_local_variables (buf);
/* Add on all the variables stored in special slots. */
{
return result;
}
-
\f
DEFUN ("buffer-modified-p", Fbuffer_modified_p, Sbuffer_modified_p,
0, 1, 0,
}
DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0,
- doc: /* Return the buffer OVERLAY belongs to. */)
+ doc: /* Return the buffer OVERLAY belongs to.
+Return nil if OVERLAY has been deleted. */)
(overlay)
Lisp_Object overlay;
{
buffer_defaults.direction_reversed = Qnil;
buffer_defaults.cursor_type = Qt;
buffer_defaults.extra_line_spacing = Qnil;
+ buffer_defaults.cursor_in_non_selected_windows = Qt;
#ifdef DOS_NT
buffer_defaults.buffer_file_type = Qnil; /* TEXT */
XSETFASTINT (buffer_local_flags.header_line_format, idx); ++idx;
XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx;
XSETFASTINT (buffer_local_flags.extra_line_spacing, idx); ++idx;
+ XSETFASTINT (buffer_local_flags.cursor_in_non_selected_windows, idx); ++idx;
/* Need more room? */
if (idx >= MAX_PER_BUFFER_VARS)
doc: /* Default value of `line-spacing' for buffers that don't override it.
This is the same as (default-value 'line-spacing). */);
+ DEFVAR_LISP_NOPRO ("default-cursor-in-non-selected-windows",
+ &buffer_defaults.cursor_in_non_selected_windows,
+ doc: /* Default value of `cursor-in-non-selected-windows'.
+This is the same as (default-value 'cursor-in-non-selected-windows). */);
+
DEFVAR_LISP_NOPRO ("default-abbrev-mode",
&buffer_defaults.abbrev_mode,
doc: /* Default value of `abbrev-mode' for buffers that do not override it.
If value is a symbol `left' or `right', both angle and arrow bitmaps
are displayed in the left or right fringe, resp. Any other value
-that doesn't look like an alist means displat the angle bitmaps in
+that doesn't look like an alist means display the angle bitmaps in
the left fringe but no arrows.
You can exercise more precise control by using an alist as the
If value is a floating point number, it specifies the spacing relative
to the default frame line height. */);
+ DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows",
+ ¤t_buffer->cursor_in_non_selected_windows, Qnil,
+ doc: /* *Cursor type to display in non-selected windows.
+t means to use hollow box cursor. See `cursor-type' for other values. */);
+
DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions,
doc: /* List of functions called with no args to query before killing a buffer. */);
Vkill_buffer_query_functions = Qnil;