diff options
| author | Stefan Monnier | 2011-07-05 11:31:22 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-07-05 11:31:22 -0400 |
| commit | 2dcdbdd97db0f414a2f11421e9d8001ea6178517 (patch) | |
| tree | be3264dba0659172179eaf2b03a163e4555c9982 | |
| parent | 73fed7aeda408ab0e9d67ca3c44a4c7711e5b490 (diff) | |
| download | emacs-2dcdbdd97db0f414a2f11421e9d8001ea6178517.tar.gz emacs-2dcdbdd97db0f414a2f11421e9d8001ea6178517.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/abbrev.el | 2 | ||||
| -rw-r--r-- | lisp/arc-mode.el | 2 | ||||
| -rw-r--r-- | lisp/autoinsert.el | 2 | ||||
| -rw-r--r-- | lisp/bindings.el | 3 | ||||
| -rw-r--r-- | lisp/bookmark.el | 7 | ||||
| -rw-r--r-- | lisp/bs.el | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-cmds.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 4 |
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 @@ | |||
| 1 | 2011-07-05 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * progmodes/compile.el (compilation-goto-locus): | ||
| 4 | * net/tramp-cmds.el (tramp-append-tramp-buffers): | ||
| 5 | * bs.el (bs-cycle-next, bs-cycle-previous): | ||
| 6 | * bookmark.el (bookmark-bmenu-list, bookmark-bmenu-2-window): | ||
| 7 | * bindings.el (mode-line-other-buffer): | ||
| 8 | * autoinsert.el (auto-insert): | ||
| 9 | * arc-mode.el (archive-extract): | ||
| 10 | * abbrev.el (edit-abbrevs): Fix some uses of switch-to-buffer. | ||
| 11 | |||
| 1 | 2011-07-05 Juanma Barranquero <lekktu@gmail.com> | 12 | 2011-07-05 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 13 | ||
| 3 | * emacs-lock.el (emacs-lock-mode): Fix typo in variable name. | 14 | * emacs-lock.el (emacs-lock-mode): Fix typo in variable name. |
| @@ -64,8 +75,8 @@ | |||
| 64 | according to whether there are or aren't any plain-text topics | 75 | according to whether there are or aren't any plain-text topics |
| 65 | pending encryption. | 76 | pending encryption. |
| 66 | 77 | ||
| 67 | (allout-inhibit-auto-save-info-for-decryption): Adjust | 78 | (allout-inhibit-auto-save-info-for-decryption): |
| 68 | buffer-saved-size and some allout state to inhibit auto-saves if | 79 | Adjust buffer-saved-size and some allout state to inhibit auto-saves if |
| 69 | there are plain-text topics pending encryption. | 80 | there are plain-text topics pending encryption. |
| 70 | 81 | ||
| 71 | (allout-maybe-resume-auto-save-info-after-encryption): Adjust | 82 | (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, | |||
| 159 | USECOUNT is an integer, and HOOK is any valid function | 159 | USECOUNT is an integer, and HOOK is any valid function |
| 160 | or may be omitted (it is usually omitted)." | 160 | or may be omitted (it is usually omitted)." |
| 161 | (interactive) | 161 | (interactive) |
| 162 | (switch-to-buffer (prepare-abbrev-list-buffer))) | 162 | (pop-to-buffer-same-window (prepare-abbrev-list-buffer))) |
| 163 | 163 | ||
| 164 | (defun edit-abbrevs-redefine () | 164 | (defun edit-abbrevs-redefine () |
| 165 | "Redefine abbrevs according to current buffer contents." | 165 | "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." | |||
| 1083 | (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))) | 1083 | (view-buffer buffer (and just-created 'kill-buffer-if-not-modified))) |
| 1084 | ((eq other-window-p 'display) (display-buffer buffer)) | 1084 | ((eq other-window-p 'display) (display-buffer buffer)) |
| 1085 | (other-window-p (switch-to-buffer-other-window buffer)) | 1085 | (other-window-p (switch-to-buffer-other-window buffer)) |
| 1086 | (t (switch-to-buffer buffer)))))) | 1086 | (t (pop-to-buffer-same-window buffer)))))) |
| 1087 | 1087 | ||
| 1088 | (defun archive-*-extract (archive name command) | 1088 | (defun archive-*-extract (archive name command) |
| 1089 | (let* ((default-directory (file-name-as-directory archive-tmpdir)) | 1089 | (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'." | |||
| 360 | (save-window-excursion | 360 | (save-window-excursion |
| 361 | ;; make buffer visible before skeleton or function | 361 | ;; make buffer visible before skeleton or function |
| 362 | ;; which might ask the user for something | 362 | ;; which might ask the user for something |
| 363 | (switch-to-buffer (current-buffer)) | 363 | (pop-to-buffer-same-window (current-buffer)) |
| 364 | (if (and (consp action) | 364 | (if (and (consp action) |
| 365 | (not (eq (car action) 'lambda))) | 365 | (not (eq (car action) 'lambda))) |
| 366 | (skeleton-insert action) | 366 | (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." | |||
| 471 | (defun mode-line-other-buffer () "\ | 471 | (defun mode-line-other-buffer () "\ |
| 472 | Switch to the most recently selected buffer other than the current one." | 472 | Switch to the most recently selected buffer other than the current one." |
| 473 | (interactive) | 473 | (interactive) |
| 474 | (switch-to-buffer (other-buffer))) | 474 | (with-no-warnings ; We really do want to call `switch-to-buffer' here. |
| 475 | (switch-to-buffer (other-buffer)))) | ||
| 475 | 476 | ||
| 476 | (defun mode-line-next-buffer (event) | 477 | (defun mode-line-next-buffer (event) |
| 477 | "Like `next-buffer', but temporarily select EVENT's window." | 478 | "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." | |||
| 1539 | (bookmark-maybe-load-default-file) | 1539 | (bookmark-maybe-load-default-file) |
| 1540 | (let ((buf (get-buffer-create "*Bookmark List*"))) | 1540 | (let ((buf (get-buffer-create "*Bookmark List*"))) |
| 1541 | (if (called-interactively-p 'interactive) | 1541 | (if (called-interactively-p 'interactive) |
| 1542 | (if (or (window-dedicated-p) (window-minibuffer-p)) | 1542 | (pop-to-buffer-same-window buf) |
| 1543 | (pop-to-buffer buf) | ||
| 1544 | (switch-to-buffer buf)) | ||
| 1545 | (set-buffer buf))) | 1543 | (set-buffer buf))) |
| 1546 | (let ((inhibit-read-only t)) | 1544 | (let ((inhibit-read-only t)) |
| 1547 | (erase-buffer) | 1545 | (erase-buffer) |
| @@ -1843,7 +1841,8 @@ With a prefix arg, prompts for a file to save them in." | |||
| 1843 | (menu (current-buffer)) | 1841 | (menu (current-buffer)) |
| 1844 | (pop-up-windows t)) | 1842 | (pop-up-windows t)) |
| 1845 | (delete-other-windows) | 1843 | (delete-other-windows) |
| 1846 | (switch-to-buffer (other-buffer)) | 1844 | (with-no-warnings ; We really do want to call `switch-to-buffer' here. |
| 1845 | (switch-to-buffer (other-buffer))) | ||
| 1847 | (bookmark--jump-via bmrk 'pop-to-buffer) | 1846 | (bookmark--jump-via bmrk 'pop-to-buffer) |
| 1848 | (bury-buffer menu))) | 1847 | (bury-buffer menu))) |
| 1849 | 1848 | ||
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'." | |||
| 1215 | ;; We don't want the frame iconified if the only window in the frame | 1215 | ;; We don't want the frame iconified if the only window in the frame |
| 1216 | ;; happens to be dedicated. | 1216 | ;; happens to be dedicated. |
| 1217 | (bury-buffer (current-buffer)) | 1217 | (bury-buffer (current-buffer)) |
| 1218 | (switch-to-buffer next) | 1218 | (with-no-warnings ; We really do want to call `switch-to-buffer' here. |
| 1219 | (switch-to-buffer next)) | ||
| 1219 | (setq bs--cycle-list (append (cdr cycle-list) | 1220 | (setq bs--cycle-list (append (cdr cycle-list) |
| 1220 | (list (car cycle-list)))) | 1221 | (list (car cycle-list)))) |
| 1221 | (bs-message-without-log "Next buffers: %s" | 1222 | (bs-message-without-log "Next buffers: %s" |
| @@ -1244,7 +1245,8 @@ by buffer configuration `bs-cycle-configuration-name'." | |||
| 1244 | bs--cycle-list))) | 1245 | bs--cycle-list))) |
| 1245 | (prev-buffer (car tupel)) | 1246 | (prev-buffer (car tupel)) |
| 1246 | (cycle-list (cdr tupel))) | 1247 | (cycle-list (cdr tupel))) |
| 1247 | (switch-to-buffer prev-buffer) | 1248 | (with-no-warnings ; We really do want to call `switch-to-buffer' here. |
| 1249 | (switch-to-buffer prev-buffer)) | ||
| 1248 | (setq bs--cycle-list (append (last cycle-list) | 1250 | (setq bs--cycle-list (append (last cycle-list) |
| 1249 | (reverse (cdr (reverse cycle-list))))) | 1251 | (reverse (cdr (reverse cycle-list))))) |
| 1250 | (bs-message-without-log "Previous buffers: %s" | 1252 | (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. | |||
| 308 | 308 | ||
| 309 | ;; There is at least one Tramp buffer. | 309 | ;; There is at least one Tramp buffer. |
| 310 | (when buffer-list | 310 | (when buffer-list |
| 311 | (switch-to-buffer (list-buffers-noselect nil)) | 311 | (pop-to-buffer-same-window (list-buffers-noselect nil)) |
| 312 | (delete-other-windows) | 312 | (delete-other-windows) |
| 313 | (setq buffer-read-only nil) | 313 | (setq buffer-read-only nil) |
| 314 | (goto-char (point-min)) | 314 | (goto-char (point-min)) |
| @@ -343,7 +343,7 @@ the debug buffer(s).") | |||
| 343 | ;; OK, let's send. First we delete the buffer list. | 343 | ;; OK, let's send. First we delete the buffer list. |
| 344 | (progn | 344 | (progn |
| 345 | (kill-buffer nil) | 345 | (kill-buffer nil) |
| 346 | (switch-to-buffer curbuf) | 346 | (pop-to-buffer-same-window curbuf) |
| 347 | (goto-char (point-max)) | 347 | (goto-char (point-max)) |
| 348 | (insert "\n\ | 348 | (insert "\n\ |
| 349 | This is a special notion of the `gnus/message' package. If you | 349 | 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." | |||
| 2410 | ;; display the source in another window. | 2410 | ;; display the source in another window. |
| 2411 | (let ((pop-up-windows t)) | 2411 | (let ((pop-up-windows t)) |
| 2412 | (pop-to-buffer (marker-buffer mk) 'other-window)) | 2412 | (pop-to-buffer (marker-buffer mk) 'other-window)) |
| 2413 | (if (window-dedicated-p (selected-window)) | 2413 | (pop-to-buffer-same-window (marker-buffer mk))) |
| 2414 | (pop-to-buffer (marker-buffer mk)) | ||
| 2415 | (switch-to-buffer (marker-buffer mk)))) | ||
| 2416 | (unless (eq (goto-char mk) (point)) | 2414 | (unless (eq (goto-char mk) (point)) |
| 2417 | ;; If narrowing gets in the way of going to the right place, widen. | 2415 | ;; If narrowing gets in the way of going to the right place, widen. |
| 2418 | (widen) | 2416 | (widen) |