aboutsummaryrefslogtreecommitdiffstats
path: root/src/undo.c
diff options
context:
space:
mode:
authorRichard M. Stallman2005-01-29 17:16:31 +0000
committerRichard M. Stallman2005-01-29 17:16:31 +0000
commit6887bce515f7406765dda3bd8fc65d65a9cf207b (patch)
tree0bdc69f5ae3a78f8f836aad5fb69f9727d3df7f5 /src/undo.c
parent2da637a5386439117b24b3eccd1e4138a06dfa81 (diff)
downloademacs-6887bce515f7406765dda3bd8fc65d65a9cf207b.tar.gz
emacs-6887bce515f7406765dda3bd8fc65d65a9cf207b.zip
(Fprimitive_undo): Handle (FUNNAME . ARGS) by calling FUNNAME.
Diffstat (limited to 'src/undo.c')
-rw-r--r--src/undo.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/undo.c b/src/undo.c
index df4b8d08cd6..ac7b4d8935e 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -519,7 +519,7 @@ Return what remains of the list. */)
519 } 519 }
520 else if (EQ (car, Qnil)) 520 else if (EQ (car, Qnil))
521 { 521 {
522 /* Element (nil prop val beg . end) is property change. */ 522 /* Element (nil PROP VAL BEG . END) is property change. */
523 Lisp_Object beg, end, prop, val; 523 Lisp_Object beg, end, prop, val;
524 524
525 prop = Fcar (cdr); 525 prop = Fcar (cdr);
@@ -543,6 +543,18 @@ Return what remains of the list. */)
543 Fgoto_char (car); 543 Fgoto_char (car);
544 Fdelete_region (car, cdr); 544 Fdelete_region (car, cdr);
545 } 545 }
546 else if (SYMBOLP (car))
547 {
548 Lisp_Object oldlist = current_buffer->undo_list;
549 /* Element (FUNNAME . ARGS) means call FUNNAME to undo. */
550 apply1 (car, cdr);
551 /* Make sure this produces at least one undo entry,
552 so the test in `undo' for continuing an undo series
553 will work right. */
554 if (EQ (oldlist, current_buffer->undo_list))
555 current_buffer->undo_list
556 = Fcons (list2 (Qcdr, Qnil), current_buffer->undo_list);
557 }
546 else if (STRINGP (car) && INTEGERP (cdr)) 558 else if (STRINGP (car) && INTEGERP (cdr))
547 { 559 {
548 /* Element (STRING . POS) means STRING was deleted. */ 560 /* Element (STRING . POS) means STRING was deleted. */
@@ -589,7 +601,7 @@ Return what remains of the list. */)
589 UNGCPRO; 601 UNGCPRO;
590 return unbind_to (count, list); 602 return unbind_to (count, list);
591} 603}
592 604
593void 605void
594syms_of_undo () 606syms_of_undo ()
595{ 607{