From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriel do Nascimento Ribeiro Newsgroups: gmane.emacs.devel Subject: Re: Some ideas to improve Tab Bar Date: Wed, 25 Nov 2020 14:19:49 -0300 Message-ID: References: <871rghlvxe.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31378"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 25 19:57:25 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khzyn-00083X-4F for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Nov 2020 19:57:25 +0100 Original-Received: from localhost ([::1]:51724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khzym-0006C2-4B for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Nov 2020 13:57:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khySg-00048v-Dl for emacs-devel@gnu.org; Wed, 25 Nov 2020 12:20:10 -0500 Original-Received: from mail-bn7nam10olkn2025.outbound.protection.outlook.com ([40.92.40.25]:32097 helo=NAM10-BN7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khySe-0000Fg-0F for emacs-devel@gnu.org; Wed, 25 Nov 2020 12:20:09 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hmZiLKz/mk7OYOuW90kKFnbgKQf3RdheNhHZXY0+zWPJhnoQuoLKdRr3fZHSFCfqWs70Fjh3aAyyocI7VAIKLQNVSLlFsjn7K9zolxy7QyJuYuQr+IiUEF8O2I1IpcnBuYFgJUt8ayOATBkD2WiioFHELy21eadvNunnyjSUunE9Q/HVokHgo/lOTO1EEtduDTfYXWkYn9fKb41wiULDWL7uORz9TBs+xLlG2MNbBU2MFsUSxe1YF3TXKIkbbzBIP5Stpp4G/ShBlxF0uIZ3RD7MStI6jystfq0MPRTXBYWn4GM3d4wq/8pRiRTDdwS4WTC6gl3CoYHYGv//e0HG0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BnyW7Oz/e0HNAskEH/cx7hKoK0klbShGTY9oJptSi2g=; b=I1FCoSKVRJky7vFsk9VSkyl69tkp2roFk6sJwcET0TT0IfABNCtWmlF2WGQISHuNY5i/V2xwtENgfHK0WnKajztDZaph6AvAPXD9eZJeHV+PsXAx0KAAgYymENBks/5EKJm7kN6OY4G74tCO/WGeBwx2Znt57ONySxRxU5r5jHAuHWHjdCZmxQIR1ooXLQ7LDRJ3IjLJoWDT62Mrcxd+BQMBWUGBvS3zMxi4G+EagsckFvrEM7y137miQ9MOY9argTUmF2CAYk9AhLYnaG6pAztv/ys/4Ov/M6kXeYCYVRQrqbA3FPFSFE5t0Mcrl48sFZeA8jdoDiOenjsChfBc9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BnyW7Oz/e0HNAskEH/cx7hKoK0klbShGTY9oJptSi2g=; b=sTcCRkTBZQyJHppLDkX2MP4QDtXrfbInKLE51mNXgEqytUMRmFHj6FLcvEK1MzhE64SBd+rom8wikUSElUYQCV862ZssbCbWiULwCx9rYM+UzPLA1LkvEC7opD5j3G6FKtk9HNVW3G5WAAnL4Rtut5AwqN8HSA+They7+44B6t5Rc3vAc77fp2GguXO7siq9LOaeeySkTfIPOtZ0DAia13Ddm2G140Vdr8EY2w9lNu61s2mjFalLoCan7rG9o/aMpPbErn+rMOPzgw/9CZYDfVrK4gqDPRhEk53vscN8Gv4r88+CWsFP7/cZRCDEnL8CCvs3QD7bSgSFv9fbLHANZg== Original-Received: from DM6NAM10FT011.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::4a) by DM6NAM10HT077.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::384) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.25; Wed, 25 Nov 2020 17:20:06 +0000 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com (2a01:111:e400:7e86::53) by DM6NAM10FT011.mail.protection.outlook.com (2a01:111:e400:7e86::178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.25 via Frontend Transport; Wed, 25 Nov 2020 17:20:06 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:27DA516A19CF3DFB13C937D93B5030EED948F17998A72ACE08B7FD54F79B8B2A; UpperCasedChecksum:95F7B3AE850CCE025966BA8728C5C8BFBE8B0DC514BF763EE7C3BCDA6AF83666; SizeAsReceived:8710; Count:46 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac]) by CH2PR01MB5879.prod.exchangelabs.com ([fe80::d51d:8cbe:370a:39ac%7]) with mapi id 15.20.3589.028; Wed, 25 Nov 2020 17:20:06 +0000 In-Reply-To: <871rghlvxe.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 25 Nov 2020 09:47:41 +0200") X-TMN: [kwQQSuWCRnXfoUV4VhBgvzAULYZSEaZLAc67z1AezByR9LaSFNAF+TSdLXhBJ63I] X-ClientProxiedBy: CPYP284CA0051.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:81::20) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: <87y2ipuzey.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from precision5540 (2804:431:c7f2:228:d2a2:37f2:99b1:ea24) by CPYP284CA0051.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:81::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Wed, 25 Nov 2020 17:20:04 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 1662c11c-6909-4051-f756-08d8916659e1 X-MS-TrafficTypeDiagnostic: DM6NAM10HT077: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a93MOHTnGxlwz68b99XNx2gkiSN9fYSYRjjHv9HoXCmWBw2C+Vq1Pl7kh62bPdp/y1GASzzCZZJs4tSb64eQh66q6HfimLr5xX1/xGW5SDbTnSp+zaX/1w1rMD0ehtpt0dXuWJiHZV9AemIAwpxwxExeG7NIF7+evf/f6g+asu3xQldm00lVVGdadyg1sXTA+2H+hmJSeYbKv1cL3jMUJw== X-MS-Exchange-AntiSpam-MessageData: Mtsd0SMVYp9aK8JsBHXsXveuBpiXx4IPb02pwR1qfI9/2sA8bphjcZ+wotSTRfQDJPwPhYule0PWX/RniLHpqF+DZoqrmKR6ESX8S1unZOcEAXOEXIHyVQ9fQoCBH3xMduKG1PbNtgA6FI8FglfQFFthMIGqU2QLadX7Zy59L5AX1UWkndAMjIlLjSiTDqCBCUO+YFr4SozAAQ7KIlvnbw== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1662c11c-6909-4051-f756-08d8916659e1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2020 17:20:06.4231 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM10FT011.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM10HT077 Received-SPF: pass client-ip=40.92.40.25; envelope-from=gabriel376@hotmail.com; helo=NAM10-BN7-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 25 Nov 2020 13:56:28 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:259799 Archived-At: Juri Linkov writes: >> Some little ideas on how Tab Bar can be further improved: > > Thanks for the ideas. > >> 1. Options to disable `tab-bar-back-button' and >> `tab-bar-forward-button' when `tab-bar-history-mode' is on. This will >> be similar to what option `tab-bar-close-button-show' is to >> `tab-bar-close-button'. > > 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'= . >> 2. Trim spaces of tab bar name. The tab bar name can have additional spa= ces on the right: >> 2.1. When tab bar name name is set explicitly with `tab-bar-rename-t= ab'; >> 2.2. When `tab-bar-tab-hints' is true and `tab-bar-tab-name-function= ' returns an empty string; > > 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 wi= ll 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=C2=B4 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 manage= rs works by default like DWM or i3, where worspaces are named with numbers onl= y. 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 spe= cify 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. >> 3. An easier way to add more items to Tab Bar to make it act more like >> a general Bar. The following example was shared in Emacs Devel >> mailing list on how to add a simple clock to the right of Tab Bar: >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> (advice-add 'tab-bar-make-keymap-1 :around >> (lambda (orig-fun) >> (append (funcall orig-fun) >> `((display-time menu-item >> ,(concat >> (propertize " " 'display '(spa= ce :align-to (- right 5))) >> (format-time-string "%H:%M")) >> ignore)))) >> '((name . tab-bar-display-time))) >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > 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 potenti= al of the Tab Bar towards a more general Bar and that many users would like a bet= ter 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-li= ne' is super customizable and a there is `header-line' also, but that means hav= ing additional bars on the screen. >> 4. Maybe deprecate `winner-mode' in favor to `tab-bar-history-mode', >> since these two modes have similar functions. >> Using `tab-bar-history-mode' with only one Tab is like using >> `winner-mode'. > > `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, mor= e 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 usin= g tabs is similar to using only one tab, where tab-bar visibility can be configured with `tab-bar-show' set to nil or 1. Regards, Gabriel