diff options
| author | Stefan Monnier | 2008-09-12 03:41:11 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-09-12 03:41:11 +0000 |
| commit | da39107c7b70daf7dc0a160936bdb565bbc36918 (patch) | |
| tree | 9608cd0b04bd26f4855da8791ca90da2e863c5a3 /src | |
| parent | c8f94403424bc811ab2f7b8998648f936794476d (diff) | |
| download | emacs-da39107c7b70daf7dc0a160936bdb565bbc36918.tar.gz emacs-da39107c7b70daf7dc0a160936bdb565bbc36918.zip | |
(set_window_buffer): Always preserve current-buffer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/window.c | 18 |
2 files changed, 7 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bef4d029e93..adcc4851d22 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2008-09-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * window.c (set_window_buffer): Always preserve current-buffer. | ||
| 4 | |||
| 1 | 2008-09-12 Glenn Morris <rgm@gnu.org> | 5 | 2008-09-12 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * charset.c (init_charset): Warn if etc/charsets not found. (Bug#909) | 7 | * charset.c (init_charset): Warn if etc/charsets not found. (Bug#909) |
diff --git a/src/window.c b/src/window.c index de0d0d01589..f3154849fef 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3281,14 +3281,6 @@ change_window_heights (window, n) | |||
| 3281 | 3281 | ||
| 3282 | int window_select_count; | 3282 | int window_select_count; |
| 3283 | 3283 | ||
| 3284 | Lisp_Object | ||
| 3285 | Fset_window_buffer_unwind (obuf) | ||
| 3286 | Lisp_Object obuf; | ||
| 3287 | { | ||
| 3288 | Fset_buffer (obuf); | ||
| 3289 | return Qnil; | ||
| 3290 | } | ||
| 3291 | |||
| 3292 | EXFUN (Fset_window_fringes, 4); | 3284 | EXFUN (Fset_window_fringes, 4); |
| 3293 | EXFUN (Fset_window_scroll_bars, 4); | 3285 | EXFUN (Fset_window_scroll_bars, 4); |
| 3294 | 3286 | ||
| @@ -3407,16 +3399,12 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p) | |||
| 3407 | I doubt it's worth the trouble. */ | 3399 | I doubt it's worth the trouble. */ |
| 3408 | windows_or_buffers_changed++; | 3400 | windows_or_buffers_changed++; |
| 3409 | 3401 | ||
| 3410 | /* We must select BUFFER for running the window-scroll-functions. | 3402 | /* We must select BUFFER for running the window-scroll-functions. */ |
| 3411 | If WINDOW is selected, switch permanently. | ||
| 3412 | Otherwise, switch but go back to the ambient buffer afterward. */ | ||
| 3413 | if (EQ (window, selected_window)) | ||
| 3414 | Fset_buffer (buffer); | ||
| 3415 | /* We can't check ! NILP (Vwindow_scroll_functions) here | 3403 | /* We can't check ! NILP (Vwindow_scroll_functions) here |
| 3416 | because that might itself be a local variable. */ | 3404 | because that might itself be a local variable. */ |
| 3417 | else if (window_initialized) | 3405 | if (window_initialized) |
| 3418 | { | 3406 | { |
| 3419 | record_unwind_protect (Fset_window_buffer_unwind, Fcurrent_buffer ()); | 3407 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); |
| 3420 | Fset_buffer (buffer); | 3408 | Fset_buffer (buffer); |
| 3421 | } | 3409 | } |
| 3422 | 3410 | ||