diff options
| author | Stefan Monnier | 2008-04-29 14:47:45 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-04-29 14:47:45 +0000 |
| commit | 28bb43e10ff8e0a7f32ac32ef41a5eda5259c326 (patch) | |
| tree | 41217397953fa74fa0c0853c708a6e977bca9167 | |
| parent | ac2c49f4e9d920cd2af67097924a19f9cf5c0787 (diff) | |
| download | emacs-28bb43e10ff8e0a7f32ac32ef41a5eda5259c326.tar.gz emacs-28bb43e10ff8e0a7f32ac32ef41a5eda5259c326.zip | |
(read-buffer-to-switch): Avoid making assumptions about `other-buffer'.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ca0a5205f8..2d66f8e01f2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-04-29 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * files.el (read-buffer-to-switch): | ||
| 4 | Avoid making assumptions about `other-buffer'. | ||
| 5 | |||
| 1 | 2008-04-29 Sam Steingold <sds@gnu.org> | 6 | 2008-04-29 Sam Steingold <sds@gnu.org> |
| 2 | 7 | ||
| 3 | * vc.el (vc-dir-mode-hook): Add normal hook. | 8 | * vc.el (vc-dir-mode-hook): Add normal hook. |
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." | |||
| 1042 | (defun read-buffer-to-switch (prompt) | 1042 | (defun read-buffer-to-switch (prompt) |
| 1043 | "Read the name of a buffer to switch to and return as a string. | 1043 | "Read the name of a buffer to switch to and return as a string. |
| 1044 | It is intended for `switch-to-buffer' family of commands since they | 1044 | It is intended for `switch-to-buffer' family of commands since they |
| 1045 | need to omit the name of current buffer from the list of complations | 1045 | need to omit the name of current buffer from the list of completions |
| 1046 | and default values." | 1046 | and default values." |
| 1047 | (minibuffer-with-setup-hook | 1047 | (let ((rbts-completion-table (internal-complete-buffer-except))) |
| 1048 | (lambda () | 1048 | (minibuffer-with-setup-hook |
| 1049 | (set (make-local-variable 'minibuffer-completion-table) | 1049 | (lambda () (setq minibuffer-completion-table rbts-completion-table)) |
| 1050 | (internal-complete-buffer-except (other-buffer (current-buffer) t)))) | 1050 | (read-buffer prompt (other-buffer (current-buffer)))))) |
| 1051 | (read-buffer prompt (other-buffer (current-buffer))))) | ||
| 1052 | 1051 | ||
| 1053 | (defun switch-to-buffer-other-window (buffer &optional norecord) | 1052 | (defun switch-to-buffer-other-window (buffer &optional norecord) |
| 1054 | "Select buffer BUFFER in another window. | 1053 | "Select buffer BUFFER in another window. |