comparison src/undo.c @ 2194:886a69457557

(record_property_change, record_delete, record_insert): Don't make boundary or touch last_undo_buffer if cur buf has no undo.
author Richard M. Stallman <rms@gnu.org>
date Mon, 15 Mar 1993 06:03:33 +0000
parents de0a0ed7318e
children e94a593c3952
comparison
equal deleted inserted replaced
2193:652b38173a63 2194:886a69457557
34 record_insert (beg, length) 34 record_insert (beg, length)
35 Lisp_Object beg, length; 35 Lisp_Object beg, length;
36 { 36 {
37 Lisp_Object lbeg, lend; 37 Lisp_Object lbeg, lend;
38 38
39 if (EQ (current_buffer->undo_list, Qt))
40 return;
41
39 if (current_buffer != XBUFFER (last_undo_buffer)) 42 if (current_buffer != XBUFFER (last_undo_buffer))
40 Fundo_boundary (); 43 Fundo_boundary ();
41 XSET (last_undo_buffer, Lisp_Buffer, current_buffer); 44 XSET (last_undo_buffer, Lisp_Buffer, current_buffer);
42 45
43 if (EQ (current_buffer->undo_list, Qt))
44 return;
45 if (MODIFF <= current_buffer->save_modified) 46 if (MODIFF <= current_buffer->save_modified)
46 record_first_change (); 47 record_first_change ();
47 48
48 /* If this is following another insertion and consecutive with it 49 /* If this is following another insertion and consecutive with it
49 in the buffer, combine the two. */ 50 in the buffer, combine the two. */
73 record_delete (beg, length) 74 record_delete (beg, length)
74 int beg, length; 75 int beg, length;
75 { 76 {
76 Lisp_Object lbeg, lend, sbeg; 77 Lisp_Object lbeg, lend, sbeg;
77 78
79 if (EQ (current_buffer->undo_list, Qt))
80 return;
81
78 if (current_buffer != XBUFFER (last_undo_buffer)) 82 if (current_buffer != XBUFFER (last_undo_buffer))
79 Fundo_boundary (); 83 Fundo_boundary ();
80 XSET (last_undo_buffer, Lisp_Buffer, current_buffer); 84 XSET (last_undo_buffer, Lisp_Buffer, current_buffer);
81 85
82 if (EQ (current_buffer->undo_list, Qt))
83 return;
84 if (MODIFF <= current_buffer->save_modified) 86 if (MODIFF <= current_buffer->save_modified)
85 record_first_change (); 87 record_first_change ();
86 88
87 if (point == beg + length) 89 if (point == beg + length)
88 XSET (sbeg, Lisp_Int, -beg); 90 XSET (sbeg, Lisp_Int, -beg);
133 { 135 {
134 Lisp_Object lbeg, lend, entry; 136 Lisp_Object lbeg, lend, entry;
135 struct buffer *obuf = current_buffer; 137 struct buffer *obuf = current_buffer;
136 int boundary = 0; 138 int boundary = 0;
137 139
140 if (EQ (current_buffer->undo_list, Qt))
141 return;
142
138 if (!EQ (buffer, last_undo_buffer)) 143 if (!EQ (buffer, last_undo_buffer))
139 boundary = 1; 144 boundary = 1;
140 last_undo_buffer = buffer; 145 last_undo_buffer = buffer;
141
142 if (EQ (current_buffer->undo_list, Qt))
143 return;
144 146
145 /* Switch temporarily to the buffer that was changed. */ 147 /* Switch temporarily to the buffer that was changed. */
146 current_buffer = XBUFFER (buffer); 148 current_buffer = XBUFFER (buffer);
147 149
148 if (boundary) 150 if (boundary)