summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/server.el9
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)."
(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)))))))