From 13b5221f4df08dd203b36cc444aab7e825dd29f8 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 7 Jun 2010 21:28:02 +0300 Subject: [PATCH] * window.el (pop-to-buffer): Remove the conditional that compares new-window and old-window, so it will reselect the selected window unconditionally. http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00078.html * window.c (Fselect_window): Move `record_buffer' up to the beginning of this function, so the buffer gets recorded even if the selected window does not change. http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00137.html --- lisp/ChangeLog | 7 +++++++ lisp/window.el | 15 ++++++--------- src/ChangeLog | 7 +++++++ src/window.c | 3 +-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 12de400ce07..04d914422e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2010-06-07 Martin Rudalics + + * window.el (pop-to-buffer): Remove the conditional that + compares new-window and old-window, so it will reselect + the selected window unconditionally. + http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00078.html + 2010-06-07 Stefan Monnier * emacs-lisp/smie.el (smie-indent-offset-after) diff --git a/lisp/window.el b/lisp/window.el index eb8bedcc9e8..b674b480025 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -1220,19 +1220,16 @@ at the front of the list of recently selected ones." (let ((buf (get-buffer-create buffer-or-name))) (set-buffer-major-mode buf) buf)))) - (old-window (selected-window)) (old-frame (selected-frame)) new-window new-frame) (set-buffer buffer) (setq new-window (display-buffer buffer other-window)) - (unless (eq new-window old-window) - ;; `display-buffer' has chosen another window, select it. - (select-window new-window norecord) - (setq new-frame (window-frame new-window)) - (unless (eq new-frame old-frame) - ;; `display-buffer' has chosen another frame, make sure it gets - ;; input focus and is risen. - (select-frame-set-input-focus new-frame))) + (select-window new-window norecord) + (setq new-frame (window-frame new-window)) + (unless (eq new-frame old-frame) + ;; `display-buffer' has chosen another frame, make sure it gets + ;; input focus and is risen. + (select-frame-set-input-focus new-frame)) buffer)) ;; I think this should be the default; I think people will prefer it--rms. diff --git a/src/ChangeLog b/src/ChangeLog index 8bf8d723e3e..d8990772d68 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2010-06-07 Martin Rudalics + + * window.c (Fselect_window): Move `record_buffer' up to the + beginning of this function, so the buffer gets recorded + even if the selected window does not change. + http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00137.html + 2010-06-07 Juanma Barranquero * cmds.c (Fforward_char, Fbackward_char): Fix typos in docstrings. diff --git a/src/window.c b/src/window.c index 882f76d9758..c6ea10ea95b 100644 --- a/src/window.c +++ b/src/window.c @@ -3611,6 +3611,7 @@ selected window before each command. */) { ++window_select_count; XSETFASTINT (w->use_time, window_select_count); + record_buffer (w->buffer); } if (EQ (window, selected_window)) @@ -3646,8 +3647,6 @@ selected window before each command. */) selected_window = window; - if (NILP (norecord)) - record_buffer (w->buffer); Fset_buffer (w->buffer); XBUFFER (w->buffer)->last_selected_window = window; -- 2.11.4.GIT