aboutsummaryrefslogtreecommitdiffstats
path: root/src/undo.c
diff options
context:
space:
mode:
authorKim F. Storm2005-01-31 22:44:27 +0000
committerKim F. Storm2005-01-31 22:44:27 +0000
commit49be18c97e6df29dfac0febac31e75ada2c9a7ce (patch)
tree5ff2b309b269d9e8dec21bb623b26d7d9348af47 /src/undo.c
parent998858ae208ae0305396e6a69369d260b8a0381d (diff)
downloademacs-49be18c97e6df29dfac0febac31e75ada2c9a7ce.tar.gz
emacs-49be18c97e6df29dfac0febac31e75ada2c9a7ce.zip
(Qapply): New lisp var.
(syms_of_undo): Intern and staticpro it. (Fprimitive_undo): Support formats (apply FUNNAME . ARGS) and (apply DELTA BEG END FUNNAME . ARGS) instead of (FUNNAME . ARGS).
Diffstat (limited to 'src/undo.c')
-rw-r--r--src/undo.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/undo.c b/src/undo.c
index 480a1b07ea6..ea4f35397a9 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -40,6 +40,10 @@ Lisp_Object last_undo_buffer;
40 40
41Lisp_Object Qinhibit_read_only; 41Lisp_Object Qinhibit_read_only;
42 42
43/* Marker for function call undo list elements. */
44
45Lisp_Object Qapply;
46
43/* The first time a command records something for undo. 47/* The first time a command records something for undo.
44 it also allocates the undo-boundary object 48 it also allocates the undo-boundary object
45 which will be added to the list at the end of the command. 49 which will be added to the list at the end of the command.
@@ -543,10 +547,18 @@ Return what remains of the list. */)
543 Fgoto_char (car); 547 Fgoto_char (car);
544 Fdelete_region (car, cdr); 548 Fdelete_region (car, cdr);
545 } 549 }
546 else if (SYMBOLP (car)) 550 else if (EQ (car, Qapply))
547 { 551 {
548 Lisp_Object oldlist = current_buffer->undo_list; 552 Lisp_Object oldlist = current_buffer->undo_list;
549 /* Element (FUNNAME . ARGS) means call FUNNAME to undo. */ 553 /* Element (apply FUNNAME . ARGS) means call FUNNAME to undo. */
554 car = Fcar (cdr);
555 if (INTEGERP (car))
556 {
557 /* Long format: (apply DELTA START END FUNNAME . ARGS). */
558 cdr = Fcdr (Fcdr (Fcdr (cdr)));
559 car = Fcar (cdr);
560 }
561 cdr = Fcdr (cdr);
550 apply1 (car, cdr); 562 apply1 (car, cdr);
551 /* Make sure this produces at least one undo entry, 563 /* Make sure this produces at least one undo entry,
552 so the test in `undo' for continuing an undo series 564 so the test in `undo' for continuing an undo series
@@ -608,6 +620,9 @@ syms_of_undo ()
608 Qinhibit_read_only = intern ("inhibit-read-only"); 620 Qinhibit_read_only = intern ("inhibit-read-only");
609 staticpro (&Qinhibit_read_only); 621 staticpro (&Qinhibit_read_only);
610 622
623 Qapply = intern ("apply");
624 staticpro (&Qapply);
625
611 pending_boundary = Qnil; 626 pending_boundary = Qnil;
612 staticpro (&pending_boundary); 627 staticpro (&pending_boundary);
613 628