Subject: bug#76439: [PATCH] Specify 'tab-bar-history-mode' in 'winner-mode' docstring

From: Visuwesh <[email-masked]>
Date: Thu, 20 Feb 2025 22:48:42 +0530

[வியாழன் பிப்ரவரி 20, 2025] Eli Zaretskii wrote:

>> From: Visuwesh <[email-masked]>
>> Date: Thu, 20 Feb 2025 20:21:28 +0530
>> 
>> Attached patch suggests to use tab-bar-history-mode when using
>> tab-bar-mode instead.  winner-mode interacts quite badly with
>> tab-bar-mode and it took me sometime to discover tab-bar-history-mode
>> when I started using winner-mode initially.  Mentioning it in
>> winner-mode's would help its discoverability I hope.
>
> Should we instead try to fix winner (and maybe also tab-bar-mode) to
> avoid these problems?

It would essentially involve writing tab-bar-history-mode anew to
certain extent AFAIU.  I wanted to head down this path until I realised
tab-bar-history-mode does everything winner while taking into account
tab-bar-mode.

> In any case, if tab-bar-history-mode is better suited to winner, then
> the reference you want to add should at least hint on why it is better
> suited.

How about the attached?

>From d3edd40a60a9dbe9b9cd5310af42e7810eec06c5 Mon Sep 17 00:00:00 2001
From: Visuwesh <[email-masked]>
Date: Thu, 20 Feb 2025 20:19:32 +0530
Subject: [PATCH] Specify 'tab-bar-history-mode' in 'winner-mode' docstring

* lisp/winner.el (winner-mode): Update the docstring to suggest
'tab-bar-history-mode' when using 'tab-bar-mode' instead.  (Bug#76439)
---
 lisp/winner.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/winner.el b/lisp/winner.el
index e56ddf92965..e56e7268727 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -345,7 +345,13 @@ winner-mode
 into windows) so that the changes can be \"undone\" using the
 command `winner-undo'.  By default this one is bound to the key
 sequence \\`C-c <left>'.  If you change your mind (while undoing),
-you can press \\`C-c <right>' (calling `winner-redo')."
+you can press \\`C-c <right>' (calling `winner-redo').
+
+If you use `tab-bar-mode', consider using `tab-bar-history-mode' as
+`winner-mode' is unaware of tab switching and might turn the window
+configuration of the current tab to another's (old) window
+configuration.  `tab-bar-history-mode' provides tab-specific window
+configuration history avoiding this problem."
   :global t
   (if winner-mode
       (progn
--
2.47.2