From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#66678: 30.0.50; Tabs close erratically in text terminal Date: Sun, 22 Oct 2023 20:42:14 +0300 Organization: LINKOV.NET Message-ID: <86edhmv9jd.fsf@mail.linkov.net> References: <87edhmx5qr.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36788"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 66678@debbugs.gnu.org To: Petteri Hintsanen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 22 19:44:52 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qucVO-0009T0-Q1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Oct 2023 19:44:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qucV9-0004Dc-Pd; Sun, 22 Oct 2023 13:44:35 -0400 Original-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 1qucV8-0004Cs-6b for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 13:44:34 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qucV7-0003bi-Tm for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 13:44:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qucVa-0003HE-CH for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 13:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Oct 2023 17:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66678 X-GNU-PR-Package: emacs Original-Received: via spool by 66678-submit@debbugs.gnu.org id=B66678.169799668312527 (code B ref 66678); Sun, 22 Oct 2023 17:45:02 +0000 Original-Received: (at 66678) by debbugs.gnu.org; 22 Oct 2023 17:44:43 +0000 Original-Received: from localhost ([127.0.0.1]:48025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qucVH-0003Fy-AJ for submit@debbugs.gnu.org; Sun, 22 Oct 2023 13:44:43 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:36477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qucVB-0003Fc-HS; Sun, 22 Oct 2023 13:44:42 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 5164860005; Sun, 22 Oct 2023 17:44:00 +0000 (UTC) In-Reply-To: <87edhmx5qr.fsf@iki.fi> (Petteri Hintsanen's message of "Sun, 22 Oct 2023 14:21:16 +0300") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272989 Archived-At: close 66678 29.1.90 thanks > - Create a new tab by clicking on "+" on the tab bar. > Now you should have two tabs named `*scratch*' > - Click on the first (leftmost) tab right after the second asterisk. > > Expected behavior: Leftmost tab is selected. > Actual behavior: Leftmost tab is closed. > > I traced the issue to `tab-bar-auto-width' function which — I think — is > used to pad a tab text with spaces to make it have a uniform width > within the tab bar. The function erroneously copies 'close-tab text > property from the close button text (tab-bar-close-button) and positions > it right after the buffer name, causing the said behavior. > > The attached patch fixes the immediate issue, but I doubt if it is > sufficient, given that there is similar close tab-related logic elsewhere > in the code. Another workaround is to set `tab-bar-close-button' to one > character string "x" instead of " x". Thank you for finding this subtle bug and fixing it. The space before "x" was intended to give more space to click on the close button, i.e. for more wider clicking area. So better to keep the 'close-tab' text property on the space. This means that your patch is the right way to fix this. Now it's pushed to the emacs-29 branch as well as separately to master to avoid merge conflicts.