]> git.eshelyaron.com Git - emacs.git/commitdiff
(read-buffer-to-switch): Avoid making assumptions about `other-buffer'.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 29 Apr 2008 14:47:45 +0000 (14:47 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 29 Apr 2008 14:47:45 +0000 (14:47 +0000)
lisp/ChangeLog
lisp/files.el

index 7ca0a5205f86d7562da6aac959d7ae1871fb5ba6..2d66f8e01f2d5287aad72ca09005e63fba872607 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * files.el (read-buffer-to-switch):
+       Avoid making assumptions about `other-buffer'.
+
 2008-04-29  Sam Steingold  <sds@gnu.org>
 
        * vc.el (vc-dir-mode-hook): Add normal hook.
index 68c0657df7f463d9886750f6b7c25764ba39d00d..38eb95fe9bd8b99f391c4eaa40917cd1246b2b9c 100644 (file)
@@ -1042,13 +1042,12 @@ use with M-x."
 (defun read-buffer-to-switch (prompt)
   "Read the name of a buffer to switch to and return as a string.
 It is intended for `switch-to-buffer' family of commands since they
-need to omit the name of current buffer from the list of complations
+need to omit the name of current buffer from the list of completions
 and default values."
-  (minibuffer-with-setup-hook
-      (lambda ()
-       (set (make-local-variable 'minibuffer-completion-table)
-            (internal-complete-buffer-except (other-buffer (current-buffer) t))))
-    (read-buffer prompt (other-buffer (current-buffer)))))
+  (let ((rbts-completion-table (internal-complete-buffer-except)))
+    (minibuffer-with-setup-hook
+        (lambda () (setq minibuffer-completion-table rbts-completion-table))
+      (read-buffer prompt (other-buffer (current-buffer))))))
 
 (defun switch-to-buffer-other-window (buffer &optional norecord)
   "Select buffer BUFFER in another window.