unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Some ideas to improve Tab Bar
Date: Wed, 25 Nov 2020 21:22:17 +0200	[thread overview]
Message-ID: <87tutd6y3a.fsf@mail.linkov.net> (raw)
In-Reply-To: <CH2PR01MB58793C6C2AB37A1C88594CB68BFA0@CH2PR01MB5879.prod.exchangelabs.com> (Gabriel do Nascimento Ribeiro's message of "Wed, 25 Nov 2020 14:19:49 -0300")

>> The most difficult part is to choose a good option name.
>> Maybe, `tab-bar-history-buttons-show' is not too bad.
>
> I would suggest `tab-bar-back-button-show'and `tab-bar-forward-button-show'.

This is fine since it's based on existing variable names.

>> Sorry, I don't understand what is the problem.
>> When the user intentionally adds spaces in case 2.1.,
>> then why there is a need to trim spaces?
>
> Yes, if the user intentionally adds space and wants this behavior, that's
> okay. But if he wants the trim function or any other custom formatting, it's not
> possible.
>
> Another scenario is 2.2, where `tab-bar-tab-hints' is true and
> `tab-bar-tab-name-function' returns an empty string. In this cases, tabs will be
> named with a trim space on the right as follow: "1 ", "2 ", "3 " etc and it's
> not possible to format the names (unless using some `defadvice´ on
> `tab-bar-make-keymap-1' is used to manually modify the output list of menu
> items). I ran into this problem when trying to mimic how some window managers
> works by default like DWM or i3, where worspaces are named with numbers only.
>
> I think that having some option here to better control how tab names are
> displayed would be helpful and the implementation is not hard. We can add a new
> boolean option to trim tab names or add a new option where the user can specify
> a custom function to be run to format the final tab name string. There are more
> alternatives but these two are the simplest, I guess.

A new boolean option would be too ad-hoc.  OTOH, a custom function to format
the final tab bar would be more preferable.  Maybe the same custom function
could be used to add more items like adding custom texts or buttons below:

>> Do you propose to add functions that would allow doing this more easily?
>> Maybe using some hooks?
>
> I didn't think in any implementation, actually. But I could see the potential of
> the Tab Bar towards a more general Bar and that many users would like a better
> control on what is displayed there, like adding custom texts or buttons. I ran
> into this idea by reading some threads here in emacs-devel. I know `mode-line'
> is super customizable and a there is `header-line' also, but that means having
> additional bars on the screen.

Mode line constructs can be used to format tab-line, e.g.:

  (global-tab-line-mode)
  (setq tab-line-format '(:eval mode-line-format))

but not tab-bar.  tab-bar needs a completely separate solution.

>> `winner-mode' should not be deprecated because it's still useful
>> for users who don't use tabs with `tab-bar-mode'.  So `winner-mode'
>> works fine when tabs are not used.  OTOH, `winner-mode' breaks tabs
>> when used with `tab-bar-mode', so `tab-bar-history-mode' is needed
>> to do the same when tabs are used.
>
> That's my point. We have two similar modes to handle window configuration
> history which works on specific cases. That means having more code on Emacs,
> more documentation, more configuration on init files, more keybindings, more
> stuff to learn, more confusion etc. That would be great if we could have a
> single way to work with window configuration history in all cases. Not using
> tabs is similar to using only one tab, where tab-bar visibility can be
> configured with `tab-bar-show' set to nil or 1.

I don't know, we need to ask the users of winner-mode whether they
can lose something after doing

 (defalias 'winner-mode 'tab-bar-history-mode)
 (defalias 'winner-undo 'tab-bar-history-back)
 (defalias 'winner-redo 'tab-bar-history-forward)



  reply	other threads:[~2020-11-25 19:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  0:35 Some ideas to improve Tab Bar Gabriel do Nascimento Ribeiro
2020-11-25  7:47 ` Juri Linkov
2020-11-25 17:19   ` Gabriel do Nascimento Ribeiro
2020-11-25 19:22     ` Juri Linkov [this message]
2021-02-27 20:12     ` Juri Linkov
2021-03-01 23:15       ` Gabriel do Nascimento Ribeiro
2021-03-02 19:46         ` Juri Linkov
2020-11-26 23:08 ` Gabriel do Nascimento Ribeiro
2020-11-27  8:22   ` 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=87tutd6y3a.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=emacs-devel@gnu.org \
    --cc=gabriel376@hotmail.com \
    /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).