diff options
| author | Philipp Stephani | 2017-01-08 19:44:22 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2017-04-22 18:33:38 +0200 |
| commit | ace38bafa6ae0d40bf3fac9f998c8ecbe36d5f41 (patch) | |
| tree | 606bda0d44d6206a1ac1b00272632b2c5ee544f4 /lisp/ffap.el | |
| parent | d354fc38286cba05b3ba2fefb9d9cd6d30deac3d (diff) | |
| download | emacs-ace38bafa6ae0d40bf3fac9f998c8ecbe36d5f41.tar.gz emacs-ace38bafa6ae0d40bf3fac9f998c8ecbe36d5f41.zip | |
ffap: Don't switch window unless needed
When using ffap-other-window, don't change the window configuration
unless a new buffer has actually been created (Bug#25352).
* lisp/ffap.el (ffap-other-frame): Don't change the window
configuration if no new buffer has been created.
* test/lisp/ffap-tests.el (ffap-other-window--bug-25352): Add unit
test.
Diffstat (limited to 'lisp/ffap.el')
| -rw-r--r-- | lisp/ffap.el | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lisp/ffap.el b/lisp/ffap.el index 1ea32b75f12..87531110b86 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el | |||
| @@ -1768,14 +1768,9 @@ Return value: | |||
| 1768 | "Like `ffap', but put buffer in another window. | 1768 | "Like `ffap', but put buffer in another window. |
| 1769 | Only intended for interactive use." | 1769 | Only intended for interactive use." |
| 1770 | (interactive) | 1770 | (interactive) |
| 1771 | (let (value) | 1771 | (pcase (save-window-excursion (call-interactively 'ffap)) |
| 1772 | (switch-to-buffer-other-window | 1772 | ((or (and (pred bufferp) b) `(,(and (pred bufferp) b) . ,_)) |
| 1773 | (save-window-excursion | 1773 | (switch-to-buffer-other-window b)))) |
| 1774 | (setq value (call-interactively 'ffap)) | ||
| 1775 | (unless (or (bufferp value) (bufferp (car-safe value))) | ||
| 1776 | (setq value (current-buffer))) | ||
| 1777 | (current-buffer))) | ||
| 1778 | value)) | ||
| 1779 | 1774 | ||
| 1780 | (defun ffap-other-frame () | 1775 | (defun ffap-other-frame () |
| 1781 | "Like `ffap', but put buffer in another frame. | 1776 | "Like `ffap', but put buffer in another frame. |