From 75c68aa1b696fca51177e7777e4aa9838a1b4660 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 15 Jul 2011 09:12:09 +0200 Subject: [PATCH] Fix pop-to-buffer call in switch-to-buffer. * window.el (switch-to-buffer): Call pop-to-buffer with normalized buffer argument (Bug#9083) and self-identifying label argument. --- lisp/ChangeLog | 5 +++++ lisp/window.el | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1b3e25da8e1..96f4dd07612 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-07-15 Martin Rudalics + + * window.el (switch-to-buffer): Call pop-to-buffer with normalized + buffer argument (Bug#9083) and self-identifying label argument. + 2011-07-15 Glenn Morris * emacs-lisp/debug.el (debug): Doc fix. (Bug#8273) diff --git a/lisp/window.el b/lisp/window.el index 0302a672521..4f21bb05397 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5953,13 +5953,13 @@ Return the buffer switched to." (list (read-buffer-to-switch "Switch to buffer: ") nil nil)) (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name))) (if (null force-same-window) - (pop-to-buffer buffer-or-name - '(same-window (reuse-window-dedicated . weak)) - norecord nil) + (pop-to-buffer + buffer '(same-window (reuse-window-dedicated . weak)) + norecord 'switch-to-buffer) (cond ;; Don't call set-window-buffer if it's not needed since it ;; might signal an error (e.g. if the window is dedicated). - ((eq buffer (window-buffer)) nil) + ((eq buffer (window-buffer))) ((window-minibuffer-p) (error "Cannot switch buffers in minibuffer window")) ((eq (window-dedicated-p) t) -- 2.39.2