Commit 2dcdbdd9 authored by Stefan Monnier's avatar Stefan Monnier

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.
parent 73fed7ae
2011-07-05 Stefan Monnier <monnier@iro.umontreal.ca>
* 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 <lekktu@gmail.com>
* 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
......
......@@ -159,7 +159,7 @@ where NAME and EXPANSION are strings with quotes,
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."
......
......@@ -1083,7 +1083,7 @@ using `make-temp-file', and the generated name is returned."
(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))
......
......@@ -360,7 +360,7 @@ Matches the visited file name against the elements of `auto-insert-alist'."
(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)
......
......@@ -471,7 +471,8 @@ Like `bury-buffer', but temporarily select EVENT's window."
(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."
......
......@@ -1539,9 +1539,7 @@ deletion, or > if it is flagged for displaying."
(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 @@ With a prefix arg, prompts for a file to save them in."
(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)))
......
......@@ -1215,7 +1215,8 @@ by buffer configuration `bs-cycle-configuration-name'."
;; 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 @@ by buffer configuration `bs-cycle-configuration-name'."
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"
......
......@@ -308,7 +308,7 @@ buffer in your bug report.
;; 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 @@ the debug buffer(s).")
;; 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
......
......@@ -2410,9 +2410,7 @@ and overlay is highlighted between MK and END-MK."
;; 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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment