Mercurial > emacs
comparison src/undo.c @ 59777:06bae5eee9dc
(Fprimitive_undo): Handle (FUNNAME . ARGS) by calling FUNNAME.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sat, 29 Jan 2005 17:16:31 +0000 |
| parents | 27371673eba8 |
| children | fc2f566fb0fd |
comparison
equal
deleted
inserted
replaced
| 59776:eb109ea1450a | 59777:06bae5eee9dc |
|---|---|
| 517 #endif /* CLASH_DETECTION */ | 517 #endif /* CLASH_DETECTION */ |
| 518 Fset_buffer_modified_p (Qnil); | 518 Fset_buffer_modified_p (Qnil); |
| 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); |
| 526 cdr = Fcdr (cdr); | 526 cdr = Fcdr (cdr); |
| 527 val = Fcar (cdr); | 527 val = Fcar (cdr); |
| 540 error ("Changes to be undone are outside visible portion of buffer"); | 540 error ("Changes to be undone are outside visible portion of buffer"); |
| 541 /* Set point first thing, so that undoing this undo | 541 /* Set point first thing, so that undoing this undo |
| 542 does not send point back to where it is now. */ | 542 does not send point back to where it is now. */ |
| 543 Fgoto_char (car); | 543 Fgoto_char (car); |
| 544 Fdelete_region (car, cdr); | 544 Fdelete_region (car, cdr); |
| 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); | |
| 545 } | 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. */ |
| 549 Lisp_Object membuf; | 561 Lisp_Object membuf; |
| 587 } | 599 } |
| 588 | 600 |
| 589 UNGCPRO; | 601 UNGCPRO; |
| 590 return unbind_to (count, list); | 602 return unbind_to (count, list); |
| 591 } | 603 } |
| 592 | 604 |
| 593 void | 605 void |
| 594 syms_of_undo () | 606 syms_of_undo () |
| 595 { | 607 { |
| 596 Qinhibit_read_only = intern ("inhibit-read-only"); | 608 Qinhibit_read_only = intern ("inhibit-read-only"); |
| 597 staticpro (&Qinhibit_read_only); | 609 staticpro (&Qinhibit_read_only); |
