comparison src/undo.c @ 5762:099857a46901

(record_first_change): Check for buffer-undo-list = t. Make an undo boundary if appropriate. Set last_undo_buffer. (record_property_change): Use BUFFER, not current_buffer, when testing undo_list.
author Richard M. Stallman <rms@gnu.org>
date Thu, 03 Feb 1994 19:39:21 +0000
parents 1fc792473491
children d369907be635
comparison
equal deleted inserted replaced
5761:7bea55d86ff6 5762:099857a46901
121 we can tell whether it is obsolete because the file was saved again. */ 121 we can tell whether it is obsolete because the file was saved again. */
122 122
123 record_first_change () 123 record_first_change ()
124 { 124 {
125 Lisp_Object high, low; 125 Lisp_Object high, low;
126
127 if (EQ (current_buffer->undo_list, Qt))
128 return;
129
130 if (current_buffer != XBUFFER (last_undo_buffer))
131 Fundo_boundary ();
132 XSET (last_undo_buffer, Lisp_Buffer, current_buffer);
133
126 XFASTINT (high) = (current_buffer->modtime >> 16) & 0xffff; 134 XFASTINT (high) = (current_buffer->modtime >> 16) & 0xffff;
127 XFASTINT (low) = current_buffer->modtime & 0xffff; 135 XFASTINT (low) = current_buffer->modtime & 0xffff;
128 current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list); 136 current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list);
129 } 137 }
130 138
137 { 145 {
138 Lisp_Object lbeg, lend, entry; 146 Lisp_Object lbeg, lend, entry;
139 struct buffer *obuf = current_buffer; 147 struct buffer *obuf = current_buffer;
140 int boundary = 0; 148 int boundary = 0;
141 149
142 if (EQ (current_buffer->undo_list, Qt)) 150 if (EQ (XBUFFER (buffer)->undo_list, Qt))
143 return; 151 return;
144 152
145 if (!EQ (buffer, last_undo_buffer)) 153 if (!EQ (buffer, last_undo_buffer))
146 boundary = 1; 154 boundary = 1;
147 last_undo_buffer = buffer; 155 last_undo_buffer = buffer;