diff options
| author | Eli Zaretskii | 2019-05-08 20:34:09 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-05-08 20:34:09 +0300 |
| commit | e7ab351caa884755c032fd9544ba67a3c953144f (patch) | |
| tree | 2e88bfa03061b141b7b58fe95800b7ab78f1816b | |
| parent | 916510b6d919a333d1dac528a9d051aa6d857ccc (diff) | |
| download | emacs-e7ab351caa884755c032fd9544ba67a3c953144f.tar.gz emacs-e7ab351caa884755c032fd9544ba67a3c953144f.zip | |
Fix positioning client buffer as instructed by emacsclient
* lisp/server.el (server-switch-buffer): Let-bind
switch-to-buffer-preserve-window-point to nil when switching
to the client buffer, when the client requested a specific
position. (Bug#35602)
| -rw-r--r-- | lisp/server.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/server.el b/lisp/server.el index a39b1cb46d4..42329e853ba 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -1621,7 +1621,14 @@ be a cons cell (LINENUMBER . COLUMNNUMBER)." | |||
| 1621 | (frame-terminal)))) | 1621 | (frame-terminal)))) |
| 1622 | 'nomini 'visible (selected-window)))) | 1622 | 'nomini 'visible (selected-window)))) |
| 1623 | (condition-case nil | 1623 | (condition-case nil |
| 1624 | (switch-to-buffer next-buffer) | 1624 | ;; If the client specified a new buffer position, |
| 1625 | ;; treat that as an explicit point-move command, and | ||
| 1626 | ;; override switch-to-buffer-preserve-window-point. | ||
| 1627 | (let ((switch-to-buffer-preserve-window-point | ||
| 1628 | (if filepos | ||
| 1629 | nil | ||
| 1630 | switch-to-buffer-preserve-window-point))) | ||
| 1631 | (switch-to-buffer next-buffer)) | ||
| 1625 | ;; After all the above, we might still have ended up with | 1632 | ;; After all the above, we might still have ended up with |
| 1626 | ;; a minibuffer/dedicated-window (if there's no other). | 1633 | ;; a minibuffer/dedicated-window (if there's no other). |
| 1627 | (error (pop-to-buffer next-buffer))))))) | 1634 | (error (pop-to-buffer next-buffer))))))) |