From unknown Thu Aug 14 21:53:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#79046 <79046@debbugs.gnu.org> To: bug#79046 <79046@debbugs.gnu.org> Subject: Status: (WIP) [PATCH] tab-line: Change close button appearance for modified tabs Reply-To: bug#79046 <79046@debbugs.gnu.org> Date: Fri, 15 Aug 2025 04:53:30 +0000 retitle 79046 (WIP) [PATCH] tab-line: Change close button appearance for mo= dified tabs reassign 79046 emacs submitter 79046 Elijah Gabe P=C3=A9rez severity 79046 normal tag 79046 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 21:22:14 2025 Received: (at submit) by debbugs.gnu.org; 19 Jul 2025 01:22:14 +0000 Received: from localhost ([127.0.0.1]:37266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucwHF-0006l2-OG for submit@debbugs.gnu.org; Fri, 18 Jul 2025 21:22:14 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39268) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucwHC-0006kU-6X for submit@debbugs.gnu.org; Fri, 18 Jul 2025 21:22:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucwH5-0006ba-Iv for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2025 21:22:04 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ucwH3-0000Wp-N0 for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2025 21:22:03 -0400 Received: by mail-ot1-x341.google.com with SMTP id 46e09a7af769-73e55e829fcso1499273a34.1 for ; Fri, 18 Jul 2025 18:22:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752888120; x=1753492920; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=VLhmo6ZUBtfUaxSJ5wQV+uvVtOTpnp8sTbrBHQchNzU=; b=CfjIio5yL8vS5ksEcahMmGrxq/plIpBMau66hupf5H/lazlqnX+EfMxa6WPB5GVYRO 7qODB9Ydb/F701ArrJ/cSuEmiOQ2OwhNiap9Y5rudhNtoMTyyV6qd0wjhBVwsZIj11Mk KnIkHRIFgd4nfIvQoskowS0vSnyYmF41wdVHQQmTGPK6FRoKFyLeIrKCJnckX+lBnbUZ nJ3ZUNXie9dhxZ2tF+3Jzlle8ylhAhkCeHzClkjXGIECjA5jyYhxDvaAxJAv/kuyDCTw BuBz9sZLsqvYBQWkY5q1EWNFzbXwYxb3OxE8qfDvhVSYVafxbXXWNkHy1kBvqaCsJl6j YN+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752888120; x=1753492920; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VLhmo6ZUBtfUaxSJ5wQV+uvVtOTpnp8sTbrBHQchNzU=; b=Z+SJE0WPJfglpvPkEIeFbW6rk6lHxkzuuFQtH6amChEWxuGER3uweGRCkOqwW1H1x0 37l5vl2tg81uAF7ikHK+ELGGKCb+IsX//wGs+hExUe1FAWKtKMWDBeOEgyDXxKakl537 2jnHRdn4MlKLW5gzU3yNIq1cEFu+SGPIebLTlnFfjRvi2w6DrWhvvS40A++rqhvqwVIp dmbJfAVC3Li8xPi2F9VEJXOKIeL0X0WHJKQw34LlHQYuzz8U4mojqX3kbqk4eYRwFcCB 4u0EA62lKxjozuOB50HjbCu8HtCrGHCPRHi405WdQiS6xWGMNm515yhgjW4pWWq0RcdH 3TUA== X-Gm-Message-State: AOJu0Yy5C6EyNQnY+/CTxgQhHQxWSSlh6Ipcka4ZgkCWn63/yMFPyChe vSZPO2d8jtNH8fHlCFpV57JG9ROzuGIZoGVOtLRDwiG5PU/sFoMq88atyQ4AfT8K X-Gm-Gg: ASbGnctMb89bpc9FDh2clnkKyf6GcqQ1o1MuaPY2/ds6Jp4E+2+7Gv8lfgnwFUrFTkF SVgcLAx9AKETo8IBT2cRQ3SsniDXSaH2BqCZYjt1/6GbCMIieZM3Y1GiZWDgm5jMXj3zKYWwk1d si2+3NIxgwFNO6FKym/zEVEkiYWpconZLwHKKiUnuRXJIsG6wNy/KheYBCteCWtPre1p8DFgmX1 jrPJqqBmjRUaR4uCAIU10AduR567xE9zvh40Abg6e8NzL39JWwVggKq4pfV9cvX0xyF5VXO6J6i eFnM9Na9AaSDtm6WIx6EpehyY0n63zVO7qIc4QHEytEWfhi0tWzyT7HwXCrt1vISCrmLcIctdkS AsBiZC+zDQ8VBxkk= X-Google-Smtp-Source: AGHT+IEJOuwHmyc2gfxtFYMt0ExLPxUwOqYwM51forL5MY6KP+Y2JxfikD/NbRpn+lu7tcwDUgTsEQ== X-Received: by 2002:a05:6830:388e:b0:739:f863:c4d7 with SMTP id 46e09a7af769-73e64a3f15amr12169535a34.12.1752888119498; Fri, 18 Jul 2025 18:21:59 -0700 (PDT) Received: from fedora ([189.215.162.117]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-73e83b0c3fbsm1075563a34.30.2025.07.18.18.21.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jul 2025 18:21:58 -0700 (PDT) From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= To: bug-gnu-emacs@gnu.org Subject: (WIP) [PATCH] tab-line: Change close button appearance for modified tabs X-Debbugs-Cc: Date: Fri, 18 Jul 2025 19:21:56 -0600 Message-ID: <87tt39gekr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::341; envelope-from=eg642616@gmail.com; helo=mail-ot1-x341.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Tags: patch When editing multiple buffers the `tab-line-tab-modified` face (which indicates that a buffer has been modified and not saved) is sometimes barely visible or hard to distinguish from the tab line. Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (eg642616[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (eg642616[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org] X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --=-=-= Content-Type: text/plain Tags: patch When editing multiple buffers the `tab-line-tab-modified` face (which indicates that a buffer has been modified and not saved) is sometimes barely visible or hard to distinguish from the tab line. This patch changes the appearance of the close button icon when the buffer has been modified, similar to other editors. The patch is not yet finished, this feature is currently "hardcoded" (the only way to disable this is removing `tab-line-tab-face-modified` from `tab-line-tab-face-functions`). I would like any suggestion, if should this have an option for disable this. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-tab-line-Add-close-button-for-modified-tabs.patch >From 8730cb498084b96ee968e36259cab9a2480efea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= Date: Sat, 12 Jul 2025 13:16:50 -0600 Subject: [PATCH] tab-line: Add close button for modified tabs * etc/images/tabs/close-modified.xpm: New file * lisp/tab-line.el (tab-line-close-modified): Define new icon. (tab-line-close-modified-button): New internal-variable. (tab-line-tab-name-format-default): Add new close button only if the tab was modified. --- etc/images/tabs/close-modified.xpm | 16 ++++++++++++++++ lisp/tab-line.el | 24 +++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 etc/images/tabs/close-modified.xpm diff --git a/etc/images/tabs/close-modified.xpm b/etc/images/tabs/close-modified.xpm new file mode 100644 index 00000000000..44b45d49011 --- /dev/null +++ b/etc/images/tabs/close-modified.xpm @@ -0,0 +1,16 @@ +/* XPM */ +static char *dummy[]={ +"9 9 4 1", +". c None", +"b c #000000", +"a c #808080", +"# c #bfbfbf", +"..#####..", +".#######.", +"###aaa###", +"##abbba##", +"##abbba##", +"##abbba##", +"###aaa###", +".#######.", +"..#####.."}; diff --git a/lisp/tab-line.el b/lisp/tab-line.el index b93aef2dd53..4153bd8ac2a 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -251,6 +251,26 @@ tab-line-close-button 'help-echo "Click to close tab") "Button for closing the clicked tab.") +(define-icon tab-line-close-modified nil + `((image "symbols/dot_medium_16.svg" "tabs/close-modified.xpm" + :face shadow + :height (1 . em) + :margin (2 . 0) + :ascent center) + (symbol ,(concat " " [#x2022])) ; bullet + (text " *")) + "Icon for closing the clicked tab when tab is modified." + :version "31.1" + :help-echo "Click to close tab") + +(defvar tab-line-close-modified-button + (propertize (icon-string 'tab-line-close-modified) + 'rear-nonsticky nil + 'keymap tab-line-tab-close-map + 'mouse-face 'tab-line-close-highlight + 'help-echo "Click to close tab") + "Button for closing the clicked tab when tab is modified.") + (define-icon tab-line-left nil `((image "symbols/chevron_left_16.svg" "tabs/left-arrow.xpm" :face shadow @@ -619,7 +639,9 @@ tab-line-tab-name-format-default (not (eq tab-line-close-button-show (if selected-p 'non-selected 'selected))) - tab-line-close-button) + (if (memq 'tab-line-tab-modified (plist-get face :inherit)) + tab-line-close-modified-button + tab-line-close-button)) ""))) (setq close (copy-sequence close)) ;; Don't overwrite the icon face -- 2.50.1 --=-=-= Content-Type: text/plain -- - E.G via GNU Emacs and Org. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 03:09:44 2025 Received: (at 79046) by debbugs.gnu.org; 20 Jul 2025 07:09:44 +0000 Received: from localhost ([127.0.0.1]:48032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1udOB6-0004wS-C7 for submit@debbugs.gnu.org; Sun, 20 Jul 2025 03:09:44 -0400 Received: from mout-y-111.mailbox.org ([91.198.250.236]:35842) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1udOB3-0004wA-L3 for 79046@debbugs.gnu.org; Sun, 20 Jul 2025 03:09:42 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-y-111.mailbox.org (Postfix) with ESMTPS id 4blF5R6xZfz9xrB; Sun, 20 Jul 2025 09:09:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; t=1752995372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yIKQKDUmd0gSjSnrP03u49+chH2BQxtPuxdIK8IenJ0=; b=KPfhd7KjFt5mPXYuyJ4EUg0PE9S1WMFuCIZSSsnP0WtDQM3gY4zdDZDTw5OtLBPgOOvILL Ro/9Pebb7HOvIFiJO0ab4Jg3gnJdYZWwJVDJMND4emH9fFR8LQAYlNgy0Nw0TktBYzttRT H1eU+MJLxEc+rZu/yFOVM11M4k84lZ4A97m38C92c7lOSIImMH6ZW23++nlZ1UyYvAfD5P I6Z/RyFqvgzeCvqCnDXQXLFAB1Dx3P1LwB93sDHwrEfqiMbk/f9/hP+uLeZjZxPt/QMn9O vvyHTokwNK9AExh0VYCzU74zghGRFgtg70inntrGznuylFn8eupFGann6c84kg== From: Juri Linkov To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= Subject: Re: bug#79046: (WIP) [PATCH] tab-line: Change close button appearance for modified tabs In-Reply-To: <87tt39gekr.fsf@gmail.com> Organization: LINKOV.NET References: <87tt39gekr.fsf@gmail.com> Date: Sun, 20 Jul 2025 09:47:08 +0300 Message-ID: <87v7nnjqnv.fsf@mail.linkov.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79046 Cc: 79046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > When editing multiple buffers the `tab-line-tab-modified` face (which > indicates that a buffer has been modified and not saved) is sometimes > barely visible or hard to distinguish from the tab line. > > This patch changes the appearance of the close button icon when the > buffer has been modified, similar to other editors. Thanks, I tried it out, and it looks nice. > The patch is not yet finished, this feature is currently "hardcoded" > (the only way to disable this is removing `tab-line-tab-face-modified` > from `tab-line-tab-face-functions`). > > I would like any suggestion, if should this have an option for disable > this. There is an option `tab-line-tab-name-format-function`, but it would be too cumbersome for users to override the whole `tab-line-tab-name-format-default` to be able to disable only the close button. Maybe it would be ok for users to customize the icon with M-x customize-icon RET tab-line-close-modified RET and copy attributes from `tab-line-close-button`. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 31 00:20:17 2025 Received: (at 79046) by debbugs.gnu.org; 31 Jul 2025 04:20:17 +0000 Received: from localhost ([127.0.0.1]:44943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uhKm8-0001L6-NW for submit@debbugs.gnu.org; Thu, 31 Jul 2025 00:20:17 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:58840) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uhKm5-0001IS-Nh for 79046@debbugs.gnu.org; Thu, 31 Jul 2025 00:20:14 -0400 Received: by mail-ot1-x342.google.com with SMTP id 46e09a7af769-7416d362e7aso342381a34.1 for <79046@debbugs.gnu.org>; Wed, 30 Jul 2025 21:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753935607; x=1754540407; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=HQcE5/kUyqrlBHurJkX/s5AQcZrtz5PcqRLUCBdQmck=; b=XMLwdi/oEpgoSJVPEB4DX+My+F4YcG/FiYIBD/4loH4Le7tTOepZEpslR0Oqf2vabA vLS8LivPibwoe4H7XIW/pWWNOwR8Gs7GE3BG4b9OzK/riw99o1LJ+X7HWSKaa48/VyRs 2xy63ilzZRwV+1f8thKaukpWt6zPGCAgscDIEPvgmpu1Odyi0ASfOUmbdUJIyyxwWLt4 c+1MI0kGdcpVxxoKaJrA7DOGM3SAV/Q2gvVFsqPePxh7BQHjn2moqKQzDPvvv6fZ6Xfw wwAx0jgz+/svkzY3fdUTquqx4zbtvFBzBKajgBIG370ZJ6lrDWGxbi51aVAY2/EyJVz/ ElEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753935607; x=1754540407; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HQcE5/kUyqrlBHurJkX/s5AQcZrtz5PcqRLUCBdQmck=; b=q8tmq1Tl9/nbzTxiXsOPASVgBJZLPARSwUSVNLWsy8Pa2gGTUF3lmUQIc7z9Sn+OhO 6vMmfad71ebcC40opUDLqzRhR/GC+KHbfeY33isc6FlnZ0L0F8EZ91FTF+95j9calTVc Qd/+5Crve81sqgOWYkDPTGD/foq3HcyXh4YheTM73PZy+CKBcBjhGPUhl5TaLpi7h1sM G4X4f581zWXtsxAz54w+5zFDNFU9LhVYpoKRke0oLHkE1TIyba6l5KCF3xzLwG02JoiT BC2ODT4Y1XIvZveECxh718L6QfXbs3l3SlRD0mSSKu5BwLwWgCPGgvHpGktwws0ktlIC 0Evg== X-Gm-Message-State: AOJu0YyEYAy0yVvorpOkOaz2ehU2xFDtrej4vLe2cFwwg88YWBdPJwva KiMw7EM3oONrJtOjgLDptpXh6LRc4+/r20qBGEc4afKRMGNnOi6eNAAXkY5t45I1 X-Gm-Gg: ASbGnctaP3/ItRHwKFT3VyUbQB6C+JtOk7AMMrpJKWW91iG7pjRRQskWZbdacujPFZF +pEmXXO1udvfa+k7MDZlOfZRvQm0CHNuRXajboCuhDDb3qfa18GR8rf4SXrRtr0Mxp9x2UOAGMN mNJ4MXFFdAHNsyhsCwx8Tfi846cBlKEkHiZT+AmrILowDac4exYr/O8Yet10SnnLqifEzVD4r06 TRhbzvMEXUCcn+lLTZ/pPtUTrI/CFfIHGdsgCOTaxKcS2I1l++gJl1VlZ0+TjCgnY4kR5Mc1/Te kzHvTk6BPEk+gnwgPpF1pLCKEAdY4j7i1Pg6qoH4+THOULxiOgOv+ym1McrkwTPGDzuAGZ1wCDc p0NZCUfb/tUXehQo= X-Google-Smtp-Source: AGHT+IH/cfKFVkk/Z3yhKbgcD4OvtOiiZDecr7VMFdbyENw8OS9WMEdmA+gvsujUwlKfapSoNwBCqQ== X-Received: by 2002:a05:6830:314f:b0:741:7901:af7b with SMTP id 46e09a7af769-7417901bce6mr4281123a34.10.1753935607343; Wed, 30 Jul 2025 21:20:07 -0700 (PDT) Received: from fedora ([189.215.162.117]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-74186daca3asm156279a34.48.2025.07.30.21.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jul 2025 21:20:06 -0700 (PDT) From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= To: Juri Linkov Subject: Re: bug#79046: (WIP) [PATCH] tab-line: Change close button appearance for modified tabs In-Reply-To: <87v7nnjqnv.fsf@mail.linkov.net> References: <87tt39gekr.fsf@gmail.com> <87v7nnjqnv.fsf@mail.linkov.net> Date: Wed, 30 Jul 2025 22:20:03 -0600 Message-ID: <877bzp0z64.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 79046 Cc: 79046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Juri Linkov writes: [ Sorry i forgot to reply. ] >> The patch is not yet finished, this feature is currently "hardcoded" >> (the only way to disable this is removing `tab-line-tab-face-modified` >> from `tab-line-tab-face-functions`). >> >> I would like any suggestion, if should this have an option for disable >> this. > There is an option `tab-line-tab-name-format-function`, > but it would be too cumbersome for users to override the > whole `tab-line-tab-name-format-default` to be able to > disable only the close button. Indeed. I've added an option for allow disable this. > Maybe it would be ok for users to customize the icon with > > M-x customize-icon RET tab-line-close-modified RET > > and copy attributes from `tab-line-close-button`. AFAIK the icon should be customizable. I'm sending here the finished version of the patch: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-tab-line-Add-close-button-for-modified-tabs-bug-7904.patch Content-Transfer-Encoding: quoted-printable >From 7d09ad27594bf5d1c5df42a5f7af3ea5f664674f Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?El=3DC3=3DADas=3D20Gabriel=3D20P=3DC3=3DA9rez?=3D Date: Sat, 12 Jul 2025 13:16:50 -0600 Subject: [PATCH] tab-line: Add close button for modified tabs (bug#79046) * etc/NEWS: Announce changes. * etc/images/tabs/close-modified.xpm: New image. * etc/images/tabs/README (Files): Add button icon name to README. * lisp/tab-line.el (tab-line-close-modified-button-show): New user option. (tab-line-close-modified): Define new icon. (tab-line-close-modified-button): New variable. (tab-line-tab-modified-p): New function. (tab-line-tab-name-format-default): Rework. (tab-line-tab-face-modified): Use 'tab-line-tab-modified-p'. --- etc/NEWS | 5 ++++ etc/images/tabs/README | 4 +++ etc/images/tabs/close-modified.xpm | 16 +++++++++++ lisp/tab-line.el | 46 +++++++++++++++++++++++++++--- 4 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 etc/images/tabs/close-modified.xpm diff --git a/etc/NEWS b/etc/NEWS index b5349d39000..957ec9f875d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -418,6 +418,11 @@ This user option controls where 'tab-line-mode' should= not be enabled in a buffer. The value must be a condition which is passed to 'buffer-match-p'. =20 +--- +*** New user option 'tab-line-close-modified-button-show' +This user option, if non-nil (the default), the tab close button will +change its appearance whether the tab buffer has been modified. + ** Project =20 --- diff --git a/etc/images/tabs/README b/etc/images/tabs/README index c3bab00d56c..2a68577951f 100644 --- a/etc/images/tabs/README +++ b/etc/images/tabs/README @@ -4,5 +4,9 @@ COPYRIGHT AND LICENSE INFORMATION FOR IMAGE FILES =20 Files: close.xpm new.xpm left-arrow.xpm right-arrow.xpm Author: Juri Linkov + +Files: close-modified.xpm +Author: El=C3=ADas Gabriel P=C3=A9rez + Copyright (C) 2019-2025 Free Software Foundation, Inc. License: GNU General Public License version 3 or later (see COPYING) diff --git a/etc/images/tabs/close-modified.xpm b/etc/images/tabs/close-mod= ified.xpm new file mode 100644 index 00000000000..44b45d49011 --- /dev/null +++ b/etc/images/tabs/close-modified.xpm @@ -0,0 +1,16 @@ +/* XPM */ +static char *dummy[]=3D{ +"9 9 4 1", +". c None", +"b c #000000", +"a c #808080", +"# c #bfbfbf", +"..#####..", +".#######.", +"###aaa###", +"##abbba##", +"##abbba##", +"##abbba##", +"###aaa###", +".#######.", +"..#####.."}; diff --git a/lisp/tab-line.el b/lisp/tab-line.el index b93aef2dd53..c2d051835fb 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -251,6 +251,36 @@ tab-line-close-button 'help-echo "Click to close tab") "Button for closing the clicked tab.") =20 +(defcustom tab-line-close-modified-button-show t + "If non-nil, the close button appearance will change when its buffer is = modified." + :type 'boolean + :initialize 'custom-initialize-default + :set (lambda (sym val) + (set-default sym val) + (force-mode-line-update t)) + :group 'tab-line + :version "31.1") + +(define-icon tab-line-close-modified nil + `((image "symbols/dot_medium_16.svg" "tabs/close-modified.xpm" + :face shadow + :height (1 . em) + :margin (2 . 0) + :ascent center) + (symbol ,(concat " " [#x2022])) ; bullet + (text " *")) + "Icon for closing the clicked tab when tab is modified." + :version "31.1" + :help-echo "Click to close tab") + +(defvar tab-line-close-modified-button + (propertize (icon-string 'tab-line-close-modified) + 'rear-nonsticky nil + 'keymap tab-line-tab-close-map + 'mouse-face 'tab-line-close-highlight + 'help-echo "Click to close tab") + "Button for closing the clicked tab when tab is modified.") + (define-icon tab-line-left nil `((image "symbols/chevron_left_16.svg" "tabs/left-arrow.xpm" :face shadow @@ -387,6 +417,12 @@ tab-line-tabs-mode-buffers (derived-mode-p mode))) (funcall tab-line-tabs-buffer-list-function))= ))) =20 +(defun tab-line-tab-modified-p (tab buffer-p) + "Return t if TAB is modified." + (let ((buffer (if buffer-p tab (cdr (assq 'buffer tab))))) + (when (and buffer (buffer-file-name buffer) (buffer-modified-p buffer)) + t))) + (defcustom tab-line-tabs-buffer-group-function #'tab-line-tabs-buffer-group-by-mode "Function to add a buffer to the appropriate group of tabs. @@ -619,7 +655,10 @@ tab-line-tab-name-format-default (not (eq tab-line-close-button-sh= ow (if selected-p 'non-sele= cted 'selected))) - tab-line-close-button) + (if (and tab-line-close-modified-= button-show + (tab-line-tab-modified-p= tab buffer-p)) + tab-line-close-modified-button + tab-line-close-button)) ""))) (setq close (copy-sequence close)) ;; Don't overwrite the icon face @@ -687,9 +726,8 @@ tab-line-tab-face-modified When TAB is a modified, file-backed buffer, make FACE inherit from `tab-line-tab-modified'. For use in `tab-line-tab-face-functions'." - (let ((buffer (if buffer-p tab (cdr (assq 'buffer tab))))) - (when (and buffer (buffer-file-name buffer) (buffer-modified-p buffer)) - (setf face `(:inherit (tab-line-tab-modified ,face))))) + (when (tab-line-tab-modified-p tab buffer-p) + (setf face `(:inherit (tab-line-tab-modified ,face)))) face) =20 (defun tab-line-tab-face-group (tab _tabs face _buffer-p _selected-p) --=20 2.50.1 --=-=-= Content-Type: text/plain -- - E.G via Gnus and Org. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 31 14:37:47 2025 Received: (at 79046) by debbugs.gnu.org; 31 Jul 2025 18:37:47 +0000 Received: from localhost ([127.0.0.1]:49834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uhY9z-0003Ge-2Z for submit@debbugs.gnu.org; Thu, 31 Jul 2025 14:37:47 -0400 Received: from mout-y-111.mailbox.org ([91.198.250.236]:53276) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uhY9w-0003Fz-95; Thu, 31 Jul 2025 14:37:45 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-y-111.mailbox.org (Postfix) with ESMTPS id 4btHrJ0Srpz9xwZ; Thu, 31 Jul 2025 20:37:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; t=1753987056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=G+3Bkyeu2nZ5QoeO9hfwyd9tUG+QP7npbUWJM8Z/HEc=; b=HwdVo3AdOKMaXxD3p3FFuzKm4wWgPonXjL9xrjqLW0EcmqOnb1puS+dk8G/JYv+VW1vtO/ iuyWGA3AoSXPFnd3XLhj2bNbY/AgXJ1oN9xX+NKFEC/KlMOTK32j3LQwd4/IGUpuePC/9m 6EIN2DlkvXP7e7OYnKNisJZnpjINPh2WvhxNv0uCMrnjR3hkLehpShQK7nGLUzRB/8we6t cr0/EvihVrHE4nct5Gb/kH6VlnKPe0cw+wauJbYhXyEzDedBdvu6ZyUOOPiZk4uo3VFVNu ILlV7mVf0KF0TBAISGdA+KaLGfn8Gu8u+eqERAlacCFO08LZ7wS7dgrjL8LCoQ== From: Juri Linkov To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= Subject: Re: bug#79046: (WIP) [PATCH] tab-line: Change close button appearance for modified tabs In-Reply-To: <877bzp0z64.fsf@gmail.com> Organization: LINKOV.NET References: <87tt39gekr.fsf@gmail.com> <87v7nnjqnv.fsf@mail.linkov.net> <877bzp0z64.fsf@gmail.com> Date: Thu, 31 Jul 2025 21:36:33 +0300 Message-ID: <87h5ys5hse.fsf@mail.linkov.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79046 Cc: 79046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 79046 31.0.50 thanks > I'm sending here the finished version of the patch: Thanks for the nice feature, now pushed. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 31 14:48:45 2025 Received: (at 79046) by debbugs.gnu.org; 31 Jul 2025 18:48:45 +0000 Received: from localhost ([127.0.0.1]:49877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uhYKa-0006l5-TM for submit@debbugs.gnu.org; Thu, 31 Jul 2025 14:48:45 -0400 Received: from mout-y-111.mailbox.org ([91.198.250.236]:54870) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uhYKX-0006kX-PV for 79046@debbugs.gnu.org; Thu, 31 Jul 2025 14:48:42 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-y-111.mailbox.org (Postfix) with ESMTPS id 4btJ4x1JlGz9xwV; Thu, 31 Jul 2025 20:48:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; t=1753987713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xPjz9IhxI+P0+Z+YZnrsgPAPAbdEa8Eml78uuSsh6tc=; b=uTAYIAhQ1BXf7r650Jjvxi9tBafEED7G5BynaVcyoQOzuGK1wpgEy28+aJGVfXxZcfvPha twFK8qg6feGRsUMxubNKEMusKTTadkMkiJ80+WMp4eYLzzbUFYFW9v84pioz9b61fN6gAZ DQeJUNR6viUhZGACV9VKLUX9bOwT81INX4pvvaRqJRm2yrCBMaUbbygzSDLtrrP+J9cGb3 ZenHhWHauObRguuBsXXYLxWpUjfrvggcpu9v8ju0werBPuhCEiCHNn5a0Xib+mC0T6bWw/ a07BAXtoV5QWyQNy7mEyhg0CoTIoJzcApg+0Re/xCRSG6eNSERPyPufE/8amlw== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of juri@linkov.net designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=juri@linkov.net From: Juri Linkov To: Elijah Gabe =?iso-8859-1?Q?P=E9rez?= Subject: Re: bug#79046: (WIP) [PATCH] tab-line: Change close button appearance for modified tabs In-Reply-To: <87h5ys5hse.fsf@mail.linkov.net> Organization: LINKOV.NET References: <87tt39gekr.fsf@gmail.com> <87v7nnjqnv.fsf@mail.linkov.net> <877bzp0z64.fsf@gmail.com> <87h5ys5hse.fsf@mail.linkov.net> Date: Thu, 31 Jul 2025 21:47:45 +0300 Message-ID: <87pldgtcxa.fsf@mail.linkov.net> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 4btJ4x1JlGz9xwV X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79046 Cc: 79046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Thanks for the nice feature, now pushed. Oh, it also required this patch, also pushed: diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 5e33064b5b1..51675dbbb29 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -762,8 +762,9 @@ tab-line-cache-key-default ;; for setting face 'tab-line-tab-current' (mode-line-window-selected-p) ;; for `tab-line-tab-face-modified' - (and (memq 'tab-line-tab-face-modified - tab-line-tab-face-functions) + (and (or tab-line-close-modified-button-show + (memq 'tab-line-tab-face-modified + tab-line-tab-face-functions)) (buffer-file-name) (buffer-modified-p))))