[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/buffer.c,v
From: |
Kim F. Storm |
Subject: |
[Emacs-diffs] Changes to emacs/src/buffer.c,v |
Date: |
Tue, 22 Aug 2006 09:26:00 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Kim F. Storm <kfstorm> 06/08/22 09:26:00
Index: buffer.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/buffer.c,v
retrieving revision 1.506
retrieving revision 1.507
diff -u -b -r1.506 -r1.507
--- buffer.c 6 Aug 2006 14:22:24 -0000 1.506
+++ buffer.c 22 Aug 2006 09:25:59 -0000 1.507
@@ -2115,10 +2115,11 @@
{
struct Lisp_Marker *tail, *markers;
struct buffer *other;
- int undo_enabled_p = !EQ (current_buffer->undo_list, Qt);
int begv, zv;
int narrowed = (BEG != BEGV || Z != ZV);
int modified_p = !NILP (Fbuffer_modified_p (Qnil));
+ Lisp_Object old_undo = current_buffer->undo_list;
+ struct gcpro gcpro1;
if (current_buffer->base_buffer)
error ("Cannot do `set-buffer-multibyte' on an indirect buffer");
@@ -2127,9 +2128,10 @@
if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters))
return flag;
- /* It would be better to update the list,
- but this is good enough for now. */
- if (undo_enabled_p)
+ GCPRO1 (old_undo);
+
+ /* Don't record these buffer changes. We will put a special undo entry
+ instead. */
current_buffer->undo_list = Qt;
/* If the cached position is for this buffer, clear it out. */
@@ -2330,8 +2332,18 @@
set_intervals_multibyte (1);
}
- if (undo_enabled_p)
- current_buffer->undo_list = Qnil;
+ if (!EQ (old_undo, Qt))
+ {
+ /* Represent all the above changes by a special undo entry. */
+ extern Lisp_Object Qapply;
+ Lisp_Object args[3];
+ args[0] = Qapply;
+ args[1] = intern ("set-buffer-multibyte");
+ args[2] = NILP (flag) ? Qt : Qnil;
+ current_buffer->undo_list = Fcons (Flist (3, args), old_undo);
+ }
+
+ UNGCPRO;
/* Changing the multibyteness of a buffer means that all windows
showing that buffer must be updated thoroughly. */
- [Emacs-diffs] Changes to emacs/src/buffer.c,v, Chong Yidong, 2006/08/06
- [Emacs-diffs] Changes to emacs/src/buffer.c,v,
Kim F. Storm <=
- [Emacs-diffs] Changes to emacs/src/buffer.c,v, Nick Roberts, 2006/08/24
- [Emacs-diffs] Changes to emacs/src/buffer.c,v, Richard M. Stallman, 2006/08/25
- [Emacs-diffs] Changes to emacs/src/buffer.c,v, Kim F. Storm, 2006/08/25