emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104968: Fix some uses of switch-to-b


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104968: Fix some uses of switch-to-buffer.
Date: Tue, 05 Jul 2011 11:31:22 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104968
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2011-07-05 11:31:22 -0400
message:
  Fix some uses of switch-to-buffer.
  * lisp/progmodes/compile.el (compilation-goto-locus):
  * lisp/net/tramp-cmds.el (tramp-append-tramp-buffers):
  * lisp/bs.el (bs-cycle-next, bs-cycle-previous):
  * lisp/bookmark.el (bookmark-bmenu-list, bookmark-bmenu-2-window):
  * lisp/bindings.el (mode-line-other-buffer):
  * lisp/autoinsert.el (auto-insert):
  * lisp/arc-mode.el (archive-extract):
  * lisp/abbrev.el (edit-abbrevs): Fix some uses of switch-to-buffer.
modified:
  lisp/ChangeLog
  lisp/abbrev.el
  lisp/arc-mode.el
  lisp/autoinsert.el
  lisp/bindings.el
  lisp/bookmark.el
  lisp/bs.el
  lisp/net/tramp-cmds.el
  lisp/progmodes/compile.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-07-05 15:23:15 +0000
+++ b/lisp/ChangeLog    2011-07-05 15:31:22 +0000
@@ -1,3 +1,14 @@
+2011-07-05  Stefan Monnier  <address@hidden>
+
+       * progmodes/compile.el (compilation-goto-locus):
+       * net/tramp-cmds.el (tramp-append-tramp-buffers):
+       * bs.el (bs-cycle-next, bs-cycle-previous):
+       * bookmark.el (bookmark-bmenu-list, bookmark-bmenu-2-window):
+       * bindings.el (mode-line-other-buffer):
+       * autoinsert.el (auto-insert):
+       * arc-mode.el (archive-extract):
+       * abbrev.el (edit-abbrevs): Fix some uses of switch-to-buffer.
+
 2011-07-05  Juanma Barranquero  <address@hidden>
 
        * emacs-lock.el (emacs-lock-mode): Fix typo in variable name.
@@ -64,8 +75,8 @@
        according to whether there are or aren't any plain-text topics
        pending encryption.
 
-       (allout-inhibit-auto-save-info-for-decryption): Adjust
-       buffer-saved-size and some allout state to inhibit auto-saves if
+       (allout-inhibit-auto-save-info-for-decryption):
+       Adjust buffer-saved-size and some allout state to inhibit auto-saves if
        there are plain-text topics pending encryption.
 
        (allout-maybe-resume-auto-save-info-after-encryption): Adjust

=== modified file 'lisp/abbrev.el'
--- a/lisp/abbrev.el    2011-06-15 18:33:33 +0000
+++ b/lisp/abbrev.el    2011-07-05 15:31:22 +0000
@@ -159,7 +159,7 @@
 USECOUNT is an integer, and HOOK is any valid function
 or may be omitted (it is usually omitted)."
   (interactive)
-  (switch-to-buffer (prepare-abbrev-list-buffer)))
+  (pop-to-buffer-same-window (prepare-abbrev-list-buffer)))
 
 (defun edit-abbrevs-redefine ()
   "Redefine abbrevs according to current buffer contents."

=== modified file 'lisp/arc-mode.el'
--- a/lisp/arc-mode.el  2011-07-04 22:11:40 +0000
+++ b/lisp/arc-mode.el  2011-07-05 15:31:22 +0000
@@ -1083,7 +1083,7 @@
            (view-buffer buffer (and just-created 
'kill-buffer-if-not-modified)))
            ((eq other-window-p 'display) (display-buffer buffer))
            (other-window-p (switch-to-buffer-other-window buffer))
-           (t (switch-to-buffer buffer))))))
+           (t (pop-to-buffer-same-window buffer))))))
 
 (defun archive-*-extract (archive name command)
   (let* ((default-directory (file-name-as-directory archive-tmpdir))

=== modified file 'lisp/autoinsert.el'
--- a/lisp/autoinsert.el        2011-01-26 08:36:39 +0000
+++ b/lisp/autoinsert.el        2011-07-05 15:31:22 +0000
@@ -360,7 +360,7 @@
                   (save-window-excursion
                     ;; make buffer visible before skeleton or function
                     ;; which might ask the user for something
-                    (switch-to-buffer (current-buffer))
+                    (pop-to-buffer-same-window (current-buffer))
                     (if (and (consp action)
                              (not (eq (car action) 'lambda)))
                         (skeleton-insert action)

=== modified file 'lisp/bindings.el'
--- a/lisp/bindings.el  2011-07-04 20:45:22 +0000
+++ b/lisp/bindings.el  2011-07-05 15:31:22 +0000
@@ -471,7 +471,8 @@
 (defun mode-line-other-buffer () "\
 Switch to the most recently selected buffer other than the current one."
   (interactive)
-  (switch-to-buffer (other-buffer)))
+  (with-no-warnings ; We really do want to call `switch-to-buffer' here.
+    (switch-to-buffer (other-buffer))))
 
 (defun mode-line-next-buffer (event)
   "Like `next-buffer', but temporarily select EVENT's window."

=== modified file 'lisp/bookmark.el'
--- a/lisp/bookmark.el  2011-05-10 19:34:51 +0000
+++ b/lisp/bookmark.el  2011-07-05 15:31:22 +0000
@@ -1539,9 +1539,7 @@
   (bookmark-maybe-load-default-file)
   (let ((buf (get-buffer-create "*Bookmark List*")))
     (if (called-interactively-p 'interactive)
-        (if (or (window-dedicated-p) (window-minibuffer-p))
-            (pop-to-buffer buf)
-          (switch-to-buffer buf))
+        (pop-to-buffer-same-window buf)
       (set-buffer buf)))
   (let ((inhibit-read-only t))
     (erase-buffer)
@@ -1843,7 +1841,8 @@
         (menu (current-buffer))
         (pop-up-windows t))
     (delete-other-windows)
-    (switch-to-buffer (other-buffer))
+    (with-no-warnings ; We really do want to call `switch-to-buffer' here.
+      (switch-to-buffer (other-buffer)))
     (bookmark--jump-via bmrk 'pop-to-buffer)
     (bury-buffer menu)))
 

=== modified file 'lisp/bs.el'
--- a/lisp/bs.el        2011-06-27 01:52:37 +0000
+++ b/lisp/bs.el        2011-07-05 15:31:22 +0000
@@ -1215,7 +1215,8 @@
         ;; We don't want the frame iconified if the only window in the frame
         ;; happens to be dedicated.
         (bury-buffer (current-buffer))
-       (switch-to-buffer next)
+        (with-no-warnings ; We really do want to call `switch-to-buffer' here.
+          (switch-to-buffer next))
        (setq bs--cycle-list (append (cdr cycle-list)
                                     (list (car cycle-list))))
        (bs-message-without-log "Next buffers: %s"
@@ -1244,7 +1245,8 @@
                                            bs--cycle-list)))
             (prev-buffer (car tupel))
             (cycle-list (cdr tupel)))
-       (switch-to-buffer prev-buffer)
+        (with-no-warnings ; We really do want to call `switch-to-buffer' here.
+          (switch-to-buffer prev-buffer))
        (setq bs--cycle-list (append (last cycle-list)
                                     (reverse (cdr (reverse cycle-list)))))
        (bs-message-without-log "Previous buffers: %s"

=== modified file 'lisp/net/tramp-cmds.el'
--- a/lisp/net/tramp-cmds.el    2011-07-04 12:12:38 +0000
+++ b/lisp/net/tramp-cmds.el    2011-07-05 15:31:22 +0000
@@ -308,7 +308,7 @@
 
       ;; There is at least one Tramp buffer.
       (when buffer-list
-       (switch-to-buffer (list-buffers-noselect nil))
+       (pop-to-buffer-same-window (list-buffers-noselect nil))
        (delete-other-windows)
        (setq buffer-read-only nil)
        (goto-char (point-min))
@@ -343,7 +343,7 @@
            ;; OK, let's send.  First we delete the buffer list.
            (progn
              (kill-buffer nil)
-             (switch-to-buffer curbuf)
+             (pop-to-buffer-same-window curbuf)
              (goto-char (point-max))
              (insert "\n\
 This is a special notion of the `gnus/message' package.  If you

=== modified file 'lisp/progmodes/compile.el'
--- a/lisp/progmodes/compile.el 2011-07-03 21:39:49 +0000
+++ b/lisp/progmodes/compile.el 2011-07-05 15:31:22 +0000
@@ -2410,9 +2410,7 @@
         ;; display the source in another window.
         (let ((pop-up-windows t))
           (pop-to-buffer (marker-buffer mk) 'other-window))
-      (if (window-dedicated-p (selected-window))
-          (pop-to-buffer (marker-buffer mk))
-        (switch-to-buffer (marker-buffer mk))))
+      (pop-to-buffer-same-window (marker-buffer mk)))
     (unless (eq (goto-char mk) (point))
       ;; If narrowing gets in the way of going to the right place, widen.
       (widen)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]