# HG changeset patch # User Stefan Monnier # Date 1209480465 0 # Node ID 0e056b86de6f4ca2cd7213bd89a66eef36919000 # Parent 618e87ee72c04cf77af35d89e7581f09d8042a16 (read-buffer-to-switch): Avoid making assumptions about `other-buffer'. diff -r 618e87ee72c0 -r 0e056b86de6f lisp/ChangeLog --- a/lisp/ChangeLog Tue Apr 29 13:42:15 2008 +0000 +++ b/lisp/ChangeLog Tue Apr 29 14:47:45 2008 +0000 @@ -1,3 +1,8 @@ +2008-04-29 Stefan Monnier + + * files.el (read-buffer-to-switch): + Avoid making assumptions about `other-buffer'. + 2008-04-29 Sam Steingold * vc.el (vc-dir-mode-hook): Add normal hook. diff -r 618e87ee72c0 -r 0e056b86de6f lisp/files.el --- a/lisp/files.el Tue Apr 29 13:42:15 2008 +0000 +++ b/lisp/files.el Tue Apr 29 14:47:45 2008 +0000 @@ -1042,13 +1042,12 @@ (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.