]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fprimitive_undo): Handle (FUNNAME . ARGS) by calling FUNNAME.
authorRichard M. Stallman <rms@gnu.org>
Sat, 29 Jan 2005 17:16:31 +0000 (17:16 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 29 Jan 2005 17:16:31 +0000 (17:16 +0000)
src/undo.c

index df4b8d08cd62babd4821c01ab0cc74dbb29f0c49..ac7b4d8935e636c47a4e2d715915da7e8debd328 100644 (file)
@@ -519,7 +519,7 @@ Return what remains of the list.  */)
                }
              else if (EQ (car, Qnil))
                {
-                 /* Element (nil prop val beg . end) is property change.  */
+                 /* Element (nil PROP VAL BEG . END) is property change.  */
                  Lisp_Object beg, end, prop, val;
 
                  prop = Fcar (cdr);
@@ -543,6 +543,18 @@ Return what remains of the list.  */)
                  Fgoto_char (car);
                  Fdelete_region (car, cdr);
                }
+             else if (SYMBOLP (car))
+               {
+                 Lisp_Object oldlist = current_buffer->undo_list;
+                 /* Element (FUNNAME . ARGS) means call FUNNAME to undo.  */
+                 apply1 (car, cdr);
+                 /* Make sure this produces at least one undo entry,
+                    so the test in `undo' for continuing an undo series
+                    will work right.  */
+                 if (EQ (oldlist, current_buffer->undo_list))
+                   current_buffer->undo_list
+                     = Fcons (list2 (Qcdr, Qnil), current_buffer->undo_list);
+               }
              else if (STRINGP (car) && INTEGERP (cdr))
                {
                  /* Element (STRING . POS) means STRING was deleted.  */
@@ -589,7 +601,7 @@ Return what remains of the list.  */)
   UNGCPRO;
   return unbind_to (count, list);
 }
-
+\f
 void
 syms_of_undo ()
 {