From 29e59b835c86e1ebac12adcb28ab7e1d0c275b2f Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 9 Jan 2024 19:22:40 +0200 Subject: [PATCH] * lisp/tab-bar.el: Fixes for point in window configuration (bug#68235) (tab-bar--tab): Instead of 'point-marker', use 'copy-marker' with the TYPE argument set to 'window-point-insertion-type'. This will allow point to follow the output after switching tabs when point is at the end of a comint/compilation buffer. (tab-bar-select-tab): Remove ad-hoc rule for the reverted dired buffer. --- lisp/tab-bar.el | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 219f42848ef..3e1d8278b04 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1302,7 +1302,7 @@ tab bar might wrap to the second line when it shouldn't.") (ws . ,(window-state-get (frame-root-window (or frame (selected-frame))) 'writable)) (wc . ,(current-window-configuration)) - (wc-point . ,(point-marker)) + (wc-point . ,(copy-marker (window-point) window-point-insertion-type)) (wc-bl . ,bl) (wc-bbl . ,bbl) ,@(when tab-bar-history-mode @@ -1455,13 +1455,7 @@ Negative TAB-NUMBER counts tabs from the end of the tab bar." ;; set-window-configuration does not restore the value of ;; point in the current buffer, so restore it separately. (when (and (markerp wc-point) - (marker-buffer wc-point) - ;; FIXME: After dired-revert, marker relocates to 1. - ;; window-configuration restores point to global point - ;; in this dired buffer, not to its window point, - ;; but this is slightly better than 1. - ;; Maybe better to save dired-filename in each window? - (not (eq 1 (marker-position wc-point)))) + (marker-buffer wc-point)) (goto-char wc-point)) (when wc-bl (set-frame-parameter nil 'buffer-list wc-bl)) -- 2.39.2