/* Buffer manipulation primitives for GNU Emacs.
- Copyright (C) 1985, 1986, 1987, 1988, 1989, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1987, 1988, 1989, 1992, 1993
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
buffer_slot_type_mismatch will signal an error. */
struct buffer buffer_local_types;
-/* Nonzero means don't allow modification of protected fields. */
-
-int check_protected_fields;
-
Lisp_Object Fset_buffer ();
void set_buffer_internal ();
Lisp_Object Vbefore_change_function;
Lisp_Object Vafter_change_function;
+Lisp_Object Vtransient_mark_mode;
+
/* List of functions to call before changing an unmodified buffer. */
Lisp_Object Vfirst_change_hook;
Lisp_Object Qfirst_change_hook;
reset_buffer_local_variables(b);
}
-reset_buffer_local_variables(b)
+reset_buffer_local_variables (b)
register struct buffer *b;
{
register int offset;
b->upcase_table = Vascii_upcase_table;
b->case_canon_table = Vascii_downcase_table;
b->case_eqv_table = Vascii_upcase_table;
+ b->mark_active = Qnil;
#if 0
b->sort_table = XSTRING (Vascii_sort_table);
b->folding_sort_table = XSTRING (Vascii_folding_sort_table);
return Qnil;
}
\f
-DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, 0,
+DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, "*",
"Delete the entire contents of the current buffer.\n\
Any clipping restriction in effect (see `narrow-to-region') is removed,\n\
so the buffer is truly empty after this.")
buffer_defaults.display_table = Qnil;
buffer_defaults.fieldlist = Qnil;
buffer_defaults.undo_list = Qnil;
+ buffer_defaults.mark_active = Qnil;
XFASTINT (buffer_defaults.tab_width) = 8;
buffer_defaults.truncate_lines = Qnil;
XFASTINT (buffer_local_flags.major_mode) = -1;
XFASTINT (buffer_local_flags.mode_name) = -1;
XFASTINT (buffer_local_flags.undo_list) = -1;
+ XFASTINT (buffer_local_flags.mark_active) = -1;
XFASTINT (buffer_local_flags.mode_line_format) = 1;
XFASTINT (buffer_local_flags.abbrev_mode) = 2;
/* initialize the buffer routines */
syms_of_buffer ()
{
+ extern Lisp_Object Qdisabled;
+
staticpro (&Vbuffer_defaults);
staticpro (&Vbuffer_local_symbols);
staticpro (&Qfundamental_mode);
Fput (Qprotected_field, Qerror_message,
build_string ("Attempt to modify a protected field"));
+ Fput (intern ("erase-buffer"), Qdisabled, Qt);
+
/* All these use DEFVAR_LISP_NOPRO because the slots in
buffer_defaults will all be marked via Vbuffer_defaults. */
/* This doc string is too long for cpp; cpp dies if it isn't in a comment.
But make-docfile finds it!
DEFVAR_PER_BUFFER ("mode-line-format", ¤t_buffer->mode_line_format,
+ Qnil,
"Template for displaying mode line for current buffer.\n\
Each buffer has its own value of this variable.\n\
Value may be a string, a symbol or a list or cons cell.\n\
If this variable is nil, the value of `standard-display-table' is used.\n\
Each window can have its own, overriding display table.");
- DEFVAR_PER_BUFFER ("buffer-field-list", ¤t_buffer->fieldlist, Qnil,
- "List of fields in the current buffer. See `add-field'.");
-
- DEFVAR_BOOL ("check-protected-fields", &check_protected_fields,
- "Non-nil means don't allow modification of a protected field.\n\
-See `add-field'.");
- check_protected_fields = 0;
-
/*DEFVAR_LISP ("debug-check-symbol", &Vcheck_symbol,
"Don't ask.");
*/
was modified between BEG and END. PROP is the property name,\n\
and VAL is the old value.\n\
\n\
+An entry of the form POSITION indicates that point was at the buffer\n\
+location given by the integer. Undoing an entry of this form places\n\
+point at POSITION.\n\
+\n\
nil marks undo boundaries. The undo command treats the changes\n\
between two undo boundaries as a single step to be undone.\n\
\n\
-If the value of the variable is t, undo information is not recorded.\n\
-");
+If the value of the variable is t, undo information is not recorded.");
+
+ DEFVAR_PER_BUFFER ("mark-active", ¤t_buffer->mark_active, Qnil,
+ "Non-nil means the mark and region are currently active in this buffer.\n\
+Automatically local in all buffers.");
+
+ DEFVAR_LISP ("transient-mark-mode", &Vtransient_mark_mode,
+ "*Non-nil means deactivate the mark when the buffer contents change.");
+ Vtransient_mark_mode = Qnil;
defsubr (&Sbuffer_list);
defsubr (&Sget_buffer);