aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-03-28 13:25:25 +0400
committerDmitry Antipov2013-03-28 13:25:25 +0400
commitc7f53895b9e314345c08f000751a863bf78f7e18 (patch)
tree7adae9a11740ba9668117e451c5f93eddb82af30 /src/buffer.c
parentef454cf704fdf8862f9f75e20fa989a1564e4be9 (diff)
downloademacs-c7f53895b9e314345c08f000751a863bf78f7e18.tar.gz
emacs-c7f53895b9e314345c08f000751a863bf78f7e18.zip
Fix 2013-03-28T02:41:05Z!dmantipov@yandex.ru which brokes Fbuffer_swap_text.
* buffer.c (Fbuffer_swap_text): Adjust window start markers. Fix comment.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c
index aa3fcf8c234..d02bcf7eceb 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2394,8 +2394,9 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2394 BUF_MARKERS(buf) should either be for `buf' or dead. */ 2394 BUF_MARKERS(buf) should either be for `buf' or dead. */
2395 eassert (!m->buffer); 2395 eassert (!m->buffer);
2396 } 2396 }
2397 { /* Some of the C code expects that w->buffer == w->pointm->buffer. 2397 { /* Some of the C code expects that both window markers of a
2398 So since we just swapped the markers between the two buffers, we need 2398 live window points to that window's buffer. So since we
2399 just swapped the markers between the two buffers, we need
2399 to undo the effect of this swap for window markers. */ 2400 to undo the effect of this swap for window markers. */
2400 Lisp_Object w = Fselected_window (), ws = Qnil; 2401 Lisp_Object w = Fselected_window (), ws = Qnil;
2401 Lisp_Object buf1, buf2; 2402 Lisp_Object buf1, buf2;
@@ -2411,6 +2412,13 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2411 make_number 2412 make_number
2412 (BUF_BEGV (XBUFFER (XWINDOW (w)->buffer))), 2413 (BUF_BEGV (XBUFFER (XWINDOW (w)->buffer))),
2413 XWINDOW (w)->buffer); 2414 XWINDOW (w)->buffer);
2415 if (MARKERP (XWINDOW (w)->start)
2416 && (EQ (XWINDOW (w)->buffer, buf1)
2417 || EQ (XWINDOW (w)->buffer, buf2)))
2418 Fset_marker (XWINDOW (w)->start,
2419 make_number
2420 (XBUFFER (XWINDOW (w)->buffer)->last_window_start),
2421 XWINDOW (w)->buffer);
2414 w = Fnext_window (w, Qt, Qt); 2422 w = Fnext_window (w, Qt, Qt);
2415 } 2423 }
2416 } 2424 }