aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2013-04-12 13:32:52 -0400
committerStefan Monnier2013-04-12 13:32:52 -0400
commit562c6ee9450073547ae45e88116cfc213c2254e0 (patch)
tree39a80f3fc5dc0b59fa068ea2d44c7028c53c328c /src
parent320742098b941833731b20d4bd2de7cc4c93ec76 (diff)
downloademacs-562c6ee9450073547ae45e88116cfc213c2254e0.tar.gz
emacs-562c6ee9450073547ae45e88116cfc213c2254e0.zip
* src/window.c (select_window): `record_buffer' even if window is
already selected. Fixes: debbugs:14191
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog29
-rw-r--r--src/window.c10
2 files changed, 24 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7f4c59b8eb4..08f33eb7d02 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * window.c (select_window): `record_buffer' even if window is
4 already selected (bug#14191).
5
12013-04-11 Eli Zaretskii <eliz@gnu.org> 62013-04-11 Eli Zaretskii <eliz@gnu.org>
2 7
3 * window.c (Fwindow_end): Test more flags, including the buffer's 8 * window.c (Fwindow_end): Test more flags, including the buffer's
@@ -10,8 +15,8 @@
102013-04-10 Eli Zaretskii <eliz@gnu.org> 152013-04-10 Eli Zaretskii <eliz@gnu.org>
11 16
12 * frame.c (do_switch_frame): Mark the TTY frame we switch to as 17 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
13 garbaged only if it is not already the top frame on its TTY. This 18 garbaged only if it is not already the top frame on its TTY.
14 prevents flickering due to constant redrawing of TTY frames when 19 This prevents flickering due to constant redrawing of TTY frames when
15 there are GUI frames open in the same session. (Bug#13864) 20 there are GUI frames open in the same session. (Bug#13864)
16 21
172013-04-10 Stefan Monnier <monnier@iro.umontreal.ca> 222013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -95,7 +100,7 @@
95 The following changes is to optimize the code for reading UTF-8 100 The following changes is to optimize the code for reading UTF-8
96 files. 101 files.
97 102
98 * coding.c (check_ascii): Renamed from detect_ascii. Return value 103 * coding.c (check_ascii): Rename from detect_ascii. Return value
99 changed. Check EOL format. Do not call adjust_coding_eol_type 104 changed. Check EOL format. Do not call adjust_coding_eol_type
100 here. 105 here.
101 (check_utf_8): New function. 106 (check_utf_8): New function.
@@ -287,8 +292,8 @@
287 292
288 * xdisp.c (with_echo_area_buffer_unwind_data): Save window 293 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
289 start marker... 294 start marker...
290 (unwind_with_echo_area_buffer): ...to restore it here. This 295 (unwind_with_echo_area_buffer): ...to restore it here.
291 is needed to ensure that... 296 This is needed to ensure that...
292 (redisplay_window): ...both window markers are valid here, 297 (redisplay_window): ...both window markers are valid here,
293 which is verified by eassert. 298 which is verified by eassert.
294 * editfns.c (save_excursion_save): Do not assume that 299 * editfns.c (save_excursion_save): Do not assume that
@@ -438,10 +443,10 @@
438 443
439 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH, 444 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
440 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static 445 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
441 variables, to save and restore frame dimensions. Use 446 variables, to save and restore frame dimensions.
442 FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position 447 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
443 after returning from a 'fullscreen' configuration. use 448 after returning from a 'fullscreen' configuration.
444 SendMessage instead of PostMessage to send the SC_RESTORE message, 449 use SendMessage instead of PostMessage to send the SC_RESTORE message,
445 to avoid races between the main thread and the input thread. 450 to avoid races between the main thread and the input thread.
446 451
447 * w32term.h (struct w32_output): New members normal_width, 452 * w32term.h (struct w32_output): New members normal_width,
@@ -526,10 +531,10 @@
526 531
527 * frame.h (struct frame): Drop resx and resy because the same data is 532 * frame.h (struct frame): Drop resx and resy because the same data is
528 available from window system-specific output context. Adjust users. 533 available from window system-specific output context. Adjust users.
529 (default_pixels_per_inch_x, default_pixels_per_inch_y): New 534 (default_pixels_per_inch_x, default_pixels_per_inch_y):
530 functions to provide defaults when no window system available. 535 New functions to provide defaults when no window system available.
531 (FRAME_RES_X, FRAME_RES_Y): New macros. 536 (FRAME_RES_X, FRAME_RES_Y): New macros.
532 (NUMVAL): Moved from xdisp.c. 537 (NUMVAL): Move from xdisp.c.
533 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface) 538 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
534 (Ffont_face_attributes, Fopen_font): 539 (Ffont_face_attributes, Fopen_font):
535 * image.c (gs_load): 540 * image.c (gs_load):
diff --git a/src/window.c b/src/window.c
index fe5b5ec1e6e..7cf35a480f7 100644
--- a/src/window.c
+++ b/src/window.c
@@ -489,7 +489,10 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
489 Fset_buffer (w->contents); 489 Fset_buffer (w->contents);
490 490
491 if (EQ (window, selected_window) && !inhibit_point_swap) 491 if (EQ (window, selected_window) && !inhibit_point_swap)
492 return window; 492 /* `switch-to-buffer' uses (select-window (selected-window)) as a "clever"
493 way to call record_buffer from Elisp, so it's important that we call
494 record_buffer before returning here. */
495 goto record_and_return;
493 496
494 sf = SELECTED_FRAME (); 497 sf = SELECTED_FRAME ();
495 if (XFRAME (WINDOW_FRAME (w)) != sf) 498 if (XFRAME (WINDOW_FRAME (w)) != sf)
@@ -508,7 +511,10 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
508 fset_selected_window (sf, window); 511 fset_selected_window (sf, window);
509 512
510 select_window_1 (window, inhibit_point_swap); 513 select_window_1 (window, inhibit_point_swap);
514 bset_last_selected_window (XBUFFER (w->contents), window);
515 windows_or_buffers_changed++;
511 516
517 record_and_return:
512 /* record_buffer can run QUIT, so make sure it is run only after we have 518 /* record_buffer can run QUIT, so make sure it is run only after we have
513 re-established the invariant between selected_window and selected_frame, 519 re-established the invariant between selected_window and selected_frame,
514 otherwise the temporary broken invariant might "escape" (bug#14161). */ 520 otherwise the temporary broken invariant might "escape" (bug#14161). */
@@ -518,8 +524,6 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
518 record_buffer (w->contents); 524 record_buffer (w->contents);
519 } 525 }
520 526
521 bset_last_selected_window (XBUFFER (w->contents), window);
522 windows_or_buffers_changed++;
523 return window; 527 return window;
524} 528}
525 529