#include "window.h"
#include "blockinput.h"
-static void insert_1 ();
static void insert_from_string_1 ();
static void insert_from_buffer_1 ();
static void gap_left ();
/* Move gap to position `pos'.
Note that this can quit! */
+void
move_gap (pos)
int pos;
{
\f
/* Make the gap INCREMENT characters longer. */
+void
make_gap (increment)
int increment;
{
DO NOT use this for the contents of a Lisp string or a Lisp buffer!
prepare_to_modify_buffer could relocate the text. */
+void
insert (string, length)
register unsigned char *string;
register length;
{
if (length > 0)
{
- insert_1 (string, length, 0);
+ insert_1 (string, length, 0, 1);
signal_after_change (PT-length, 0, length);
}
}
+void
insert_and_inherit (string, length)
register unsigned char *string;
register length;
{
if (length > 0)
{
- insert_1 (string, length, 1);
+ insert_1 (string, length, 1, 1);
signal_after_change (PT-length, 0, length);
}
}
-static void
-insert_1 (string, length, inherit)
+void
+insert_1 (string, length, inherit, prepare)
register unsigned char *string;
- register length;
- int inherit;
+ register int length;
+ int inherit, prepare;
{
register Lisp_Object temp;
if (length + Z != XINT (temp))
error ("maximum buffer size exceeded");
- prepare_to_modify_buffer (PT, PT);
+ if (prepare)
+ prepare_to_modify_buffer (PT, PT);
if (PT != GPT)
move_gap (PT);
before we bcopy the stuff into the buffer, and relocate the string
without insert noticing. */
+void
insert_from_string (string, pos, length, inherit)
Lisp_Object string;
register int pos, length;
Don't use this function to insert part of a Lisp string,
since gc could happen and relocate it. */
+void
insert_before_markers (string, length)
unsigned char *string;
register int length;
if (length > 0)
{
register int opoint = PT;
- insert_1 (string, length, 0);
+ insert_1 (string, length, 0, 1);
adjust_markers (opoint - 1, opoint, length);
signal_after_change (PT-length, 0, length);
}
}
+void
insert_before_markers_and_inherit (string, length)
unsigned char *string;
register int length;
if (length > 0)
{
register int opoint = PT;
- insert_1 (string, length, 1);
+ insert_1 (string, length, 1, 1);
adjust_markers (opoint - 1, opoint, length);
signal_after_change (PT-length, 0, length);
}
/* Insert part of a Lisp string, relocating markers after. */
+void
insert_from_string_before_markers (string, pos, length, inherit)
Lisp_Object string;
register int pos, length;
/* Delete characters in current buffer
from FROM up to (but not including) TO. */
+void
del_range (from, to)
register int from, to;
{
- return del_range_1 (from, to, 1);
+ del_range_1 (from, to, 1);
}
/* Like del_range; PREPARE says whether to call prepare_to_modify_buffer. */
+void
del_range_1 (from, to, prepare)
register int from, to, prepare;
{
to END. This checks the read-only properties of the region, calls
the necessary modification hooks, and warns the next redisplay that
it should pay attention to that area. */
+void
modify_region (buffer, start, end)
struct buffer *buffer;
int start, end;
verify that the text to be modified is not read-only, and call
any modification properties the text may have. */
+void
prepare_to_modify_buffer (start, end)
Lisp_Object start, end;
{
START and END are the bounds of the text to be changed,
as Lisp objects. */
+void
signal_before_change (start, end)
Lisp_Object start, end;
{
(Hence POS + LENINS - LENDEL is the position after the changed text.) */
+void
signal_after_change (pos, lendel, lenins)
int pos, lendel, lenins;
{