diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-04-29 14:47:45 +0000 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-04-29 14:47:45 +0000 |
| commit | 28bb43e10ff8e0a7f32ac32ef41a5eda5259c326 (patch) | |
| tree | 41217397953fa74fa0c0853c708a6e977bca9167 /lisp/files.el | |
| parent | ac2c49f4e9d920cd2af67097924a19f9cf5c0787 (diff) | |
| download | emacs-28bb43e10ff8e0a7f32ac32ef41a5eda5259c326.tar.gz | |
(read-buffer-to-switch): Avoid making assumptions about `other-buffer'.
Diffstat (limited to 'lisp/files.el')
| -rw-r--r-- | lisp/files.el | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/files.el b/lisp/files.el index 68c0657df7f..38eb95fe9bd 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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. |
