summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-07-05 11:31:22 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2011-07-05 11:31:22 -0400
commit2dcdbdd97db0f414a2f11421e9d8001ea6178517 (patch)
treebe3264dba0659172179eaf2b03a163e4555c9982 /lisp
parent73fed7aeda408ab0e9d67ca3c44a4c7711e5b490 (diff)
downloademacs-2dcdbdd97db0f414a2f11421e9d8001ea6178517.tar.gz
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog15
-rw-r--r--lisp/abbrev.el2
-rw-r--r--lisp/arc-mode.el2
-rw-r--r--lisp/autoinsert.el2
-rw-r--r--lisp/bindings.el3
-rw-r--r--lisp/bookmark.el7
-rw-r--r--lisp/bs.el6
-rw-r--r--lisp/net/tramp-cmds.el4
-rw-r--r--lisp/progmodes/compile.el4
9 files changed, 28 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e83b65fe4e5..1a6c66e2bdf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
+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
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 9445cf9675c..2122f43bbad 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -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."
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index e0a587c7607..70f43aebaff 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -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))
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index 5793c3180be..3b849cece22 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -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)
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 383223dc0d7..2f035608528 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -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."
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 184cecb9e9c..9f90ecedc4d 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -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)))
diff --git a/lisp/bs.el b/lisp/bs.el
index 94fbd0e04f9..c7326eedd26 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -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"
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index fcf523a7068..307ce5368ce 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -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
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0b9390af6c9..3a9463f0f97 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -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)