+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.
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
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."
(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))
(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)
(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."
(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)
(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)))
;; 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"
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"
;; 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))
;; 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
;; 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)