return buf;
}
-DEFUN ("make-indirect-buffer",
- Fmake_indirect_buffer, Smake_indirect_buffer, 2, 2,
+DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, 2, 2,
"bMake indirect buffer (to buffer): \nBName of indirect buffer: ",
- "Create and return an indirect buffer for buffer BASE, named NAME.\n\
-BASE should be an existing buffer (or buffer name).\n\
+ "Create and return an indirect buffer for buffer BASE-BUFFER, named NAME.\n\
+BASE-BUFFER should be an existing buffer (or buffer name).\n\
NAME should be a string which is not the name of an existing buffer.")
(base_buffer, name)
register Lisp_Object base_buffer, name;
b->mark_active = Qnil;
b->point_before_scroll = Qnil;
b->file_format = Qnil;
+ b->extra1 = Qnil;
+ b->extra2 = Qnil;
+ b->extra3 = Qnil;
}
/* Reset buffer B's local variables info.
b->abbrev_table = Vfundamental_mode_abbrev_table;
b->mode_name = QSFundamental;
b->minor_modes = Qnil;
+
+ /* If the standard case table has been altered and invalidated,
+ fix up its insides first. */
+ if (! (CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[0])
+ && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[1])
+ && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2])))
+ Fset_standard_case_table (Vascii_downcase_table);
+
b->downcase_table = Vascii_downcase_table;
b->upcase_table = XCHAR_TABLE (Vascii_downcase_table)->extras[0];
b->case_canon_table = XCHAR_TABLE (Vascii_downcase_table)->extras[1];
when the hook functions are called.\n\n\
Any processes that have this buffer as the `process-buffer' are killed\n\
with `delete-process'.")
- (bufname)
- Lisp_Object bufname;
+ (buffer)
+ Lisp_Object buffer;
{
Lisp_Object buf;
register struct buffer *b;
register struct Lisp_Marker *m;
struct gcpro gcpro1, gcpro2;
- if (NILP (bufname))
+ if (NILP (buffer))
buf = Fcurrent_buffer ();
else
- buf = Fget_buffer (bufname);
+ buf = Fget_buffer (buffer);
if (NILP (buf))
- nsberror (bufname);
+ nsberror (buffer);
b = XBUFFER (buf);
if (INTERACTIVE && !NILP (b->filename)
&& BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
{
- GCPRO2 (buf, bufname);
+ GCPRO1 (buf);
tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ",
XSTRING (b->name)->data));
UNGCPRO;
tem = Vinhibit_quit;
Vinhibit_quit = Qt;
+ replace_buffer_in_all_windows (buf);
Vbuffer_alist = Fdelq (Frassq (buf, Vbuffer_alist), Vbuffer_alist);
- Freplace_buffer_in_windows (buf);
Vinhibit_quit = tem;
/* Delete any auto-save file, if we saved it in this session. */
"Set an appropriate major mode for BUFFER, according to `default-major-mode'.\n\
Use this function before selecting the buffer, since it may need to inspect\n\
the current buffer's major mode.")
- (buf)
- Lisp_Object buf;
+ (buffer)
+ Lisp_Object buffer;
{
int count;
Lisp_Object function;
record_unwind_protect (save_excursion_restore, save_excursion_save ());
- Fset_buffer (buf);
+ Fset_buffer (buffer);
call0 (function);
return unbind_to (count, Qnil);
WARNING: This is NOT the way to work on another buffer temporarily\n\
within a Lisp program! Use `set-buffer' instead. That avoids messing with\n\
the window-buffer correspondences.")
- (bufname, norecord)
- Lisp_Object bufname, norecord;
+ (buffer, norecord)
+ Lisp_Object buffer, norecord;
{
register Lisp_Object buf;
Lisp_Object tem;
if (!NILP (tem))
error ("Cannot switch buffers in a dedicated window");
- if (NILP (bufname))
+ if (NILP (buffer))
buf = Fother_buffer (Fcurrent_buffer (), Qnil);
else
{
- buf = Fget_buffer (bufname);
+ buf = Fget_buffer (buffer);
if (NILP (buf))
{
- buf = Fget_buffer_create (bufname);
+ buf = Fget_buffer_create (buffer);
Fset_buffer_major_mode (buf);
}
}
If `pop-up-windows' is non-nil, windows can be split to do this.\n\
If optional second arg OTHER-WINDOW is non-nil, insist on finding another\n\
window even if BUFFER is already visible in the selected window.")
- (bufname, other)
- Lisp_Object bufname, other;
+ (buffer, other_window)
+ Lisp_Object buffer, other_window;
{
register Lisp_Object buf;
- if (NILP (bufname))
+ if (NILP (buffer))
buf = Fother_buffer (Fcurrent_buffer (), Qnil);
else
{
- buf = Fget_buffer (bufname);
+ buf = Fget_buffer (buffer);
if (NILP (buf))
{
- buf = Fget_buffer_create (bufname);
+ buf = Fget_buffer_create (buffer);
Fset_buffer_major_mode (buf);
}
}
Fset_buffer (buf);
record_buffer (buf);
- Fselect_window (Fdisplay_buffer (buf, other));
+ Fselect_window (Fdisplay_buffer (buf, other_window));
return buf;
}
This function does not display the buffer, so its effect ends\n\
when the current command terminates.\n\
Use `switch-to-buffer' or `pop-to-buffer' to switch buffers permanently.")
- (bufname)
- register Lisp_Object bufname;
+ (buffer)
+ register Lisp_Object buffer;
{
- register Lisp_Object buffer;
- buffer = Fget_buffer (bufname);
- if (NILP (buffer))
- nsberror (bufname);
- if (NILP (XBUFFER (buffer)->name))
+ register Lisp_Object buf;
+ buf = Fget_buffer (buffer);
+ if (NILP (buf))
+ nsberror (buffer);
+ if (NILP (XBUFFER (buf)->name))
error ("Selecting deleted buffer");
- set_buffer_internal (XBUFFER (buffer));
- return buffer;
+ set_buffer_internal (XBUFFER (buf));
+ return buf;
}
\f
DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only,
If BUFFER is nil or omitted, bury the current buffer.\n\
Also, if BUFFER is nil or omitted, remove the current buffer from the\n\
selected window if it is displayed there.")
- (buf)
- register Lisp_Object buf;
+ (buffer)
+ register Lisp_Object buffer;
{
/* Figure out what buffer we're going to bury. */
- if (NILP (buf))
+ if (NILP (buffer))
{
- XSETBUFFER (buf, current_buffer);
+ XSETBUFFER (buffer, current_buffer);
/* If we're burying the current buffer, unshow it. */
- Fswitch_to_buffer (Fother_buffer (buf, Qnil), Qnil);
+ Fswitch_to_buffer (Fother_buffer (buffer, Qnil), Qnil);
}
else
{
Lisp_Object buf1;
- buf1 = Fget_buffer (buf);
+ buf1 = Fget_buffer (buffer);
if (NILP (buf1))
- nsberror (buf);
- buf = buf1;
+ nsberror (buffer);
+ buffer = buf1;
}
- /* Move buf to the end of the buffer list. */
+ /* Move buffer to the end of the buffer list. */
{
register Lisp_Object aelt, link;
- aelt = Frassq (buf, Vbuffer_alist);
+ aelt = Frassq (buffer, Vbuffer_alist);
link = Fmemq (aelt, Vbuffer_alist);
Vbuffer_alist = Fdelq (aelt, Vbuffer_alist);
XCONS (link)->cdr = Qnil;
return (OVERLAYP (object) ? Qt : Qnil);
}
-DEFUN ("make-overlay", Fmake_overlay, Smake_overlay, 2, 3, 0,
+DEFUN ("make-overlay", Fmake_overlay, Smake_overlay, 2, 5, 0,
"Create a new overlay with range BEG to END in BUFFER.\n\
If omitted, BUFFER defaults to the current buffer.\n\
-BEG and END may be integers or markers.")
- (beg, end, buffer)
+BEG and END may be integers or markers.\n\
+The fourth arg FRONT-ADVANCE, if non-nil, makes the\n\
+front delimiter advance when text is inserted there.\n\
+The fifth arg REAR-ADVANCE, if non-nil, makes the\n\
+rear delimiter advance when text is inserted there.")
+ (beg, end, buffer, front_advance, rear_advance)
Lisp_Object beg, end, buffer;
+ Lisp_Object front_advance, rear_advance;
{
Lisp_Object overlay;
struct buffer *b;
beg = Fset_marker (Fmake_marker (), beg, buffer);
end = Fset_marker (Fmake_marker (), end, buffer);
- XMARKER (end)->insertion_type = 1;
+ if (!NILP (front_advance))
+ XMARKER (beg)->insertion_type = 1;
+ if (!NILP (rear_advance))
+ XMARKER (end)->insertion_type = 1;
overlay = allocate_misc ();
XMISCTYPE (overlay) = Lisp_Misc_Overlay;
}
\f
DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0,
- "Get the property of overlay OVERLAY with property name NAME.")
+ "Get the property of overlay OVERLAY with property name PROP.")
(overlay, prop)
Lisp_Object overlay, prop;
{
XSETINT (buffer_local_flags.point_before_scroll, -1);
XSETINT (buffer_local_flags.file_truename, -1);
XSETINT (buffer_local_flags.invisibility_spec, -1);
- XSETFASTINT (buffer_local_flags.file_format, -1);
+ XSETINT (buffer_local_flags.file_format, -1);
XSETFASTINT (buffer_local_flags.mode_line_format, 1);
XSETFASTINT (buffer_local_flags.abbrev_mode, 2);