From: Stefan Monnier Date: Mon, 19 Nov 2012 03:16:03 +0000 (-0500) Subject: * lisp/window.el (switch-to-buffer): Re-add the warning that was lost in the X-Git-Tag: emacs-24.2.90~38 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d1c0cddf73e3edf4b1a7bbaa9e24caa817bd10e1;p=emacs.git * lisp/window.el (switch-to-buffer): Re-add the warning that was lost in the code rewrite. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a6fdf7ebc4b..85e762497e4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-11-19 Stefan Monnier + + * window.el (switch-to-buffer): Re-add the warning that was lost in the + code rewrite. + 2012-11-18 Paul Eggert More minor time fixes. diff --git a/lisp/window.el b/lisp/window.el index d378ea5ff14..52909fa9e5f 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5870,7 +5870,12 @@ the selected window or never appeared in it before, or if :version "24.3") (defun switch-to-buffer (buffer-or-name &optional norecord force-same-window) - "Switch to buffer BUFFER-OR-NAME in the selected window. + "Display buffer BUFFER-OR-NAME in the selected window. + +WARNING: This is NOT the way to work on another buffer temporarily +within a Lisp program! Use `set-buffer' instead. That avoids +messing with the window-buffer correspondences. + If the selected window cannot display the specified buffer (e.g. if it is a minibuffer window or strongly dedicated to another buffer), call `pop-to-buffer' to select the buffer in