bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#38354: 27.0.50; Implement display action display-buffer-in-tab


From: martin rudalics
Subject: bug#38354: 27.0.50; Implement display action display-buffer-in-tab
Date: Wed, 4 Dec 2019 10:22:39 +0100

>>> Do you think we should have 'global-tab-bar-mode' for all frames,
>>> and 'tab-bar-mode' to enable/disable the tab-bar in every frame
>>> separately?
>>
>> In the sense that we can enable menu or tool bars for frames
>> individually?  I think so, yes.
>
> Oh, this also means redesigning tool-bar-mode and menu-bar-mode?

By no means.  I meant to add a 'tab-bar-lines' entry to the list of
frame parameters so one can override the standard behavior for
individual frames as one can do with the ‘menu-bar-lines’ and
'tool-bar-lines' parameters.  (Obviously, that naming convention is
silly because one cannot use it to change the number of lines these
objects have.)

> Then I'm not sure.  But generally sounds like the right thing to do
> sometime.
[...]
>> In either case, do I read the code correctly that it can prefer a
>> window in a non-current tab to a window in a current tab on another
>> frame.  If so, do we want that?
>
> Do you think it should return a list of all tabs owning a window
> with the buffer?

No.  I meant that it should continue to scan frames as long as it has
not found a window showing that buffer.  During that scan it would
record the first tab that has a window whose buffer is the one searched
for.  The return value would then be preferably (the tab of) a window
actually showing the buffer or, if no such window exists, a tab that
has a window whose buffer is the one searched for.

> Why not?  Does display-buffer-reuse-window currently prefers
> a window on the same frame even when a window on another frame
> also shows the same buffer?

It does.  But I don't say that 'display-buffer-in-tab' must do the
same.  What I meant was, as sketched above, to prefer a tab where a
window already shows the buffer to tabs that would show the buffer but
only if they were current/active or tabs where such a buffer window
would have to be added first.

> Additional question: using quit-window on the buffer displayed
> by display-buffer-in-tab should close its tab.  Could you recommend
> how to implement this?  Maybe to add an additional argument CLOSE-TAB
> to quit-restore-window?  e.g.
>
>    (defun quit-restore-window (&optional window bury-or-kill close-tab)
>    ...
>
> For testing I tried to call '(tab-bar-close-tab)' at the end of
> 'quit-restore-window' unconditionally, but sometimes it does wrong thing:
> when quitting the last window of the frame closes the frame,
> '(tab-bar-close-tab)' closes the tab on another frame that
> is selected after closing the original frame.

Then 'tab-bar-close-tab' is probably the wrong function to call here.

But why do you want to close a tab (an entire window configuration)
here?  Shouldn't 'quit-restore-window' just remove that window from a
tab, that is, update the current tab of that frame to what it is?  Or
does the current tab of a frame not necessarily match that frame's
window configuration?

martin






reply via email to

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