Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
e928d437
Commit
e928d437
authored
Mar 21, 1998
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(record_delete): Replace LENGTH arg with STRING.
(record_change): Call record_delete the new way.
parent
628cea90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
src/undo.c
src/undo.c
+9
-11
No files found.
src/undo.c
View file @
e928d437
...
...
@@ -84,13 +84,14 @@ record_insert (beg, length)
}
/* Record that a deletion is about to take place,
for LENGTH
characters at location BEG. */
of the
characters
in STRING,
at location BEG. */
void
record_delete
(
beg
,
length
)
int
beg
,
length
;
record_delete
(
beg
,
string
)
int
beg
;
Lisp_Object
string
;
{
Lisp_Object
lbeg
,
lend
,
sbeg
;
Lisp_Object
sbeg
;
int
at_boundary
;
if
(
EQ
(
current_buffer
->
undo_list
,
Qt
))
...
...
@@ -110,12 +111,10 @@ record_delete (beg, length)
if
(
MODIFF
<=
SAVE_MODIFF
)
record_first_change
();
if
(
PT
==
beg
+
length
)
if
(
PT
==
beg
+
XSTRING
(
string
)
->
size
)
XSETINT
(
sbeg
,
-
beg
);
else
XSETFASTINT
(
sbeg
,
beg
);
XSETFASTINT
(
lbeg
,
beg
);
XSETFASTINT
(
lend
,
beg
+
length
);
/* If we are just after an undo boundary, and
point wasn't at start of deleted range, record where it was. */
...
...
@@ -126,8 +125,7 @@ record_delete (beg, length)
=
Fcons
(
make_number
(
last_point_position
),
current_buffer
->
undo_list
);
current_buffer
->
undo_list
=
Fcons
(
Fcons
(
Fbuffer_substring
(
lbeg
,
lend
),
sbeg
),
current_buffer
->
undo_list
);
=
Fcons
(
Fcons
(
string
,
sbeg
),
current_buffer
->
undo_list
);
}
/* Record the fact that MARKER is about to be adjusted by ADJUSTMENT.
...
...
@@ -158,13 +156,13 @@ record_marker_adjustment (marker, adjustment)
/* Record that a replacement is about to take place,
for LENGTH characters at location BEG.
The replacement
does
not change the number of characters. */
The replacement
must
not change the number of characters. */
void
record_change
(
beg
,
length
)
int
beg
,
length
;
{
record_delete
(
beg
,
length
);
record_delete
(
beg
,
make_buffer_string
(
beg
,
beg
+
length
,
1
)
);
record_insert
(
beg
,
length
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment