Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
714bced9
Commit
714bced9
authored
Feb 03, 1996
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(record_marker_adjustment): New function.
(Fprimitive_undo): Handle marker-adjustment elements.
parent
8948d317
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
src/undo.c
src/undo.c
+34
-0
No files found.
src/undo.c
View file @
714bced9
...
...
@@ -128,6 +128,31 @@ record_delete (beg, length)
current_buffer
->
undo_list
);
}
/* Record the fact that MARKER is about to be adjusted by ADJUSTMENT.
This is done only when a marker points within text being deleted,
because that's the only case where an automatic marker adjustment
won't be inverted automatically by undoing the buffer modification. */
record_marker_adjustment
(
marker
,
adjustment
)
Lisp_Object
marker
;
int
adjustment
;
{
if
(
EQ
(
current_buffer
->
undo_list
,
Qt
))
return
;
/* Allocate a cons cell to be the undo boundary after this command. */
if
(
NILP
(
pending_boundary
))
pending_boundary
=
Fcons
(
Qnil
,
Qnil
);
if
(
current_buffer
!=
XBUFFER
(
last_undo_buffer
))
Fundo_boundary
();
XSETBUFFER
(
last_undo_buffer
,
current_buffer
);
current_buffer
->
undo_list
=
Fcons
(
Fcons
(
marker
,
make_number
(
adjustment
)),
current_buffer
->
undo_list
);
}
/* Record that a replacement is about to take place,
for LENGTH characters at location BEG.
The replacement does not change the number of characters. */
...
...
@@ -463,6 +488,15 @@ Return what remains of the list.")
SET_PT
(
pos
);
}
}
else
if
(
MARKERP
(
car
)
&&
INTEGERP
(
cdr
))
{
/* (MARKER . INTEGER) means a marker MARKER
was adjusted by INTEGER. */
if
(
XMARKER
(
car
)
->
buffer
)
Fset_marker
(
car
,
make_number
(
marker_position
(
car
)
-
XINT
(
cdr
)),
Fmarker_buffer
(
car
));
}
}
}
arg
--
;
...
...
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