aboutsummaryrefslogtreecommitdiffstats
path: root/src/undo.c
diff options
context:
space:
mode:
authorMiles Bader2008-01-30 07:57:28 +0000
committerMiles Bader2008-01-30 07:57:28 +0000
commitd235ca2ff8fab139ce797757fcb159d1e28fa7e0 (patch)
tree96c5cd1a06a0d9dc26e8470c6eabfc032c0046f3 /src/undo.c
parent3709a060f679dba14df71ae64a0035fa2b5b3106 (diff)
parent02cbe062bee38a6705bafb1699d77e3c44cfafcf (diff)
downloademacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.tar.gz
emacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.zip
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-324
Diffstat (limited to 'src/undo.c')
-rw-r--r--src/undo.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/undo.c b/src/undo.c
index bf528e23935..77590e4ace8 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -53,8 +53,12 @@ Lisp_Object Qapply;
53 an undo-boundary. */ 53 an undo-boundary. */
54Lisp_Object pending_boundary; 54Lisp_Object pending_boundary;
55 55
56/* Nonzero means do not record point in record_point. */
57
58int undo_inhibit_record_point;
59
56/* Record point as it was at beginning of this command (if necessary) 60/* Record point as it was at beginning of this command (if necessary)
57 And prepare the undo info for recording a change. 61 and prepare the undo info for recording a change.
58 PT is the position of point that will naturally occur as a result of the 62 PT is the position of point that will naturally occur as a result of the
59 undo record that will be added just after this command terminates. */ 63 undo record that will be added just after this command terminates. */
60 64
@@ -64,6 +68,14 @@ record_point (pt)
64{ 68{
65 int at_boundary; 69 int at_boundary;
66 70
71 /* Don't record position of pt when undo_inhibit_record_point holds.
72 Needed to avoid inserting a position record in buffer-undo-list
73 when last_point_position has not been set up correctly by
74 command_loop_1, for example, when running a repeat-repeat-char
75 event. */
76 if (undo_inhibit_record_point)
77 return;
78
67 /* Allocate a cons cell to be the undo boundary after this command. */ 79 /* Allocate a cons cell to be the undo boundary after this command. */
68 if (NILP (pending_boundary)) 80 if (NILP (pending_boundary))
69 pending_boundary = Fcons (Qnil, Qnil); 81 pending_boundary = Fcons (Qnil, Qnil);
@@ -719,6 +731,10 @@ If it returns nil, the other forms of truncation are done.
719Garbage collection is inhibited around the call to this function, 731Garbage collection is inhibited around the call to this function,
720so it must make sure not to do a lot of consing. */); 732so it must make sure not to do a lot of consing. */);
721 Vundo_outer_limit_function = Qnil; 733 Vundo_outer_limit_function = Qnil;
734
735 DEFVAR_BOOL ("undo-inhibit-record-point", &undo_inhibit_record_point,
736 doc: /* Non-nil means do not record `point' in `buffer-undo-list'. */);
737 undo_inhibit_record_point = 0;
722} 738}
723 739
724/* arch-tag: d546ee01-4aed-4ffb-bb8b-eefaae50d38a 740/* arch-tag: d546ee01-4aed-4ffb-bb8b-eefaae50d38a