unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 38354@debbugs.gnu.org
Subject: bug#38354: 27.0.50; Implement display action display-buffer-in-tab
Date: Thu, 05 Dec 2019 00:51:43 +0200	[thread overview]
Message-ID: <87k17bn1q8.fsf@mail.linkov.net> (raw)
In-Reply-To: <6fbb734e-2fce-c148-0387-8cbe9bba649c@gmx.at> (martin rudalics's message of "Wed, 4 Dec 2019 10:22:39 +0100")

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

I have no preference, but don't understand why the implementation
should provide only one way, but not another.  Is it what users expect?

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

It should close the tab only on quitting the window with the buffer
whose displaying created the tab.  For example, when
'switch-to-buffer-other-tab' creates a new tab, then quitting
its buffer should close the tab.

This is the same logic as for creating/deleting the window, e.g.
'C-h f car RET' creates a window, but typing 'q' in Help buffer
deletes the window.  'q' in a new tab should close it as well.





  reply	other threads:[~2019-12-04 22:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 23:09 bug#38354: 27.0.50; Implement display action display-buffer-in-tab Juri Linkov
2019-11-26  9:32 ` martin rudalics
2019-11-26 22:30   ` Juri Linkov
2019-11-26 22:43   ` Juri Linkov
2019-11-27  9:49     ` martin rudalics
2019-11-27 21:37       ` Juri Linkov
2019-11-28  9:20         ` martin rudalics
2019-11-28 23:02           ` Juri Linkov
2019-11-29  9:24             ` martin rudalics
2019-12-01 22:29               ` Juri Linkov
2019-12-02  9:40                 ` martin rudalics
2019-12-02 23:43                   ` Juri Linkov
2019-12-03  9:18                     ` martin rudalics
2019-12-03 23:36                       ` Juri Linkov
2019-12-04  9:22                         ` martin rudalics
2019-12-04 22:51                           ` Juri Linkov [this message]
2019-12-05  9:05                             ` martin rudalics
2019-12-05 23:54                               ` Juri Linkov
2019-12-06  7:37                                 ` martin rudalics
2022-12-06 17:40                                   ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k17bn1q8.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=38354@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).