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#41343: tab-bar-mode: Close tab on mouse-2 click Date: Thu, 12 Aug 2021 11:09:35 +0300 Organization: LINKOV.NET Message-ID: <87bl6384ow.fsf@mail.linkov.net> References: <87wnp2cg52.fsf@linkov.net> <83tuk5la2u.fsf@gnu.org> <877dh18lj3.fsf@mail.linkov.net> <83y29gjvjh.fsf@gnu.org> <8735rn8jz6.fsf@mail.linkov.net> <83sfznhywm.fsf@gnu.org> <87tuk356ia.fsf@mail.linkov.net> <83im0iiw8n.fsf@gnu.org> <877dgvkt1z.fsf@mail.linkov.net> <83wnotfpak.fsf@gnu.org> <87k0ksecbq.fsf@mail.linkov.net> <83v94cdwk5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34306"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 12 10:16:16 2021 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 1mE5sq-0008iq-RX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 10:16:12 +0200 Original-Received: from localhost ([::1]:54872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mE5so-0007Mr-R2 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 04:16:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mE5sg-0007Io-3T for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 04:16:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54122) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mE5sf-0007Yx-SS for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 04:16:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mE5sf-0007wh-Jx for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 04:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Aug 2021 08:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162875610630447 (code B ref 41343); Thu, 12 Aug 2021 08:16:01 +0000 Original-Received: (at 41343) by debbugs.gnu.org; 12 Aug 2021 08:15:06 +0000 Original-Received: from localhost ([127.0.0.1]:37432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE5rm-0007v0-0M for submit@debbugs.gnu.org; Thu, 12 Aug 2021 04:15:06 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:35607) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE5rk-0007u0-JJ for 41343@debbugs.gnu.org; Thu, 12 Aug 2021 04:15:04 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id B71006000C; Thu, 12 Aug 2021 08:14:57 +0000 (UTC) In-Reply-To: <83v94cdwk5.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Aug 2021 14:56:26 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:211649 Archived-At: >> There is the need to apply an additional patch below, >> because the tab symbol is carried by the event in its >> OBJECT slot, but some functions expect that the OBJECT >> slot should contain only (STRING . STRING-POS) > > That expectation is according to the documented behavior, so it is > correct. I don't quite understand why you need to break the contract > here. Can you elaborate where do the deviant values come and why they > must have a different value form? Events emitted on the tab-line contain the tab caption with text properties that help to identify the clicked tab: (# tab-line (30 . 10) 29999999 (#(" buffer.el x" 1 10 (tab #)) . 4) The tab-bar could do the same, but how to support existing code that doesn't add text properties to the tab-bar tab captions in the tab-bar-format function? This means that text properties identifying the clicked tab should be added to the tab caption only after clicking in the emitted event. But then the problem that the added text properties might conflict with the existing text properties added in the tab-bar-format function. For example, the tab-bar-format function puts the text property 'close-tab' on the close button. If the emitted event will add another property with the same name 'close-tab' to indicate whether the close button was clicked, it might overwrite the existing text property on the tab caption. Maybe then add the property only on the first character, on the assumption that it would be less likely to overwrite the existing property. IOW, with the existing event format, the only way to add event metadata is to stuff more text properties on the tab caption that already contains some text properties, such as tab face, and properties denoting the close button. But how to do this in a non-conflicting way?