all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matt Beshara <m@mfa.pw>
To: Adam Porter <adam@alphapapa.net>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] New tab-bar-detach-tab command
Date: Wed, 29 Sep 2021 11:05:42 +1000	[thread overview]
Message-ID: <87r1d8p4l5.fsf@mfa.pw> (raw)
In-Reply-To: <87h7e4ikkz.fsf@alphapapa.net>

Hi Adam (and others),
I missed this functionality from web browsers as well, but the 
implementation you posted doesn’t work on my setup.  The new tab 
it creates in a new frame only contains one of the multiple 
windows I had open in the original tab, and it gives me the 
message “tab-close: Attempt to delete the sole tab in a frame”. 
Below I’ve pasted another implementation I’ve been using for a 
little while which I get better results with.

#+BEGIN_SRC emacs-lisp
(defun tab-bar-move-tab-to-new-frame ()
  (interactive)
  (let* ((from-frame (selected-frame))
         (from-tabs (funcall tab-bar-tabs-function from-frame))
         (from-index (1+ (tab-bar--current-tab-index from-tabs)))
         (new-frame (make-frame)))
    (tab-bar-move-tab-to-frame nil from-frame from-index new-frame 
    1)
    (select-frame new-frame)
    (tab-bar-close-tab)))
#+END_SRC

I hope you find this useful,
Matt


Adam Porter <adam@alphapapa.net> writes:

> Hi Juri, et al,
>
> I found myself wanting to move a tab-bar tab to a new frame 
> displaying
> only that tab (like a web browser's "detach tab" command), and I
> couldn't find a command to do that, so I wrote this simple one. 
> It
> seems to work and ought to be useful, I think.
>
> It might be worth binding it to something like "C-x t D" as 
> well,
> assuming the command is worth merging.  :)
>
> Thanks,
> Adam
>
> [2. New tab-bar-detach-tab command --- text/x-diff; 
> 0001-lisp-tab-bar.el-tab-bar-detach-tab-New-command.patch]...




  reply	other threads:[~2021-09-29  1:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 19:09 [PATCH] New tab-bar-detach-tab command Adam Porter
2021-09-29  1:05 ` Matt Beshara [this message]
2021-09-29  7:11   ` Juri Linkov
2021-09-29  7:43   ` Adam Porter
2021-09-29  7:09 ` Juri Linkov
2021-09-29  7:59   ` Adam Porter
2021-09-29 19:43     ` Juri Linkov
2021-09-29 19:54       ` Adam Porter
2021-10-03 17:19         ` Juri Linkov
2021-10-04 10:34           ` Adam Porter
2021-10-04 17:33             ` Juri Linkov
2021-10-04 19:53               ` Adam Porter
2021-10-05  6:49                 ` Juri Linkov
2021-10-05  7:17                   ` Adam Porter
2021-10-05 15:27                     ` [External] : " Drew Adams
2021-10-05 16:38                     ` Juri Linkov
2021-10-06 11:23                       ` Adam Porter
2021-10-06 16:38                         ` Juri Linkov
2021-10-07 18:02                           ` Juri Linkov
2021-10-07 18:23                             ` [External] : " Drew Adams
2021-10-05 15:18                   ` Drew Adams
2021-10-05 16:40                     ` Juri Linkov
2021-10-05 17:27                       ` Drew Adams
2021-10-06 16:39                         ` Juri Linkov
2021-10-06 20:20                           ` [External] : " Drew Adams
2021-10-07  7:29                             ` Juri Linkov
2021-10-07  7:43                               ` Eli Zaretskii
2021-10-07 17:58                                 ` Juri Linkov
2021-10-07 18:19                                   ` Drew Adams
2021-10-07 18:28                                   ` Eli Zaretskii
2021-10-07 15:56                               ` Drew Adams
2021-10-05 16:35                 ` Juri Linkov
2021-10-05 15:15               ` [External] : " Drew Adams

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

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

  git send-email \
    --in-reply-to=87r1d8p4l5.fsf@mfa.pw \
    --to=m@mfa.pw \
    --cc=adam@alphapapa.net \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.