* lisp/window.el (switch-to-buffer): Re-add the warning that was lost in the
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 19 Nov 2012 03:16:03 +0000 (22:16 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 19 Nov 2012 03:16:03 +0000 (22:16 -0500)
code rewrite.

lisp/ChangeLog
lisp/window.el

index a6fdf7e..85e7624 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * window.el (switch-to-buffer): Re-add the warning that was lost in the
+       code rewrite.
+
 2012-11-18  Paul Eggert  <eggert@cs.ucla.edu>
 
        More minor time fixes.
index d378ea5..52909fa 100644 (file)
@@ -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