emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 e7ab351: Fix positioning client buffer as instruc


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 e7ab351: Fix positioning client buffer as instructed by emacsclient
Date: Wed, 8 May 2019 13:35:35 -0400 (EDT)

branch: emacs-26
commit e7ab351caa884755c032fd9544ba67a3c953144f
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 lisp/server.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/server.el b/lisp/server.el
index a39b1cb..42329e8 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)))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]