]> code.delx.au - gnu-emacs/commitdiff
Change modes that used same-window-* vars to use switch-to-buffer.
authorChong Yidong <cyd@stupidchicken.com>
Sun, 11 Sep 2011 18:30:07 +0000 (14:30 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 11 Sep 2011 18:30:07 +0000 (14:30 -0400)
* cmuscheme.el (run-scheme, switch-to-scheme):
* ielm.el (ielm):
* shell.el (shell):
* net/rlogin.el (rlogin):
* net/telnet.el (telnet, rsh):
* progmodes/inf-lisp.el (inferior-lisp): Use switch-to-buffer.

* cus-edit.el (customize-group, custom-buffer-create)
(customize-browse, custom-buffer-create-other-window): Use
switch-to-buffer or switch-to-buffer-other-window.

* info.el (info, Info-find-node, Info-revert-find-node, Info-next)
(Info-prev, Info-up, Info-speedbar-goto-node)
(info-display-manual): Use switch-to-buffer.
(Info-speedbar-goto-node): Use switch-to-buffer-other-frame.

* lisp/gnus/message.el (message-pop-to-buffer): Default to switch-to-buffer.
(message-mail-other-window, message-mail-other-frame)
(message-news-other-window, message-news-other-frame): Use
switch-to-buffer-other-frame and switch-to-buffer-other-window instead
of setting buffer display varibles.

* mail/sendmail.el (mail): Use switch-to-buffer.
(mail-recover): Use switch-to-buffer-other-window.

* progmodes/gdb-mi.el (gdb-restore-windows, gdb-setup-windows):
Use switch-to-buffer.

15 files changed:
lisp/ChangeLog
lisp/cmuscheme.el
lisp/cus-edit.el
lisp/gnus/ChangeLog
lisp/gnus/message.el
lisp/ielm.el
lisp/info.el
lisp/mail/sendmail.el
lisp/net/rlogin.el
lisp/net/telnet.el
lisp/progmodes/gdb-mi.el
lisp/progmodes/gud.el
lisp/progmodes/inf-lisp.el
lisp/shell.el
lisp/window.el

index 7a493676add9226d0d1cba45d8b28b6cf5a35d05..cb6ca9f2c61f455428cbb12d58c4cdcadef47ad4 100644 (file)
@@ -1,3 +1,29 @@
+2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
+
+       Change modes that used same-window-* vars to use switch-to-buffer.
+
+       * progmodes/gdb-mi.el (gdb-restore-windows, gdb-setup-windows):
+       Use switch-to-buffer.
+
+       * cus-edit.el (customize-group, custom-buffer-create)
+       (customize-browse, custom-buffer-create-other-window): Use
+       switch-to-buffer or switch-to-buffer-other-window.
+
+       * info.el (info, Info-find-node, Info-revert-find-node, Info-next)
+       (Info-prev, Info-up, Info-speedbar-goto-node)
+       (info-display-manual): Use switch-to-buffer.
+       (Info-speedbar-goto-node): Use switch-to-buffer-other-frame.
+
+       * mail/sendmail.el (mail): Use switch-to-buffer.
+       (mail-recover): Use switch-to-buffer-other-window.
+
+       * cmuscheme.el (run-scheme, switch-to-scheme):
+       * ielm.el (ielm):
+       * shell.el (shell):
+       * net/rlogin.el (rlogin):
+       * net/telnet.el (telnet, rsh):
+       * progmodes/inf-lisp.el (inferior-lisp): Use switch-to-buffer.
+
 2011-09-11  Andreas Schwab  <schwab@linux-m68k.org>
 
        * dired.el (dired-sort-toggle-or-edit): Revert last changes.
index 5998110386ea7ae90b082665ccb40d95f092321c..6eb2aa761351542e26a7ca75d6da9b369710caae 100644 (file)
@@ -246,7 +246,7 @@ is run).
        (inferior-scheme-mode)))
   (setq scheme-program-name cmd)
   (setq scheme-buffer "*scheme*")
-  (pop-to-buffer "*scheme*"))
+  (switch-to-buffer "*scheme*"))
 
 (defun scheme-start-file (prog)
   "Return the name of the start file corresponding to PROG.
@@ -371,7 +371,7 @@ With argument, position cursor at end of buffer."
   (interactive "P")
   (if (or (and scheme-buffer (get-buffer scheme-buffer))
           (scheme-interactively-start-process))
-      (pop-to-buffer scheme-buffer)
+      (switch-to-buffer scheme-buffer)
     (error "No current process buffer.  See variable `scheme-buffer'"))
   (when eob-p
     (push-mark)
index 4411fb42508a71887275621a279f239dfd9e6cf6..620ecdba40cb3669bbfa40c32a0261c54cfef753 100644 (file)
@@ -1112,7 +1112,7 @@ If OTHER-WINDOW is non-nil, display in another window."
   (let ((name (format "*Customize Group: %s*"
                      (custom-unlispify-tag-name group))))
     (if (get-buffer name)
-        (pop-to-buffer name other-window)
+        (switch-to-buffer name other-window)
       (funcall (if other-window
                   'custom-buffer-create-other-window
                 'custom-buffer-create)
@@ -1533,7 +1533,7 @@ Optional NAME is the name of the buffer.
 OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where
 SYMBOL is a customization option, and WIDGET is a widget for editing
 that option."
-  (pop-to-buffer (custom-get-fresh-buffer (or name "*Customization*")))
+  (switch-to-buffer (custom-get-fresh-buffer (or name "*Customization*")))
   (custom-buffer-create-internal options description))
 
 ;;;###autoload
@@ -1545,7 +1545,7 @@ OPTIONS should be an alist of the form ((SYMBOL WIDGET)...), where
 SYMBOL is a customization option, and WIDGET is a widget for editing
 that option."
   (unless name (setq name "*Customization*"))
-  (pop-to-buffer (custom-get-fresh-buffer name) t)
+  (switch-to-buffer-other-window (custom-get-fresh-buffer name))
   (custom-buffer-create-internal options description))
 
 (defcustom custom-reset-button-menu nil
@@ -1721,7 +1721,7 @@ Otherwise use brackets."
   (unless group
     (setq group 'emacs))
   (let ((name "*Customize Browser*"))
-    (pop-to-buffer (custom-get-fresh-buffer name)))
+    (switch-to-buffer (custom-get-fresh-buffer name)))
   (Custom-mode)
   (widget-insert (format "\
 %s buttons; type RET or click mouse-1
index 4911f2433431da66c63419a6fba8d0b8a0e116ed..b1fcb5429d68f7f0fc7c336387062ef35786b376 100644 (file)
@@ -1,3 +1,11 @@
+2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
+
+       * message.el (message-pop-to-buffer): Default to switch-to-buffer.
+       (message-mail-other-window, message-mail-other-frame)
+       (message-news-other-window, message-news-other-frame): Use
+       switch-to-buffer-other-frame and switch-to-buffer-other-window instead
+       of setting buffer display varibles.
+
 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-dup.el (gnus-dup-suppress-articles): Move "Suppressing
index 194ebf81873c64191d1e7c960b969422c911f32a..f78e2b0339d36fa0dfb5d66224562f160b393a7a 100644 (file)
@@ -6329,7 +6329,7 @@ between beginning of field and beginning of line."
              (progn
                (gnus-select-frame-set-input-focus (window-frame window))
                (select-window window))
-           (funcall (or switch-function 'pop-to-buffer) buffer)
+           (funcall (or switch-function 'switch-to-buffer) buffer)
            (set-buffer buffer))
          (when (and (buffer-modified-p)
                     (not (prog1
@@ -6337,7 +6337,7 @@ between beginning of field and beginning of line."
                               "Message already being composed; erase? ")
                            (message nil))))
            (error "Message being composed")))
-      (funcall (or switch-function 'pop-to-buffer) name)
+      (funcall (or switch-function 'switch-to-buffer) name)
       (set-buffer name))
     (erase-buffer)
     (message-mode)))
@@ -7619,12 +7619,8 @@ you."
   "Like `message-mail' command, but display mail buffer in another window."
   (interactive)
   (unless (message-mail-user-agent)
-    (let ((pop-up-windows t)
-         (special-display-buffer-names nil)
-         (special-display-regexps nil)
-         (same-window-buffer-names nil)
-         (same-window-regexps nil))
-      (message-pop-to-buffer (message-buffer-name "mail" to))))
+    (message-pop-to-buffer (message-buffer-name "mail" to)
+                          'switch-to-buffer-other-window))
   (let ((message-this-is-mail t))
     (message-setup `((To . ,(or to "")) (Subject . ,(or subject "")))
                   nil nil nil 'switch-to-buffer-other-window)))
@@ -7634,12 +7630,8 @@ you."
   "Like `message-mail' command, but display mail buffer in another frame."
   (interactive)
   (unless (message-mail-user-agent)
-    (let ((pop-up-frames t)
-         (special-display-buffer-names nil)
-         (special-display-regexps nil)
-         (same-window-buffer-names nil)
-         (same-window-regexps nil))
-      (message-pop-to-buffer (message-buffer-name "mail" to))))
+    (message-pop-to-buffer (message-buffer-name "mail" to)
+                          'switch-to-buffer-other-frame))
   (let ((message-this-is-mail t))
     (message-setup `((To . ,(or to "")) (Subject . ,(or subject "")))
                   nil nil nil 'switch-to-buffer-other-frame)))
@@ -7648,12 +7640,8 @@ you."
 (defun message-news-other-window (&optional newsgroups subject)
   "Start editing a news article to be sent."
   (interactive)
-  (let ((pop-up-windows t)
-       (special-display-buffer-names nil)
-       (special-display-regexps nil)
-       (same-window-buffer-names nil)
-       (same-window-regexps nil))
-    (message-pop-to-buffer (message-buffer-name "posting" nil newsgroups)))
+  (message-pop-to-buffer (message-buffer-name "posting" nil newsgroups)
+                        'switch-to-buffer-other-window)
   (let ((message-this-is-news t))
     (message-setup `((Newsgroups . ,(or newsgroups ""))
                     (Subject . ,(or subject ""))))))
@@ -7662,12 +7650,8 @@ you."
 (defun message-news-other-frame (&optional newsgroups subject)
   "Start editing a news article to be sent."
   (interactive)
-  (let ((pop-up-frames t)
-       (special-display-buffer-names nil)
-       (special-display-regexps nil)
-       (same-window-buffer-names nil)
-       (same-window-regexps nil))
-    (message-pop-to-buffer (message-buffer-name "posting" nil newsgroups)))
+  (message-pop-to-buffer (message-buffer-name "posting" nil newsgroups)
+                        'switch-to-buffer-other-frame)
   (let ((message-this-is-news t))
     (message-setup `((Newsgroups . ,(or newsgroups ""))
                     (Subject . ,(or subject ""))))))
index 3322e7e55c2946adbea58d7bc94657faa3465b02..94bb299eaaceab03ed335a40891a3a530d0fd4cf 100644 (file)
@@ -563,7 +563,7 @@ Switches to the buffer `*ielm*', or creates it if it does not exist."
       (with-current-buffer (get-buffer-create "*ielm*")
        (unless (zerop (buffer-size)) (setq old-point (point)))
        (inferior-emacs-lisp-mode)))
-    (pop-to-buffer "*ielm*")
+    (switch-to-buffer "*ielm*")
     (when old-point (push-mark old-point))))
 
 (provide 'ielm)
index e5aa5714c721b7baf21f2063769716721514a14f..40959885edb795221d7ef174039a3d90724e9110 100644 (file)
@@ -610,7 +610,7 @@ in `Info-file-supports-index-cookies-list'."
   "Like `info' but show the Info buffer in another window."
   (interactive (if current-prefix-arg
                   (list (read-file-name "Info file name: " nil nil t))))
-  (info-setup file-or-node (pop-to-buffer "*info*" t)))
+  (info-setup file-or-node (switch-to-buffer-other-window "*info*")))
 
 ;;;###autoload (put 'info 'info-file (purecopy "emacs"))
 ;;;###autoload
@@ -640,7 +640,7 @@ See a list of available Info commands in `Info-mode'."
                     (read-file-name "Info file name: " nil nil t))
                 (if (numberp current-prefix-arg)
                     (format "*info*<%s>" current-prefix-arg))))
-  (info-setup file-or-node (pop-to-buffer (or buffer "*info*"))))
+  (info-setup file-or-node (switch-to-buffer (or buffer "*info*"))))
 
 (defun info-setup (file-or-node buffer)
   "Display Info node FILE-OR-NODE in BUFFER."
@@ -775,7 +775,7 @@ it says do not attempt further (recursive) error recovery."
   (info-initialize)
   (setq filename (Info-find-file filename))
   ;; Go into Info buffer.
-  (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
+  (or (eq major-mode 'Info-mode) (switch-to-buffer "*info*"))
   ;; Record the node we are leaving, if we were in one.
   (and (not no-going-back)
        Info-current-file
@@ -809,7 +809,7 @@ otherwise, that defaults to `Top'."
   "Go to an Info node FILENAME and NODENAME, re-reading disk contents.
 When *info* is already displaying FILENAME and NODENAME, the window position
 is preserved, if possible."
-  (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
+  (or (eq major-mode 'Info-mode) (switch-to-buffer "*info*"))
   (let ((old-filename Info-current-file)
        (old-nodename Info-current-node)
        (old-buffer-name (buffer-name))
@@ -821,7 +821,7 @@ is preserved, if possible."
        (new-history  (and Info-current-file
                           (list Info-current-file Info-current-node (point)))))
     (kill-buffer (current-buffer))
-    (pop-to-buffer (or old-buffer-name "*info*"))
+    (switch-to-buffer (or old-buffer-name "*info*"))
     (Info-mode)
     (Info-find-node filename nodename)
     (setq Info-history-forward old-history-forward)
@@ -2021,7 +2021,7 @@ End of submatch 0, 1, and 3 are the same, so you can safely concat."
   (interactive)
   ;; In case another window is currently selected
   (save-window-excursion
-    (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
+    (or (eq major-mode 'Info-mode) (switch-to-buffer "*info*"))
     (Info-goto-node (Info-extract-pointer "next"))))
 
 (defun Info-prev ()
@@ -2029,7 +2029,7 @@ End of submatch 0, 1, and 3 are the same, so you can safely concat."
   (interactive)
   ;; In case another window is currently selected
   (save-window-excursion
-    (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
+    (or (eq major-mode 'Info-mode) (switch-to-buffer "*info*"))
     (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous"))))
 
 (defun Info-up (&optional same-file)
@@ -2038,7 +2038,7 @@ If SAME-FILE is non-nil, do not move to a different Info file."
   (interactive)
   ;; In case another window is currently selected
   (save-window-excursion
-    (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
+    (or (eq major-mode 'Info-mode) (switch-to-buffer "*info*"))
     (let ((old-node Info-current-node)
          (old-file Info-current-file)
          (node (Info-extract-pointer "up")) p)
@@ -4775,7 +4775,7 @@ The INDENT level is ignored."
          (select-window bwin)
          (raise-frame (window-frame bwin)))
       (if speedbar-power-click
-         (let ((pop-up-frames t)) (select-window (display-buffer buff)))
+         (switch-to-buffer-other-frame buff)
        (speedbar-select-attached-frame)
        (switch-to-buffer buff)))
     (if (not (string-match "^(\\([^)]+\\))\\([^.]+\\)$" node))
@@ -4954,7 +4954,7 @@ type returned by `Info-bookmark-make-record', which see."
          (setq found buffer
                blist nil))))
     (if found
-       (pop-to-buffer found)
+       (switch-to-buffer found)
       (info-initialize)
       (info (Info-find-file manual)))))
 
index 6e5c9a6b25721e30e0a4be9cb49a768b93c2fc34..6bcf65945b5514255f9c39f7707a85f9636c8d3f 100644 (file)
@@ -1785,11 +1785,11 @@ The seventh argument ACTIONS is a list of actions to take
  This is how Rmail arranges to mark messages `answered'."
   (interactive "P")
   (if (eq noerase 'new)
-      (pop-to-buffer (generate-new-buffer "*mail*"))
+      (switch-to-buffer (generate-new-buffer "*mail*"))
     (and noerase
         (not (get-buffer "*mail*"))
         (setq noerase nil))
-    (pop-to-buffer "*mail*"))
+    (switch-to-buffer "*mail*"))
 
   ;; Avoid danger that the auto-save file can't be written.
   (let ((dir (expand-file-name
@@ -1939,7 +1939,7 @@ you can move to one of them and type C-c C-c to recover that one."
                  (dired-noselect file-name
                                  (concat dired-listing-switches " -t"))))
             (save-selected-window
-              (select-window (display-buffer dispbuf t))
+              (switch-to-buffer-other-window dispbuf)
               (goto-char (point-min))
               (forward-line 2)
               (dired-move-to-filename)
index 01e66259ad32c92afae3fb0f2df7715b0b222369..effdcabfb6598db9ac5c069b83de69d4208462e6 100644 (file)
@@ -194,7 +194,7 @@ variable."
           (t
            (setq buffer-name (generate-new-buffer-name buffer-name))))
     (setq buffer (get-buffer-create buffer-name))
-    (pop-to-buffer buffer-name)
+    (switch-to-buffer buffer-name)
     (unless (comint-check-proc buffer-name)
       (comint-exec buffer buffer-name rlogin-program nil args)
       (rlogin-mode)
index 67971d080ff6190f394ed5e33e14fa761650a6f3..59850f68d445b25739c78bf13d6b35fb2f3c3a00 100644 (file)
@@ -217,8 +217,8 @@ Normally input is edited in Emacs and sent a line at a time."
         (telnet-options (if (cdr properties) (cons "-l" (cdr properties))))
         process)
     (if (and buffer (get-buffer-process buffer))
-       (pop-to-buffer (concat "*" name "*"))
-      (pop-to-buffer
+       (switch-to-buffer (concat "*" name "*"))
+      (switch-to-buffer
        (apply 'make-comint name telnet-program nil telnet-options))
       (setq process (get-buffer-process (current-buffer)))
       (set-process-filter process 'telnet-initial-filter)
@@ -252,7 +252,7 @@ Normally input is edited in Emacs and sent a line at a time."
   (interactive "sOpen rsh connection to host: ")
   (require 'shell)
   (let ((name (concat "rsh-" host )))
-    (pop-to-buffer (make-comint name remote-shell-program nil host))
+    (switch-to-buffer (make-comint name remote-shell-program nil host))
     (set-process-filter (get-process name) 'telnet-initial-filter)
     (telnet-mode)
     (setq telnet-count -16)))
index d55a9eed3f0a2911fef88b22dce1bd04e888967e..a4d7cff4127ce86c96cb8efd2fb13de8943f788a 100644 (file)
@@ -4006,7 +4006,7 @@ window is dedicated."
   (gdb-display-breakpoints-buffer)
   (delete-other-windows)
   ;; Don't dedicate.
-  (pop-to-buffer gud-comint-buffer)
+  (switch-to-buffer gud-comint-buffer)
   (let ((win0 (selected-window))
         (win1 (split-window nil ( / ( * (window-height) 3) 4)))
         (win2 (split-window nil ( / (window-height) 3)))
@@ -4065,7 +4065,7 @@ With arg, display additional buffers iff arg is positive."
   "Restore the basic arrangement of windows used by gdb.
 This arrangement depends on the value of `gdb-many-windows'."
   (interactive)
-  (pop-to-buffer gud-comint-buffer) ;Select the right window and frame.
+  (switch-to-buffer gud-comint-buffer) ;Select the right window and frame.
   (delete-other-windows)
   (if gdb-many-windows
       (gdb-setup-windows)
index 534082544b6ebe4a889c3522affcac72e05e900d..25a23fed2931905c12b2b3b1cca4bc74d10cded1 100644 (file)
@@ -2496,7 +2496,7 @@ comint mode, which see."
                      file-subst)))
         (filepart (and file-word (concat "-" (file-name-nondirectory file))))
         (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
-    (pop-to-buffer (concat "*gud" filepart "*"))
+    (switch-to-buffer (concat "*gud" filepart "*"))
     (when (and existing-buffer (get-buffer-process existing-buffer))
       (error "This program is already being debugged"))
     ;; Set the dir, in case the buffer already existed with a different dir.
index 6a222d091bca6b7ecba40803992aaf56e2599106..0765f74a1cf5eb656782bcf0b07d6132a8899cd2 100644 (file)
@@ -297,7 +297,7 @@ of `inferior-lisp-program').  Runs the hooks from
                           "inferior-lisp" (car cmdlist) nil (cdr cmdlist)))
        (inferior-lisp-mode)))
   (setq inferior-lisp-buffer "*inferior-lisp*")
-  (pop-to-buffer "*inferior-lisp*"))
+  (switch-to-buffer "*inferior-lisp*"))
 
 ;;;###autoload
 (defalias 'run-lisp 'inferior-lisp)
index 3e06801e7af45de1f61e1457a3bfb38890672d7e..8c5781f9333356dca0aa531210f35ec971bb3444 100644 (file)
@@ -650,9 +650,9 @@ Otherwise, one argument `-i' is passed to the shell.
                t shell-file-name))
              'localname))))
 
-  ;; Pop to buffer, so that the buffer's window will be correctly set
-  ;; when we call comint (so that comint sets the COLUMNS env var properly).
-  (pop-to-buffer buffer)
+  ;; The buffer's window must be correctly set when we call comint (so
+  ;; that comint sets the COLUMNS env var properly).
+  (switch-to-buffer buffer)
   (unless (comint-check-proc buffer)
     (let* ((prog (or explicit-shell-file-name
                     (getenv "ESHELL") shell-file-name))
index 72cad635ab5ccdcdc65ebe325128b57b6c672fa0..a0e4136c0bdb5a18fe1985fbef44a4124f9f8215 100644 (file)
@@ -4498,11 +4498,7 @@ BUFFER-OR-NAME and return that buffer."
            buffer))
     (current-buffer)))
 
-(defvar display-buffer-alist
-  '(("\\`\\*\\(scheme\\|ielm\\|shell\\|\\(unsent \\)?mail\\|\
-inferior-lisp\\|Python\\|Customiz.*\\|info\\|rlogin-.*\\|\
-telnet-.*\\|rsh-.*\\|gud-.*\\)\\*\\(<[0-9]+>\\)?"
-     . (display-buffer-same-window)))
+(defvar display-buffer-alist nil
   "Alist of conditional actions for `display-buffer'.
 This is a list of elements (CONDITION . ACTION), where: