update.
[chise/xemacs-chise.git.1] / lisp / buffer.el
index e7920c0..057583b 100644 (file)
@@ -32,9 +32,6 @@
 
 ;;; Code:
 
-(defvar switch-to-buffer-hooks nil
-  "Hooks to run after a recorded buffer switch.")
-
 (defun switch-to-buffer (bufname &optional norecord)
   "Select buffer BUFNAME in the current window.
 BUFNAME may be a buffer or a buffer name and is created if it did not exist.
@@ -63,13 +60,7 @@ the window-buffer correspondences."
            (set-buffer-major-mode buf))))
     (push-window-configuration)
     (set-buffer buf)
-    (or norecord (record-buffer buf))
-    (set-window-buffer (if (eq (selected-window) (minibuffer-window))
-                          (next-window (minibuffer-window))
-                        (selected-window))
-                      buf)
-    ;; XEmacs change
-    (or norecord (run-hook-with-args 'switch-to-buffer-hooks buf))
+    (set-window-buffer (last-nonminibuf-window) buf norecord)
     buf))
 
 (defun pop-to-buffer (bufname &optional not-this-window-p on-frame)
@@ -80,7 +71,12 @@ If optional second arg NOT-THIS-WINDOW-P is non-nil, insist on finding
 another window even if BUFNAME is already visible in the selected window.
 If optional third arg is non-nil, it is the frame to pop to this
 buffer on.
-If `focus-follows-mouse' is non-nil, keyboard focus is left unchanged."
+If `focus-follows-mouse' is non-nil, keyboard focus is left unchanged.
+
+Buffers with names that are members of the `same-window-buffer-names'
+list, or that match an element of the `same-window-regexps' list are
+treated specially by this function--they are always selected in the
+same window rather than in a different one."
   ;; #ifdef I18N3
   ;; #### Doc string should indicate that the buffer name will get
   ;; translated.