aboutsummaryrefslogtreecommitdiffstats
path: root/src/undo.c
diff options
context:
space:
mode:
authorJoakim Verona2012-05-21 00:37:29 +0200
committerJoakim Verona2012-05-21 00:37:29 +0200
commit74f082445c1dd0c92d5bb187db0d50287e3a7bae (patch)
tree48e3d8fd9df3876665654eab9bcf96ec492a31e9 /src/undo.c
parent52862ad482e030e4d54cd7d6e250d76e59ee0554 (diff)
parent1b170bc63c2f3a3fbe6ba6996d5a015e82634909 (diff)
downloademacs-74f082445c1dd0c92d5bb187db0d50287e3a7bae.tar.gz
emacs-74f082445c1dd0c92d5bb187db0d50287e3a7bae.zip
upstream, fix conflicts
Diffstat (limited to 'src/undo.c')
-rw-r--r--src/undo.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/undo.c b/src/undo.c
index 4041a2adacc..b0acd0c216f 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
440static void user_error (const char*) NO_RETURN;
441static void user_error (const char *msg)
442{
443 xsignal1 (Quser_error, build_string (msg));
444}
445
439 446
440DEFUN ("primitive-undo", Fprimitive_undo, Sprimitive_undo, 2, 2, 0, 447DEFUN ("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