aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorMiles Bader2006-08-28 04:33:45 +0000
committerMiles Bader2006-08-28 04:33:45 +0000
commitd65dc2c390f866441935840580266c29e536fab1 (patch)
tree7633b31d5733cff6c6a6cb5313e5803e8dfa3894 /src/buffer.c
parente91a7588fd2ae02cc5f5538bd5590f0f56d08cd7 (diff)
parent7e87f9d8aeae0f0ea926a16cf8ae75c6b26caaaf (diff)
downloademacs-d65dc2c390f866441935840580266c29e536fab1.tar.gz
emacs-d65dc2c390f866441935840580266c29e536fab1.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 399-413) - Update from CVS - Rcirc update from Ryan Yeske - Merge from gnus--rel--5.10 - Miscellaneous tq-related fixes. * gnus--rel--5.10 (patch 126-127) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-105
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/src/buffer.c b/src/buffer.c
index d26c4451d13..48c3a2aeb5b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1685,9 +1685,18 @@ the window-buffer correspondences. */)
1685 char *err; 1685 char *err;
1686 1686
1687 if (EQ (buffer, Fwindow_buffer (selected_window))) 1687 if (EQ (buffer, Fwindow_buffer (selected_window)))
1688 /* Basically a NOP. Avoid signalling an error if the selected window 1688 {
1689 is dedicated, or a minibuffer, ... */ 1689 /* Basically a NOP. Avoid signalling an error in the case where
1690 return Fset_buffer (buffer); 1690 the selected window is dedicated, or a minibuffer. */
1691
1692 /* But do put this buffer at the front of the buffer list,
1693 unless that has been inhibited. Note that even if
1694 BUFFER is at the front of the main buffer-list already,
1695 we still want to move it to the front of the frame's buffer list. */
1696 if (NILP (norecord))
1697 record_buffer (buffer);
1698 return Fset_buffer (buffer);
1699 }
1691 1700
1692 err = no_switch_window (selected_window); 1701 err = no_switch_window (selected_window);
1693 if (err) error (err); 1702 if (err) error (err);
@@ -2118,10 +2127,11 @@ current buffer is cleared. */)
2118{ 2127{
2119 struct Lisp_Marker *tail, *markers; 2128 struct Lisp_Marker *tail, *markers;
2120 struct buffer *other; 2129 struct buffer *other;
2121 int undo_enabled_p = !EQ (current_buffer->undo_list, Qt);
2122 int begv, zv; 2130 int begv, zv;
2123 int narrowed = (BEG != BEGV || Z != ZV); 2131 int narrowed = (BEG != BEGV || Z != ZV);
2124 int modified_p = !NILP (Fbuffer_modified_p (Qnil)); 2132 int modified_p = !NILP (Fbuffer_modified_p (Qnil));
2133 Lisp_Object old_undo = current_buffer->undo_list;
2134 struct gcpro gcpro1;
2125 2135
2126 if (current_buffer->base_buffer) 2136 if (current_buffer->base_buffer)
2127 error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); 2137 error ("Cannot do `set-buffer-multibyte' on an indirect buffer");
@@ -2130,10 +2140,11 @@ current buffer is cleared. */)
2130 if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters)) 2140 if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters))
2131 return flag; 2141 return flag;
2132 2142
2133 /* It would be better to update the list, 2143 GCPRO1 (old_undo);
2134 but this is good enough for now. */ 2144
2135 if (undo_enabled_p) 2145 /* Don't record these buffer changes. We will put a special undo entry
2136 current_buffer->undo_list = Qt; 2146 instead. */
2147 current_buffer->undo_list = Qt;
2137 2148
2138 /* If the cached position is for this buffer, clear it out. */ 2149 /* If the cached position is for this buffer, clear it out. */
2139 clear_charpos_cache (current_buffer); 2150 clear_charpos_cache (current_buffer);
@@ -2346,8 +2357,17 @@ current buffer is cleared. */)
2346 set_intervals_multibyte (1); 2357 set_intervals_multibyte (1);
2347 } 2358 }
2348 2359
2349 if (undo_enabled_p) 2360 if (!EQ (old_undo, Qt))
2350 current_buffer->undo_list = Qnil; 2361 {
2362 /* Represent all the above changes by a special undo entry. */
2363 extern Lisp_Object Qapply;
2364 current_buffer->undo_list = Fcons (list3 (Qapply,
2365 intern ("set-buffer-multibyte"),
2366 NILP (flag) ? Qt : Qnil),
2367 old_undo);
2368 }
2369
2370 UNGCPRO;
2351 2371
2352 /* Changing the multibyteness of a buffer means that all windows 2372 /* Changing the multibyteness of a buffer means that all windows
2353 showing that buffer must be updated thoroughly. */ 2373 showing that buffer must be updated thoroughly. */