diff options
| author | Lars Ingebrigtsen | 2019-10-07 17:14:10 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-07 17:14:15 +0200 |
| commit | 672fb2c769512730ba6dabe6f95dd1aa94aeb489 (patch) | |
| tree | e5105790d22af3a22406d6312c1492ec865df3af | |
| parent | 130b1321eda817727f361037b6c93d6a90bc0619 (diff) | |
| download | emacs-672fb2c769512730ba6dabe6f95dd1aa94aeb489.tar.gz emacs-672fb2c769512730ba6dabe6f95dd1aa94aeb489.zip | |
Make ido-display-buffer work interactively more like display-buffer
* lisp/ido.el (ido-display-buffer): Take an interactive parameter,
like `display-buffer' (bug#14904).
(ido-visit-buffer): Use it to emulate `C-u M-x display-buffer'.
| -rw-r--r-- | lisp/ido.el | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index faa6e678f9f..1cfcb0f5358 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -4141,6 +4141,9 @@ Record command in `command-history' if optional RECORD is non-nil." | |||
| 4141 | ((eq method 'display) | 4141 | ((eq method 'display) |
| 4142 | (display-buffer buffer)) | 4142 | (display-buffer buffer)) |
| 4143 | 4143 | ||
| 4144 | ((eq method 'display-even-when-displayed) | ||
| 4145 | (display-buffer buffer t)) | ||
| 4146 | |||
| 4144 | ((eq method 'other-frame) | 4147 | ((eq method 'other-frame) |
| 4145 | (switch-to-buffer-other-frame buffer) | 4148 | (switch-to-buffer-other-frame buffer) |
| 4146 | (select-frame-set-input-focus (selected-frame))) | 4149 | (select-frame-set-input-focus (selected-frame))) |
| @@ -4225,12 +4228,20 @@ For details of keybindings, see `ido-switch-buffer'." | |||
| 4225 | (ido-buffer-internal 'other-window 'switch-to-buffer-other-window)) | 4228 | (ido-buffer-internal 'other-window 'switch-to-buffer-other-window)) |
| 4226 | 4229 | ||
| 4227 | ;;;###autoload | 4230 | ;;;###autoload |
| 4228 | (defun ido-display-buffer () | 4231 | (defun ido-display-buffer (&optional action) |
| 4229 | "Display a buffer in another window but don't select it. | 4232 | "Display a buffer in another window but don't select it. |
| 4233 | |||
| 4234 | If ACTION (the prefix argument interactively), display the buffer | ||
| 4235 | in another windown even if it's already displayed in the current | ||
| 4236 | window. | ||
| 4237 | |||
| 4230 | The buffer name is selected interactively by typing a substring. | 4238 | The buffer name is selected interactively by typing a substring. |
| 4231 | For details of keybindings, see `ido-switch-buffer'." | 4239 | For details of keybindings, see `ido-switch-buffer'." |
| 4232 | (interactive) | 4240 | (interactive "P") |
| 4233 | (ido-buffer-internal 'display 'display-buffer nil nil nil 'ignore)) | 4241 | (ido-buffer-internal (if action |
| 4242 | 'display-even-when-displayed | ||
| 4243 | 'display) | ||
| 4244 | 'display-buffer nil nil nil 'ignore)) | ||
| 4234 | 4245 | ||
| 4235 | ;;;###autoload | 4246 | ;;;###autoload |
| 4236 | (defun ido-display-buffer-other-frame () | 4247 | (defun ido-display-buffer-other-frame () |