[Top][All Lists]

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

Re: [PATCH] Enable persistent naming for tabs

From: Robert Cochran
Subject: Re: [PATCH] Enable persistent naming for tabs
Date: Wed, 23 Oct 2019 09:22:14 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Juri Linkov <address@hidden> writes:

>> For emacs usage, I'd suggest that 1 tab == the baseline --- 0 tabs
>> mostly is equivalent to tab-bar not existing.
> This seems the right thing to do.  So closing the last tab
> will disable tab-bar-mode.

I personally am not fond of this behavior. That is not what I would
expect the button to do, personally. If I was a new user that didn't
know any better, that behavior would be very surprising and confusing, I
think. Plus that makes it a little too easy for a fiddly laptop trackpad
or some other not-super-accurate pointing device to drift over the
'close' button when I was actually trying to aim for the 'new tab'

Honestly, it really seems like we have at least 3 different alternatives
that sound like they could be The Right Thing:

A) Do nothing, as we currently do, but implement a fix to prevent from
trashing the explicit-name property of the tab (I suggest signalling
user-error and bailing out early, as previously mentioned).

B) Close the whole frame, as one usually expects out of a web browser
these days.

C) Disable tab-bar-mode

My personal opinion at this point is that we should offer all 3 as
customize options, as well as provide a 4th option that is 'provide a
function that takes the tab as an argument, and handle it however you
want to handle it'. Something like:

#+BEGIN_SRC elisp
(defcustom tab-bar-close-tab-choice nil
  "Defines what to show in a new tab.
If nil, do not close the tab.
If close-frame, close the entire containing frame, as a web
browser would do.
If disable-tab-bar, turn off tab-bar-mode so that tabs no longer
show in the frame.
If the value is a function, call that function with the tab to be
closed as the argument."
  :type '(choice (const    :tag "Do nothing" nil)
                 (const    :tag "Close frame" 'close-frame)
                 (const    :tag "Disable tab-bar-mode" 'disable-tab-bar)
                 (function :tag "Function"))
  :group 'tab-bar
  :version "27.1")

And then we can go from there. If that sounds like a workable solution,
then I'll provide a patch in the next few days that implements the
defcustom and all the appropriate behavior.

~Robert Cochran

GPG Fingerprint - BD0C 5F8B 381C 64F0 F3CE  E7B9 EC9A 872C 41B2 77C2

reply via email to

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