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: Thu, 26 Nov 2020 20:08:48 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1974"; 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 Fri Nov 27 00:25:39 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 1kiQdv-0000OQ-8W for ged-emacs-devel@m.gmane-mx.org; Fri, 27 Nov 2020 00:25:39 +0100 Original-Received: from localhost ([::1]:39170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kiQdu-0004FI-8k for ged-emacs-devel@m.gmane-mx.org; Thu, 26 Nov 2020 18:25:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiQcY-0003kM-8B for emacs-devel@gnu.org; Thu, 26 Nov 2020 18:24:15 -0500 Original-Received: from mail-dm6nam11olkn2067.outbound.protection.outlook.com ([40.92.19.67]:42481 helo=NAM11-DM6-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 1kiQcV-0004aa-LW for emacs-devel@gnu.org; Thu, 26 Nov 2020 18:24:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DDxXgTU8EAXY8Vzcan3sh8oZDSpq1lpWk+7nbaxSB6yJ6W58b2IGZWQ//2+4U+UIHbw6mRTcXRSqRltKduex2dtXzWWpZgZpk3zeoCeIjwpGZq8FUATvWEJYiDEXfqwCkd3W8TG2hi81jIhdzCvgiAdElwFK3IhZXkb1PWpDBWlbhUMBhLF3g1wfqscYnBVs3XflbM0db6YdUiGaf6fK8D15KqkdUR2+z/1Sqp5Y8E9uvrEJ6uxmGP7UGEHZUJ8dMrTOk88av5Aam10D3SqceQMIVsQ1FBsP1npLypL39EPmwhnUChUCGfswuSMshfPfBpPFRd4pq38XG1+y39ScJA== 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=z8ms7iyDoS+w8w1UexaOp0qveinRM3hXxnCjBnIZLgc=; b=HsJyW3Tqv3SHu8LFZ80BXFP7rXidcM/q7W/eR4kjl4eiWp23TLtHRf3zI+IbdUFLoAPgn8mKh5/mVKdwxDXMqvwdhEuvdqtEgn1pPzEA38NaqpGB4E+0h4l9tPQhEGqQD/H8MAWVokXBbUxs4Sy29+iejN/3aEFzxU0hWxmEqucVSpvPloENPh9crkWJ0tf6+OCYYT2YKz/qd4mWXOnRHqIGkzkHMOzOsqs4klT3YeLsB2o8kH1r/OeRSrS9MBO0Za+5ZOPYIfnd2NCDZXctFdEAfjCMj2kIYUPuF4F6oPf5f6hp2Q8TM1CRpVyc6SlFuBIGdLH1xNr0vxQet8moPQ== 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=z8ms7iyDoS+w8w1UexaOp0qveinRM3hXxnCjBnIZLgc=; b=R1D9bOJ5eL+ao838MEo9zPHtDgqw33vFYOA6hFRawWbo5H8j8HxObdI0//cxJfG0LnviG4xQdE2ss8Tlwnd45mQxolwdv7t2lBe7zB8Dko14SSNtnwUsnH8FXniODwgis59keQhVZTJ44hP91zUvYotlKpexplBaBIIFywckl0p28SJfTZT4eQ6MqzyZeRFEsFK3y3ACc2cM0T5oHWUophBPRgvQYskQUqpjfn+JchcjqUldy2sYRulT2An3Lc6zJZgxQrYrA5X/xe0tp/G4TEaXrnKN+uj31BCNjCQDAmQfcIfUWX0A8FOphfvMtJhp2Sp23OR03wQL/vYVK5qnJQ== Original-Received: from BN8NAM11FT032.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::50) by BN8NAM11HT238.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::263) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.25; Thu, 26 Nov 2020 23:09:07 +0000 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com (2a01:111:e400:fc4b::4a) by BN8NAM11FT032.mail.protection.outlook.com (2a01:111:e400:fc4b::344) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.25 via Frontend Transport; Thu, 26 Nov 2020 23:09:07 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:5C24CA067FBF4B6630FF0802979343D2146C4FE91CABECD3D4A3315F4212A505; UpperCasedChecksum:1DDF91F93567D5C56E9B28571E14F1E2FF6FF984BE7C357BB9CDDBB2D2F14D03; SizeAsReceived:7541; Count:45 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; Thu, 26 Nov 2020 23:09:07 +0000 In-Reply-To: (Gabriel do Nascimento Ribeiro's message of "Wed, 25 Nov 2020 00:35:59 +0000") X-TMN: [sBS+wt2RQHAP9MmH9UJEBesI5St5iqB6JX/0D58LC4XPxsgdaH6c6OpQK1+JZ+kQ] X-ClientProxiedBy: CP2PR80CA0030.lamprd80.prod.outlook.com (2603:10d6:102::16) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: <877dq71zsv.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from precision5540 (2804:431:c7f2:228:adb8:24ae:2954:80d8) by CP2PR80CA0030.lamprd80.prod.outlook.com (2603:10d6:102::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Thu, 26 Nov 2020 23:09:05 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: f92a3d60-7c5a-4172-e5ee-08d8926045d3 X-MS-TrafficTypeDiagnostic: BN8NAM11HT238: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h9Z6cMKoDf+B+vTYTCAyE+Qp9y45Kvr5XHcX7FXeKy67c+k8coRfJKxOCqhIhUm/bDbjNilqm6vkGBwzk4zeG56ELGs2nVR6BD1j38GhoQgdoY3++wMsyqF9MPrjJ/tRAHW8t1j7kmCwAW9gZj3O6olrfickRipQhOdTtWI7lMl+GhVg1sAMaOvZt702zrd0Sxb83ENo2XKwuYYTWRxv/A== X-MS-Exchange-AntiSpam-MessageData: yBdjbx0x+WyJ9lskEg0k6NRE092ko+2yAabuBhxLTEzSk4r8wrxNsk8vnd0CzRBAtlPMhk11+qAhtfGwQikOCZ5o1qYp7xhMgKf1tNYJvM91fFe/FKY46JgYuYjM3+t868mmP9sLtlXxwVN2B/HAHl+JLk3jIEc49wyTwmQ7kFLF5FM6wv44J/QuO8vFFdXg3aztJxJRQiXSZsoEIA0grA== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: f92a3d60-7c5a-4172-e5ee-08d8926045d3 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2020 23:09:07.0039 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT032.eop-nam11.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: BN8NAM11HT238 Received-SPF: pass client-ip=40.92.19.67; envelope-from=gabriel376@hotmail.com; helo=NAM11-DM6-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-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:259847 Archived-At: --=-=-= Content-Type: text/plain Gabriel do Nascimento Ribeiro writes: > Some little ideas on how Tab Bar can be further improved: > > 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 idea of this patch is to add a new option called `tab-bar-history-buttons-show' to control the visibility of `tab-bar-history-mode' back and forward buttons. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-tab-bar-history-buttons-show.patch Content-Description: Patch to add option to control visibility of tab-bar-history buttons diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 2604955224..05611b48bb 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -296,6 +296,16 @@ tab-bar-back-button (defvar tab-bar-forward-button " > " "Button for going forward in tab history.") +(defcustom tab-bar-history-buttons-show t + "Show back and forward buttons when `tab-bar-history-mode' is enabled." + :type 'boolean + :initialize 'custom-initialize-default + :set (lambda (sym val) + (set-default sym val) + (force-mode-line-update)) + :group 'tab-bar + :version "28.1") + (defcustom tab-bar-tab-hints nil "Show absolute numbers on tabs in the tab bar before the tab name. This helps to select the tab by its number using `tab-bar-select-tab' @@ -415,7 +425,7 @@ tab-bar-make-keymap-1 (tabs (funcall tab-bar-tabs-function))) (append '(keymap (mouse-1 . tab-bar-handle-mouse)) - (when tab-bar-history-mode + (when (and tab-bar-history-mode tab-bar-history-buttons-show) `((sep-history-back menu-item ,separator ignore) (history-back menu-item ,tab-bar-back-button tab-bar-history-back --=-=-= Content-Type: text/plain > 2. Trim spaces of tab bar name. The tab bar name can have additional spaces on the right: > 2.1. When tab bar name name is set explicitly with `tab-bar-rename-tab'; > 2.2. When `tab-bar-tab-hints' is true and `tab-bar-tab-name-function' returns an empty string; > The idea of this patch is to add a new option called `tab-bar-tab-name-format-function' where a custom function can be specified to format the string value of `tab-name'. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-tab-bar-tab-name-format-function.patch Content-Description: Patch to add option to specify custom function to format tab name diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 2604955224..82f3ca2385 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -334,6 +334,18 @@ tab-bar-tab-name-function :group 'tab-bar :version "27.1") +(defcustom tab-bar-tab-name-format-function nil + "Function to format a tab name. +Function get one argument, the tab name, and should return +the formatted tab name." + :type 'function + :initialize 'custom-initialize-default + :set (lambda (sym val) + (set-default sym val) + (force-mode-line-update)) + :group 'tab-bar + :version "28.1") + (defun tab-bar-tab-name-current () "Generate tab name from the buffer of the selected window." (buffer-name (window-buffer (minibuffer-selected-window)))) @@ -433,8 +445,9 @@ tab-bar-make-keymap-1 ((eq (car tab) 'current-tab) `((current-tab menu-item - ,(propertize (concat (if tab-bar-tab-hints (format "%d " i) "") - (alist-get 'name tab) + ,(propertize (concat (funcall (or tab-bar-tab-name-format-function 'identity) + (concat (if tab-bar-tab-hints (format "%d " i) "") + (alist-get 'name tab))) (or (and tab-bar-close-button-show (not (eq tab-bar-close-button-show 'non-selected)) @@ -445,8 +458,9 @@ tab-bar-make-keymap-1 (t `((,(intern (format "tab-%i" i)) menu-item - ,(propertize (concat (if tab-bar-tab-hints (format "%d " i) "") - (alist-get 'name tab) + ,(propertize (concat (funcall (or tab-bar-tab-name-format-function 'identity) + (concat (if tab-bar-tab-hints (format "%d " i) "") + (alist-get 'name tab))) (or (and tab-bar-close-button-show (not (eq tab-bar-close-button-show 'selected)) --=-=-= Content-Type: text/plain Regards, Gabriel --=-=-=--