Commit e7ab351c authored by Eli Zaretskii's avatar Eli Zaretskii

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)
parent 916510b6
Pipeline #1614 passed with stage
in 27 minutes and 43 seconds
......@@ -1621,7 +1621,14 @@ be a cons cell (LINENUMBER . COLUMNNUMBER)."
(frame-terminal))))
'nomini 'visible (selected-window))))
(condition-case nil
(switch-to-buffer next-buffer)
;; If the client specified a new buffer position,
;; treat that as an explicit point-move command, and
;; override switch-to-buffer-preserve-window-point.
(let ((switch-to-buffer-preserve-window-point
(if filepos
nil
switch-to-buffer-preserve-window-point)))
(switch-to-buffer next-buffer))
;; After all the above, we might still have ended up with
;; a minibuffer/dedicated-window (if there's no other).
(error (pop-to-buffer next-buffer)))))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment