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: Juri Linkov
Subject: bug#38354: 27.0.50; Implement display action display-buffer-in-tab
Date: Wed, 04 Dec 2019 01:36:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>>> There is one thing I apparently do not understand yet: When you enable
>>> 'tab-bar-mode' it is global
>>
>> 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?
Then I'm not sure.  But generally sounds like the right thing to do
sometime.

>>> - that is any window ever shown on any frame is also in at least one
>>> of that frame's tabs.  Is that right?  So what would 'use-tabs' mean
>>> here when every window is in a tab already?
>>
>> These windows in tabs are in window-configurations and window-states.
>> Now I installed tab-bar-get-buffer-tab
>
> "Return a tab whose window contains BUFFER-OR-NAME, or nil if none."
>
> is a bit misleading, maybe
>
> "Return a tab with a|owning a window whose buffer is BUFFER-OR-NAME."

Done.

> is better.  Also the 'lambda's following the 'seq-some' should be
> moved to a new line to keep line lengths within their limits.

Done.

> 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?

> An aside: Are you sure that 'tab-bar-tabs' should always work on the
> selected frame and not take a frame as argument?

Thanks for the idea, implemented.

>> that can be used
>> in display-buffer-reuse-window to search the buffer
>> in window-states of tabs when use-tabs is non-nil.
>
> Given my observation above, this can make a tab current in frame A
> although the current tab of frame B already shows the buffer.  Right?

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?

>>    If t, start a new tab with the current buffer, i.e. the buffer
>>    that was current before calling the command that adds a new tab
>>    (this is the same what `make-frame' does by default).
>
> OK.  Then my next nitpick is that the doc-string of
> 'tab-bar-new-tab-choice' says
>
> If the value is a string, use it as a buffer name switch to a buffer
>
> which apparently should have "... name.  Switch ..." instead.

Fixed.

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.





reply via email to

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