aboutsummaryrefslogtreecommitdiffstats
path: root/src/undo.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1993-06-12 18:10:20 +0000
committerRichard M. Stallman <[email protected]>1993-06-12 18:10:20 +0000
commitf87a68b369018158bbddabbec049a7d4e2df52ee (patch)
treeaa58f1594726730c3850f272ce8929ca72ec2930 /src/undo.c
parenta6d570c63744de993bd15eb3fddb0205d04a163b (diff)
(syms_of_undo): Set up Qinhibit_read_only.
(Fprimitive_undo): Sometimes bind inhibit-read-only to t.
Diffstat (limited to 'src/undo.c')
-rw-r--r--src/undo.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/undo.c b/src/undo.c
index 18bfc3a3b2..1c399fb873 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -26,6 +26,8 @@ and this notice must be preserved on all copies. */
/* Last buffer for which undo information was recorded. */
Lisp_Object last_undo_buffer;
+Lisp_Object Qinhibit_read_only;
+
/* Record an insertion that just happened or is about to happen,
for LENGTH characters at position BEG.
(It is possible to record an insertion before or after the fact
@@ -286,6 +288,7 @@ Return what remains of the list.")
(count, list)
Lisp_Object count, list;
{
+ int count = specpdl_ptr - specpdl;
register int arg = XINT (count);
#if 0 /* This is a good feature, but would make undo-start
unable to do what is expected. */
@@ -298,6 +301,10 @@ Return what remains of the list.")
list = Fcdr (list);
#endif
+ /* Don't let read-only properties interfere with undo. */
+ if (NILP (current_buffer->read_only))
+ specbind (Qinhibit_read_only, Qt);
+
while (arg > 0)
{
while (1)
@@ -401,11 +408,14 @@ Return what remains of the list.")
arg--;
}
- return list;
+ return unbind_to (count, list);
}
syms_of_undo ()
{
+ Qinhibit_read_only = intern ("inhibit-read-only");
+ staticpro (&Qinhibit_read_only);
+
defsubr (&Sprimitive_undo);
defsubr (&Sundo_boundary);
}