diff options
| author | Paul Eggert | 2012-05-25 11:19:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-05-25 11:19:24 -0700 |
| commit | 42b2a986d9d4b7040fb20c90ec0efeffb78e761a (patch) | |
| tree | d38e7bf5307837f2f38982757f088100de18a64e /src/undo.c | |
| parent | e4d81efc58695c19154d5f6733d91172b4c3e5b7 (diff) | |
| parent | a8d3cbf75d219d7a249fc0623219511179e959da (diff) | |
| download | emacs-42b2a986d9d4b7040fb20c90ec0efeffb78e761a.tar.gz emacs-42b2a986d9d4b7040fb20c90ec0efeffb78e761a.zip | |
Merge from trunk.
Diffstat (limited to 'src/undo.c')
| -rw-r--r-- | src/undo.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/undo.c b/src/undo.c index 929955ffcf5..9b763984d7f 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -436,6 +436,13 @@ truncate_undo_list (struct buffer *b) | |||
| 436 | 436 | ||
| 437 | unbind_to (count, Qnil); | 437 | unbind_to (count, Qnil); |
| 438 | } | 438 | } |
| 439 | |||
| 440 | static void user_error (const char*) NO_RETURN; | ||
| 441 | static void user_error (const char *msg) | ||
| 442 | { | ||
| 443 | xsignal1 (Quser_error, build_string (msg)); | ||
| 444 | } | ||
| 445 | |||
| 439 | 446 | ||
| 440 | DEFUN ("primitive-undo", Fprimitive_undo, Sprimitive_undo, 2, 2, 0, | 447 | DEFUN ("primitive-undo", Fprimitive_undo, Sprimitive_undo, 2, 2, 0, |
| 441 | doc: /* Undo N records from the front of the list LIST. | 448 | doc: /* Undo N records from the front of the list LIST. |
| @@ -528,7 +535,7 @@ Return what remains of the list. */) | |||
| 528 | end = Fcdr (cdr); | 535 | end = Fcdr (cdr); |
| 529 | 536 | ||
| 530 | if (XINT (beg) < BEGV || XINT (end) > ZV) | 537 | if (XINT (beg) < BEGV || XINT (end) > ZV) |
| 531 | error ("Changes to be undone are outside visible portion of buffer"); | 538 | user_error ("Changes to be undone are outside visible portion of buffer"); |
| 532 | Fput_text_property (beg, end, prop, val, Qnil); | 539 | Fput_text_property (beg, end, prop, val, Qnil); |
| 533 | } | 540 | } |
| 534 | else if (INTEGERP (car) && INTEGERP (cdr)) | 541 | else if (INTEGERP (car) && INTEGERP (cdr)) |
| @@ -537,7 +544,7 @@ Return what remains of the list. */) | |||
| 537 | 544 | ||
| 538 | if (XINT (car) < BEGV | 545 | if (XINT (car) < BEGV |
| 539 | || XINT (cdr) > ZV) | 546 | || XINT (cdr) > ZV) |
| 540 | error ("Changes to be undone are outside visible portion of buffer"); | 547 | user_error ("Changes to be undone are outside visible portion of buffer"); |
| 541 | /* Set point first thing, so that undoing this undo | 548 | /* Set point first thing, so that undoing this undo |
| 542 | does not send point back to where it is now. */ | 549 | does not send point back to where it is now. */ |
| 543 | Fgoto_char (car); | 550 | Fgoto_char (car); |
| @@ -588,14 +595,14 @@ Return what remains of the list. */) | |||
| 588 | if (pos < 0) | 595 | if (pos < 0) |
| 589 | { | 596 | { |
| 590 | if (-pos < BEGV || -pos > ZV) | 597 | if (-pos < BEGV || -pos > ZV) |
| 591 | error ("Changes to be undone are outside visible portion of buffer"); | 598 | user_error ("Changes to be undone are outside visible portion of buffer"); |
| 592 | SET_PT (-pos); | 599 | SET_PT (-pos); |
| 593 | Finsert (1, &membuf); | 600 | Finsert (1, &membuf); |
| 594 | } | 601 | } |
| 595 | else | 602 | else |
| 596 | { | 603 | { |
| 597 | if (pos < BEGV || pos > ZV) | 604 | if (pos < BEGV || pos > ZV) |
| 598 | error ("Changes to be undone are outside visible portion of buffer"); | 605 | user_error ("Changes to be undone are outside visible portion of buffer"); |
| 599 | SET_PT (pos); | 606 | SET_PT (pos); |
| 600 | 607 | ||
| 601 | /* Now that we record marker adjustments | 608 | /* Now that we record marker adjustments |