From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 May 2020 04:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 41343@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158968833929721 (code B ref -1); Sun, 17 May 2020 04:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 May 2020 04:05:39 +0000 Received: from localhost ([127.0.0.1]:42040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaAYU-0007jJ-SA for submit@debbugs.gnu.org; Sun, 17 May 2020 00:05:39 -0400 Received: from lists.gnu.org ([209.51.188.17]:54752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaAYU-0007jC-42 for submit@debbugs.gnu.org; Sun, 17 May 2020 00:05:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaAYT-0004e3-W0 for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 00:05:38 -0400 Received: from mail-yb1-xb2c.google.com ([2607:f8b0:4864:20::b2c]:40895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaAYT-0003qV-7y for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 00:05:37 -0400 Received: by mail-yb1-xb2c.google.com with SMTP id c2so3399120ybi.7 for ; Sat, 16 May 2020 21:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:date:message-id:subject:to; bh=N1ktfbg9GFPUX5o3rMdhOEIdbyxVcScqXafvEvlfxPA=; b=Od9SNuJZBlOMqgUHMrNBD4JQQjX3Z0y5gqNXnuKpMJMHOWQtUvq8PS1tGEuRXeicA4 LCYnIkJAw5XjXDlvjSXOflLTIkiCGat5bVywZdvQ/deXZLffaF8ELEMFjxOktQrUSysO vvyytOhouVnVO+AoB18lprqgJShoEiERcy+rAM5WUY9gGkFcp4044Z4Y7ZrZI6kEnLc+ NhQaZ50T9ZgUuE2ykoOhDR9iMHCp/lsiQHAfMED95MST4dbZV/q7MJMxkjxnGACRc0p1 g8Kx1CncZwxtkUH5+uMVru9fGTtjNziYswTwgTxiT1JBsvDyYGzptHBf+0sNdz6DOIUw skmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=N1ktfbg9GFPUX5o3rMdhOEIdbyxVcScqXafvEvlfxPA=; b=kegiHAGmUPnwHvB2luOcsZgie778ZrFww5TnEHqg2j29Q5PaqYvKYYGzYbY8zPwq7t j6oOoDZ2VY7W8mQq3lU3X+JOkxBnXXVikqYyrTLzexOo/G1Zmct+wjn/lkXREDc64M+D ANTtf+eY+KdGKTgNGMK9kD01PCBj95ML14hpIqwDQPHYvDj/7JtdqfGaUgR4z5sTtA8K dVunQn155Ubtw/jzWg6FdcwRDByhB8VBHuLOP63pGogHS49RgAknYz8RcP97v33S1VVA ETb3oUV6+k3l0W/wj9ZZi+x1u4rpmGNGPXPsseOpX3EoAsMUVaN6V8vNIkhMUrdP/2Pz ne9w== X-Gm-Message-State: AOAM531MLLIDGaNyfj0NQqArOUvrv9OfoDc7VFDn40pLavCcYmjgK1Tw vcp/YdNz0NPk3eovTH4cMvui+mUBLxxDFH47+tTlCA== X-Google-Smtp-Source: ABdhPJzfursSvx2uIKDuWZsmZCNli+WmpemJc1AInzPHtGPDVLxWGPMlQHqEaVWaxFlswRt9FFu2OxcJLI9t2JJ5sRc= X-Received: by 2002:a25:ad4c:: with SMTP id l12mr16450334ybe.389.1589688335881; Sat, 16 May 2020 21:05:35 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 16 May 2020 21:05:35 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Sat, 16 May 2020 21:05:35 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::b2c; envelope-from=stefankangas@gmail.com; helo=mail-yb1-xb2c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 0.7 (/) 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: -2.3 (--) Severity: wishlist Please consider adding a binding to close a tab in tab-bar-mode by clicking on it using the middle mouse button (mouse-2). Best regards, Stefan Kangas From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 May 2020 22:15:04 +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: To: Stefan Kangas Cc: 41343@debbugs.gnu.org Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.158975369722890 (code B ref 41343); Sun, 17 May 2020 22:15:04 +0000 Received: (at 41343) by debbugs.gnu.org; 17 May 2020 22:14:57 +0000 Received: from localhost ([127.0.0.1]:45002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaRYf-0005x3-GG for submit@debbugs.gnu.org; Sun, 17 May 2020 18:14:57 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:46605) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaRYc-0005wO-NQ for 41343@debbugs.gnu.org; Sun, 17 May 2020 18:14:55 -0400 X-Originating-IP: 91.129.104.245 Received: from mail.gandi.net (m91-129-104-245.cust.tele2.ee [91.129.104.245]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id B0AC11C0002; Sun, 17 May 2020 22:14:48 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: Date: Mon, 18 May 2020 01:12:08 +0300 In-Reply-To: (Stefan Kangas's message of "Sat, 16 May 2020 21:05:35 -0700") Message-ID: <87imgugqiv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) > Please consider adding a binding to close a tab in tab-bar-mode by > clicking on it using the middle mouse button (mouse-2). Like in bug#41342, when someone will find a way to emit the event on the tab-bar, I'll immediately bind it to the tab closing command. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 May 2020 22:24:02 +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: To: Juri Linkov Cc: 41343@debbugs.gnu.org Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.158975424124173 (code B ref 41343); Sun, 17 May 2020 22:24:02 +0000 Received: (at 41343) by debbugs.gnu.org; 17 May 2020 22:24:01 +0000 Received: from localhost ([127.0.0.1]:45027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaRhR-0006Ho-GJ for submit@debbugs.gnu.org; Sun, 17 May 2020 18:24:01 -0400 Received: from mail-yb1-f174.google.com ([209.85.219.174]:40599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaRhQ-0006H8-7v for 41343@debbugs.gnu.org; Sun, 17 May 2020 18:24:00 -0400 Received: by mail-yb1-f174.google.com with SMTP id c2so4307370ybi.7 for <41343@debbugs.gnu.org>; Sun, 17 May 2020 15:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :cc; bh=AgeRuTQABaHZdGv07d97CVGgG0utAvaBzk1Pg/3DZ38=; b=mgBf+pgYgSwT7blSAAQIDCpWOdj/YbTb7Flknz16MPF9YfPocjvYEfAf+f5kxpokNC hX2ygLkveF4mEJgv37eQm/+eN4HkIlhKBvHwjEwNP6oPNigB68qPi2TIbU0IA1LCLcCP u+L15XS+9bj7AkfJbDWYRHlJaXVjrCklk4ogLeh4QIkUBi+v9lFCo5K/pvvpG4eF5L3m T2Np+3Q21Zd93IAxJQ0maXK5E+UkXq1LMINIMFgXEhm4mq+aAXf4EfpAz/nkgGQ5lq9c +9P5GHjzbyKT/d9YqTeV5jVsicV8uyVCBJi30Yc0oLyRpJ0zodRCS5TXl+Qno+xRCBLV MhIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=AgeRuTQABaHZdGv07d97CVGgG0utAvaBzk1Pg/3DZ38=; b=F1N4+kNrjGXQ14xHXwqdt6apQtUrPG8CttaDImtIfLXyayQLT1FGQHiz0Q+HWSMU1C pRIhyhR3cEO+VvjZ21s84mQy1tOVQk/E1uck5mKtPdMQTSWqefIqmsta8XKR9bCxpp0b ZFsjSnSSDsfKXHwLaAkN/71ANA/BZwf+jDD5jq/anhEbqwhKL6pzKp9n34kXKU/U1bHS +KgjIfqQ51wP9DBmRYW+45Dnw5AuLuT4n2bDP2PY0q5UF+0eK5/YTYAQKHtKDlljBTQr tJxJt6ZPZUivckw+F7VPaLTCVXxUBUEFYdPEfyhXbipyciNNrSfvlLYc2CFncrfQqbDM UfYQ== X-Gm-Message-State: AOAM533NZRnh6LeO4+dTJPODncit6E0QBijSTA65UudUxhPzmFv3XOdX Mmw/gupCxyEviEz5Gt1xUxM05wri4cbf96+OJEuHTg== X-Google-Smtp-Source: ABdhPJwh9DAY+xN0fU4fnEnAcujmLbYxBCs7SM1+nXz1/mtmp8Tn/pOHMdbV9I4sxCT9Z59oCOcBD4JGM/aHXpDJFA4= X-Received: by 2002:a25:9304:: with SMTP id f4mr9915748ybo.309.1589754233673; Sun, 17 May 2020 15:23:53 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 17 May 2020 15:23:53 -0700 From: Stefan Kangas In-Reply-To: <87imgugqiv.fsf@mail.linkov.net> References: <87imgugqiv.fsf@mail.linkov.net> MIME-Version: 1.0 Date: Sun, 17 May 2020 15:23:53 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) 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.0 (-) Juri Linkov writes: > Like in bug#41342, when someone will find a way to emit the event > on the tab-bar, I'll immediately bind it to the tab closing command. Thanks! Best regards, Stefan Kangas From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 May 2020 02:34:02 +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: To: Juri Linkov Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.158976918831237 (code B ref 41343); Mon, 18 May 2020 02:34:02 +0000 Received: (at 41343) by debbugs.gnu.org; 18 May 2020 02:33:08 +0000 Received: from localhost ([127.0.0.1]:45248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaVaV-00087l-Q5 for submit@debbugs.gnu.org; Sun, 17 May 2020 22:33:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaVaU-00087P-Rg for 41343@debbugs.gnu.org; Sun, 17 May 2020 22:33:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47444) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaVaO-0007Hs-K0; Sun, 17 May 2020 22:33:00 -0400 Received: from [176.228.60.248] (port=3953 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jaVaN-0006Cp-UA; Sun, 17 May 2020 22:33:00 -0400 Date: Mon, 18 May 2020 05:32:52 +0300 Message-Id: <83pnb29dm3.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87imgugqiv.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 18 May 2020 01:12:08 +0300) References: <87imgugqiv.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Juri Linkov > Date: Mon, 18 May 2020 01:12:08 +0300 > Cc: 41343@debbugs.gnu.org > > > Please consider adding a binding to close a tab in tab-bar-mode by > > clicking on it using the middle mouse button (mouse-2). > > Like in bug#41342, when someone will find a way to emit the event > on the tab-bar, I'll immediately bind it to the tab closing command. What do you mean by "find a way"? What is the problem here? From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2020 22:26:04 +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: To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.158992712014823 (code B ref 41343); Tue, 19 May 2020 22:26:04 +0000 Received: (at 41343) by debbugs.gnu.org; 19 May 2020 22:25:20 +0000 Received: from localhost ([127.0.0.1]:51343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbAfo-0003r1-1W for submit@debbugs.gnu.org; Tue, 19 May 2020 18:25:20 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:48311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbAfk-0003qU-CV for 41343@debbugs.gnu.org; Tue, 19 May 2020 18:25:16 -0400 X-Originating-IP: 91.129.97.200 Received: from mail.gandi.net (m91-129-97-200.cust.tele2.ee [91.129.97.200]) (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 4BBC260006; Tue, 19 May 2020 22:25:08 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <87imgugqiv.fsf@mail.linkov.net> <83pnb29dm3.fsf@gnu.org> Date: Wed, 20 May 2020 00:54:15 +0300 In-Reply-To: <83pnb29dm3.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 18 May 2020 05:32:52 +0300") Message-ID: <87eerfd20o.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) >> > Please consider adding a binding to close a tab in tab-bar-mode by >> > clicking on it using the middle mouse button (mouse-2). >> >> Like in bug#41342, when someone will find a way to emit the event >> on the tab-bar, I'll immediately bind it to the tab closing command. > > What do you mean by "find a way"? What is the problem here? The problem is to figure out how to force clicking different mouse buttons to emit the corresponding mouse event. Currently clicking on the tab-line correctly emits such events, e.g.: but clicking any mouse button on the tab-bar emits events like: From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 May 2020 16:00:02 +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: To: Juri Linkov Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.158999036319783 (code B ref 41343); Wed, 20 May 2020 16:00:02 +0000 Received: (at 41343) by debbugs.gnu.org; 20 May 2020 15:59:23 +0000 Received: from localhost ([127.0.0.1]:54075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbR7r-000591-Iv for submit@debbugs.gnu.org; Wed, 20 May 2020 11:59:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbR7p-00058m-PA for 41343@debbugs.gnu.org; Wed, 20 May 2020 11:59:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51816) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbR7j-00027g-It; Wed, 20 May 2020 11:59:15 -0400 Received: from [176.228.60.248] (port=4000 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jbR7h-0006CV-Hv; Wed, 20 May 2020 11:59:14 -0400 Date: Wed, 20 May 2020 18:59:14 +0300 Message-Id: <837dx67g31.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87eerfd20o.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 20 May 2020 00:54:15 +0300) References: <87imgugqiv.fsf@mail.linkov.net> <83pnb29dm3.fsf@gnu.org> <87eerfd20o.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Juri Linkov > Cc: stefankangas@gmail.com, 41343@debbugs.gnu.org > Date: Wed, 20 May 2020 00:54:15 +0300 > > > What do you mean by "find a way"? What is the problem here? > > The problem is to figure out how to force clicking different > mouse buttons to emit the corresponding mouse event. Currently > clicking on the tab-line correctly emits such events, e.g.: > > > > > but clicking any mouse button on the tab-bar emits events like: > > > We could perhaps have a suitable redirect in function-key-map or one of the other translation keymaps? From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Aug 2021 22:37:02 +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: To: Stefan Kangas Cc: 41343@debbugs.gnu.org Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162803016232122 (code B ref 41343); Tue, 03 Aug 2021 22:37:02 +0000 Received: (at 41343) by debbugs.gnu.org; 3 Aug 2021 22:36:02 +0000 Received: from localhost ([127.0.0.1]:41721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mB30z-0008Lu-Vs for submit@debbugs.gnu.org; Tue, 03 Aug 2021 18:36:02 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:35345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mB30w-0008LY-Tk for 41343@debbugs.gnu.org; Tue, 03 Aug 2021 18:36:00 -0400 Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 4A1A9100003; Tue, 3 Aug 2021 22:35:50 +0000 (UTC) From: Juri Linkov References: Date: Wed, 04 Aug 2021 01:33:45 +0300 In-Reply-To: (Stefan Kangas's message of "Sat, 16 May 2020 21:05:35 -0700") Message-ID: <87wnp2cg52.fsf@linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) 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 (-) --=-=-= Content-Type: text/plain > Please consider adding a binding to close a tab in tab-bar-mode by > clicking on it using the middle mouse button (mouse-2). Here's the patch that implements mouse-2 tab closing: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=tab-close-mouse-2.patch diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 7660b217d2..ce4d18a0fa 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -229,7 +229,8 @@ tab-bar-handle-mouse This command is used when you click the mouse in the tab bar on a console which has no window system but does have a mouse." (interactive "e") - (let* ((x-position (car (posn-x-y (event-start event)))) + (let* ((button (event-basic-type event)) + (x-position (car (posn-x-y (event-start event)))) (keymap (lookup-key (cons 'keymap (nreverse (current-active-maps))) [tab-bar])) (column 0)) (when x-position @@ -238,7 +239,9 @@ tab-bar-handle-mouse (lambda (key binding) (when (eq (car-safe binding) 'menu-item) (when (> (+ column (length (nth 1 binding))) x-position) - (if (get-text-property (- x-position column) 'close-tab (nth 1 binding)) + (if (or (eq button 'mouse-2) + (get-text-property + (- x-position column) 'close-tab (nth 1 binding))) (let* ((close-key (vector (intern (format "C-%s" key)))) (close-def (lookup-key keymap close-key))) (when close-def @@ -768,7 +771,8 @@ tab-bar-format-list (defun tab-bar-make-keymap-1 () "Generate an actual keymap from `tab-bar-map', without caching." (append - '(keymap (mouse-1 . tab-bar-handle-mouse)) + '(keymap (mouse-1 . tab-bar-handle-mouse) + (mouse-2 . tab-bar-handle-mouse)) (tab-bar-format-list tab-bar-format))) diff --git a/src/dispextern.h b/src/dispextern.h index 33fcaa4c07..26112de0a9 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3416,7 +3416,7 @@ #define TTY_CAP_STRIKE_THROUGH 0x20 extern Lisp_Object find_hot_spot (Lisp_Object, int, int); extern void handle_tab_bar_click (struct frame *, - int, int, bool, int); + int, int, bool, int, int); extern void handle_tool_bar_click (struct frame *, int, int, bool, int); diff --git a/src/w32term.c b/src/w32term.c index ad4d1a3282..f53114a857 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -3691,10 +3691,11 @@ w32_handle_tab_bar_click (struct frame *f, struct input_event *button_event) int y = XFIXNAT (button_event->y); if (button_event->modifiers & down_modifier) - handle_tab_bar_click (f, x, y, 1, 0); + handle_tab_bar_click (f, x, y, 1, 0, button_event->code + 1); else handle_tab_bar_click (f, x, y, 0, - button_event->modifiers & ~up_modifier); + button_event->modifiers & ~up_modifier, + button_event->code + 1); } diff --git a/src/xdisp.c b/src/xdisp.c index 70d15aee68..9ca6234264 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13747,7 +13747,7 @@ get_tab_bar_item (struct frame *f, int x, int y, struct glyph **glyph, void handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, - int modifiers) + int modifiers, int button) { Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); struct window *w = XWINDOW (f->tab_bar_window); @@ -13793,7 +13793,7 @@ handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, event.kind = TAB_BAR_EVENT; event.frame_or_window = frame; event.arg = key; - event.modifiers = close_p ? ctrl_modifier | modifiers : modifiers; + event.modifiers = (close_p || button == 2) ? ctrl_modifier | modifiers : modifiers; kbd_buffer_store_event (&event); f->last_tab_bar_item = -1; } @@ -13962,6 +13962,8 @@ tty_handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, bool close_p = false; if ((x == clen - 1 || (clen > 1 && x == clen - 2)) && lastc == 'x') close_p = true; + if (event->code == 1) /* mouse-2 */ + close_p = true; event->code = 0; XSETFRAME (frame, f); diff --git a/src/xterm.c b/src/xterm.c index 1887c3255d..5a22bc31d4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9217,7 +9217,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (tab_bar_p && event->xbutton.button < 4) handle_tab_bar_click (f, x, y, event->xbutton.type == ButtonPress, - x_x_to_emacs_modifiers (dpyinfo, event->xbutton.state)); + x_x_to_emacs_modifiers (dpyinfo, event->xbutton.state), + event->xbutton.button); } #if ! defined (USE_GTK) --=-=-=-- From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Aug 2021 11:33: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: To: Juri Linkov Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162807673929455 (code B ref 41343); Wed, 04 Aug 2021 11:33:01 +0000 Received: (at 41343) by debbugs.gnu.org; 4 Aug 2021 11:32:19 +0000 Received: from localhost ([127.0.0.1]:42954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBF8F-0007ep-9E for submit@debbugs.gnu.org; Wed, 04 Aug 2021 07:32:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBF8E-0007aa-Le for 41343@debbugs.gnu.org; Wed, 04 Aug 2021 07:32:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55888) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBF88-00015U-Rh; Wed, 04 Aug 2021 07:32:12 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2975 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBF88-000723-9C; Wed, 04 Aug 2021 07:32:12 -0400 Date: Wed, 04 Aug 2021 14:32:09 +0300 Message-Id: <83tuk5la2u.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87wnp2cg52.fsf@linkov.net> (message from Juri Linkov on Wed, 04 Aug 2021 01:33:45 +0300) References: <87wnp2cg52.fsf@linkov.net> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Juri Linkov > Date: Wed, 04 Aug 2021 01:33:45 +0300 > Cc: 41343@debbugs.gnu.org > > > Please consider adding a binding to close a tab in tab-bar-mode by > > clicking on it using the middle mouse button (mouse-2). > > Here's the patch that implements mouse-2 tab closing: Do we really have to hard-code the mouse button this way, including explicit values in C? Why is that necessary or justified? From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Aug 2021 20:32:02 +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: To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.16281090794978 (code B ref 41343); Wed, 04 Aug 2021 20:32:02 +0000 Received: (at 41343) by debbugs.gnu.org; 4 Aug 2021 20:31:19 +0000 Received: from localhost ([127.0.0.1]:45247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBNXr-0001IE-Em for submit@debbugs.gnu.org; Wed, 04 Aug 2021 16:31:19 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:36753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBNXp-0001Hn-MN for 41343@debbugs.gnu.org; Wed, 04 Aug 2021 16:31:17 -0400 Received: (Authenticated sender: juri@linkov.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 7AB9C40008; Wed, 4 Aug 2021 20:31:10 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <87wnp2cg52.fsf@linkov.net> <83tuk5la2u.fsf@gnu.org> Date: Wed, 04 Aug 2021 23:13:12 +0300 In-Reply-To: <83tuk5la2u.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 04 Aug 2021 14:32:09 +0300") Message-ID: <877dh18lj3.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) >> > Please consider adding a binding to close a tab in tab-bar-mode by >> > clicking on it using the middle mouse button (mouse-2). >> >> Here's the patch that implements mouse-2 tab closing: > > Do we really have to hard-code the mouse button this way, including > explicit values in C? Why is that necessary or justified? In tab-line.el it was very easy to bind mouse-2 to close the tab: (defvar tab-line-tab-map (let ((map (make-sparse-keymap))) (define-key map [tab-line mouse-1] 'tab-line-select-tab) (define-key map [tab-line mouse-2] 'tab-line-close-tab) But it's impossible to do the same for the menu-bar and the tool-bar and so in the tab-bar too. There is no other way to bind mouse-2 to close the tab that would work in X, xterm, console, w32, w32term. Ot do you mean adding an integer variable that holds a number of the mouse button used to close the tab? For example, tab-bar-close-tab-mouse-button = 2. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Aug 2021 05:44:02 +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: To: Juri Linkov Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162814223925606 (code B ref 41343); Thu, 05 Aug 2021 05:44:02 +0000 Received: (at 41343) by debbugs.gnu.org; 5 Aug 2021 05:43:59 +0000 Received: from localhost ([127.0.0.1]:45631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWAh-0006ew-D1 for submit@debbugs.gnu.org; Thu, 05 Aug 2021 01:43:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBWAf-0006ek-FZ for 41343@debbugs.gnu.org; Thu, 05 Aug 2021 01:43:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55706) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBWAZ-00054l-87; Thu, 05 Aug 2021 01:43:51 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2881 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBWAY-0008LG-L6; Thu, 05 Aug 2021 01:43:51 -0400 Date: Thu, 05 Aug 2021 08:43:46 +0300 Message-Id: <83y29gjvjh.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <877dh18lj3.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 04 Aug 2021 23:13:12 +0300) References: <87wnp2cg52.fsf@linkov.net> <83tuk5la2u.fsf@gnu.org> <877dh18lj3.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Juri Linkov > Cc: stefankangas@gmail.com, 41343@debbugs.gnu.org > Date: Wed, 04 Aug 2021 23:13:12 +0300 > > > Do we really have to hard-code the mouse button this way, including > > explicit values in C? Why is that necessary or justified? > > In tab-line.el it was very easy to bind mouse-2 to close the tab: > > (defvar tab-line-tab-map > (let ((map (make-sparse-keymap))) > (define-key map [tab-line mouse-1] 'tab-line-select-tab) > (define-key map [tab-line mouse-2] 'tab-line-close-tab) > > But it's impossible to do the same for the menu-bar and the tool-bar > and so in the tab-bar too. Why not? What prevents that? > Ot do you mean adding an integer variable that holds > a number of the mouse button used to close the tab? > For example, tab-bar-close-tab-mouse-button = 2. I think we should explore such possibilities only after we understand why normal key bindings don't work. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Aug 2021 01:07:02 +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: To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162821198519181 (code B ref 41343); Fri, 06 Aug 2021 01:07:02 +0000 Received: (at 41343) by debbugs.gnu.org; 6 Aug 2021 01:06:25 +0000 Received: from localhost ([127.0.0.1]:48718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBoJd-0004zJ-KE for submit@debbugs.gnu.org; Thu, 05 Aug 2021 21:06:25 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:33465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBoJb-0004z5-Gc for 41343@debbugs.gnu.org; Thu, 05 Aug 2021 21:06:23 -0400 Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id BCAFB1BF205; Fri, 6 Aug 2021 01:06:16 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <87wnp2cg52.fsf@linkov.net> <83tuk5la2u.fsf@gnu.org> <877dh18lj3.fsf@mail.linkov.net> <83y29gjvjh.fsf@gnu.org> Date: Fri, 06 Aug 2021 03:41:17 +0300 In-Reply-To: <83y29gjvjh.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Aug 2021 08:43:46 +0300") Message-ID: <8735rn8jz6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) >> > Do we really have to hard-code the mouse button this way, including >> > explicit values in C? Why is that necessary or justified? >> >> In tab-line.el it was very easy to bind mouse-2 to close the tab: >> >> (defvar tab-line-tab-map >> (let ((map (make-sparse-keymap))) >> (define-key map [tab-line mouse-1] 'tab-line-select-tab) >> (define-key map [tab-line mouse-2] 'tab-line-close-tab) >> >> But it's impossible to do the same for the menu-bar and the tool-bar >> and so in the tab-bar too. > > Why not? What prevents that? It's too late to change how keys are implemented for tab-bar. The tab-bar keymap contains such keys as 'tab-1' and 'C-tab-2', and clicking mouse-1 on tabs emits such events. It doesn't emit 'mouse-1' and 'mouse-2'. >> Or do you mean adding an integer variable that holds >> a number of the mouse button used to close the tab? >> For example, tab-bar-close-tab-mouse-button = 2. > > I think we should explore such possibilities only after we understand > why normal key bindings don't work. It should be possible to implement normal key bindings mouse-1/mouse-2, but such change will not be backward-compatible. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Aug 2021 06:27:02 +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: To: Juri Linkov Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162823118617882 (code B ref 41343); Fri, 06 Aug 2021 06:27:02 +0000 Received: (at 41343) by debbugs.gnu.org; 6 Aug 2021 06:26:26 +0000 Received: from localhost ([127.0.0.1]:48940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBtJJ-0004eM-P0 for submit@debbugs.gnu.org; Fri, 06 Aug 2021 02:26:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBtJI-0004e9-2X for 41343@debbugs.gnu.org; Fri, 06 Aug 2021 02:26:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37988) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBtJC-0000pE-Cd; Fri, 06 Aug 2021 02:26:18 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3008 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBtJB-000365-Tn; Fri, 06 Aug 2021 02:26:18 -0400 Date: Fri, 06 Aug 2021 09:26:17 +0300 Message-Id: <83sfznhywm.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <8735rn8jz6.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 06 Aug 2021 03:41:17 +0300) References: <87wnp2cg52.fsf@linkov.net> <83tuk5la2u.fsf@gnu.org> <877dh18lj3.fsf@mail.linkov.net> <83y29gjvjh.fsf@gnu.org> <8735rn8jz6.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Juri Linkov > Cc: stefankangas@gmail.com, 41343@debbugs.gnu.org > Date: Fri, 06 Aug 2021 03:41:17 +0300 > > >> (defvar tab-line-tab-map > >> (let ((map (make-sparse-keymap))) > >> (define-key map [tab-line mouse-1] 'tab-line-select-tab) > >> (define-key map [tab-line mouse-2] 'tab-line-close-tab) > >> > >> But it's impossible to do the same for the menu-bar and the tool-bar > >> and so in the tab-bar too. > > > > Why not? What prevents that? > > It's too late to change how keys are implemented for tab-bar. > The tab-bar keymap contains such keys as 'tab-1' and 'C-tab-2', > and clicking mouse-1 on tabs emits such events. It doesn't emit > 'mouse-1' and 'mouse-2'. How do we translate mouse clicks into the likes of C-tab-2? And what prevents us from emitting something like tab-close-2 when mouse-2 is clicked? > >> Or do you mean adding an integer variable that holds > >> a number of the mouse button used to close the tab? > >> For example, tab-bar-close-tab-mouse-button = 2. > > > > I think we should explore such possibilities only after we understand > > why normal key bindings don't work. > > It should be possible to implement normal key bindings mouse-1/mouse-2, > but such change will not be backward-compatible. In what way will it be incompatible? From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Aug 2021 08:28: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: To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.16282384524660 (code B ref 41343); Fri, 06 Aug 2021 08:28:01 +0000 Received: (at 41343) by debbugs.gnu.org; 6 Aug 2021 08:27:32 +0000 Received: from localhost ([127.0.0.1]:49029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBvCV-0001D5-VU for submit@debbugs.gnu.org; Fri, 06 Aug 2021 04:27:32 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:58623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBvCU-0001Cq-C5 for 41343@debbugs.gnu.org; Fri, 06 Aug 2021 04:27:30 -0400 Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 8D6E8240008; Fri, 6 Aug 2021 08:27:21 +0000 (UTC) From: Juri Linkov Organization: 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> Date: Fri, 06 Aug 2021 11:20:29 +0300 In-Reply-To: <83sfznhywm.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Aug 2021 09:26:17 +0300") Message-ID: <87tuk356ia.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) >> It's too late to change how keys are implemented for tab-bar. >> The tab-bar keymap contains such keys as 'tab-1' and 'C-tab-2', >> and clicking mouse-1 on tabs emits such events. It doesn't emit >> 'mouse-1' and 'mouse-2'. > > How do we translate mouse clicks into the likes of C-tab-2? When mouse-1 is clicked on the close button, then the Control modifier 'C-' is added to the menu-item symbol tab-2 emitted as an event. > And what prevents us from emitting something like tab-close-2 when > mouse-2 is clicked? Then mouse-2 is still hard-coded and tab-close-2 is not much different from the previous patch that emits C-tab-2. Or in "tab-close-2" what does "2" mean: the button number 2 (mouse-2), or the tab number 2 (tab-2)? Should they then cover all combinations? tab-1-mouse-1, tab-1-mouse-2, tab-2-mouse-1, tab-2-mouse-2, ... >> It should be possible to implement normal key bindings mouse-1/mouse-2, >> but such change will not be backward-compatible. > > In what way will it be incompatible? Currently tab-bar-make-keymap returns a keymap with menu-items. This is like menu-bar is implemented. The menu-bar displays menu-items, and clicking on them emits events with their symbols. The tool-bar is implemented the same way: it displays menu-items, and clicking emits their symbols. The tab-bar is exactly the same: displays menu-items on the tab-bar, and clicking mouse-1 emits events with tab names, e.g. tab-2. Users already are using such add-advice that expect tab-bar-make-keymap returning a keymap with menu-items. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Aug 2021 12:39: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: To: Juri Linkov Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.16282535221440 (code B ref 41343); Fri, 06 Aug 2021 12:39:01 +0000 Received: (at 41343) by debbugs.gnu.org; 6 Aug 2021 12:38:42 +0000 Received: from localhost ([127.0.0.1]:49394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBz7a-0000N9-Fn for submit@debbugs.gnu.org; Fri, 06 Aug 2021 08:38:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBz7X-0000Mt-NW for 41343@debbugs.gnu.org; Fri, 06 Aug 2021 08:38:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44620) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBz7R-0008B7-Tx; Fri, 06 Aug 2021 08:38:33 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2227 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBz7R-0007Qu-GU; Fri, 06 Aug 2021 08:38:33 -0400 Date: Fri, 06 Aug 2021 15:38:32 +0300 Message-Id: <83im0iiw8n.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87tuk356ia.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 06 Aug 2021 11:20:29 +0300) 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> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Juri Linkov > Cc: stefankangas@gmail.com, 41343@debbugs.gnu.org > Date: Fri, 06 Aug 2021 11:20:29 +0300 > > >> It's too late to change how keys are implemented for tab-bar. > >> The tab-bar keymap contains such keys as 'tab-1' and 'C-tab-2', > >> and clicking mouse-1 on tabs emits such events. It doesn't emit > >> 'mouse-1' and 'mouse-2'. > > > > How do we translate mouse clicks into the likes of C-tab-2? > > When mouse-1 is clicked on the close button, then the > Control modifier 'C-' is added to the menu-item symbol tab-2 > emitted as an event. Are you talking about handle_tab_bar_click and the processing of TAB_BAR_EVENT in make_lispy_event? Or are there other/additional parts to this processing? IOW, where are the symbols like tab-2 produced? > > And what prevents us from emitting something like tab-close-2 when > > mouse-2 is clicked? > > Then mouse-2 is still hard-coded and tab-close-2 is not much different > from the previous patch that emits C-tab-2. > > Or in "tab-close-2" what does "2" mean: the button number 2 (mouse-2), > or the tab number 2 (tab-2)? > > Should they then cover all combinations? tab-1-mouse-1, > tab-1-mouse-2, tab-2-mouse-1, tab-2-mouse-2, ... I don't know, I don't think I have a clear idea of how these symbols are produced yet, and you didn't tell enough for me to get such a clear idea. Please tell more details, so that this discussion could be more efficient. > >> It should be possible to implement normal key bindings mouse-1/mouse-2, > >> but such change will not be backward-compatible. > > > > In what way will it be incompatible? > > Currently tab-bar-make-keymap returns a keymap with menu-items. > This is like menu-bar is implemented. The menu-bar displays > menu-items, and clicking on them emits events with their symbols. > The tool-bar is implemented the same way: it displays > menu-items, and clicking emits their symbols. > The tab-bar is exactly the same: displays menu-items > on the tab-bar, and clicking mouse-1 emits events > with tab names, e.g. tab-2. > > Users already are using such add-advice that expect > tab-bar-make-keymap returning a keymap with menu-items. If we find a way to produce a different symbol when mouse-2 is clicked on a tab, there will be no incompatibility, right? From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: [External] : bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Aug 2021 16:22:02 +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: To: Juri Linkov , Eli Zaretskii Cc: "41343@debbugs.gnu.org" <41343@debbugs.gnu.org>, "stefankangas@gmail.com" Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162826691324856 (code B ref 41343); Fri, 06 Aug 2021 16:22:02 +0000 Received: (at 41343) by debbugs.gnu.org; 6 Aug 2021 16:21:53 +0000 Received: from localhost ([127.0.0.1]:51216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mC2bY-0006Sq-Mj for submit@debbugs.gnu.org; Fri, 06 Aug 2021 12:21:52 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:48094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mC2bV-0006Sh-T3 for 41343@debbugs.gnu.org; Fri, 06 Aug 2021 12:21:51 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 176GHjoP001384; Fri, 6 Aug 2021 16:21:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=pnmdi1HxAaiintQUfeA4DTwTnjZJp1F3fMKj3+MbCE4=; b=VYd9klvWpS6gYDT1uh3W078NhtJX607zIGDxuvD/1PHIoDHK+sRDpHHEQapYsHtjVi8i 1k41aoV8yIgSWBDZhlxdpapr5jhxSlS5QVKxMUzJpp7VDJv+nc92aBTZqvFdOA3t9Um1 jYqeFaUO0lVBS+QfhsQl70bolIAvIUhOQTmUCOmxWvr0RcA2pvHIn6vv0eWtXWHBja5+ t00gANBKZszJwjv3Xke7KQhr2DX6R4UrmTTG3Db6IOfi6xKMO4pSHPi1Lfay2RQwIlKt znTLF11PljIJIvcCftj+JH3OcUE73qi+2cFLU0DN939nJ7s7N2CiOu5hGmCV+SNd/4X9 pQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=pnmdi1HxAaiintQUfeA4DTwTnjZJp1F3fMKj3+MbCE4=; b=NkMwJVQljnTUBnhpCdW6lajD4QkxJ3fhNSaaGX+H0kyZC+aoz2D6utDOyZTyYz+grQss gTjNLTQQy4nI6bnEucAG4+atzIssV28GBUC9aaxxBY0JNMYvdy13NTmnq1KLkMRuEWbI +N4K4rkgFlFxrkn1omWaMAyEjhRVIBuYOXwh2jv38ep+0FMEqRaYPVPkEyTqPfj40xHr qAnPeoqNDgc2oOqslfwPllzUrKiIAb7eZYX12lcbBNs6E96D7dLRb2GwRdNZPP1q8tEg iLDrtybEyylVWdUxkKlIBa7o1rrk0ich4qMy0xKih+PvcsqodqwZ3cNV6+pF0MRexCdd mg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3a9661rdat-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Aug 2021 16:21:49 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 176GGITS005420; Fri, 6 Aug 2021 16:21:48 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by aserp3030.oracle.com with ESMTP id 3a78darr04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Aug 2021 16:21:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=joA6Ckmb/ZP6yD+nEQ6c5P3SBtkA6mMYROxnPswxV6KdpdYa5oZnBns3a7g9skqld2c4c1rdAM0fItkDcZYrtbVma+obv0C+MIvIxbCsb9jIGRg0A/o7Rq1KSJzXO6A38RKD6vVcEDVs/VZFvZSh7VKCFUDlMf9AjOYxHjO/QhYj2Crr0PlGro+xN/q9w8QYDAtc80p75VEt2RyRpAUCgNQiarLegHaGLHK9x3HEYwb7gqBVHjq01HXU0CGd92O92GuF9Eqz0IdA7phMS1dp2MdDt2Znz1pSLGT2HQF6CW+DG5V0kZ/au9pwa4mXP132QEUJAA+x07KXv3xyZVyUOA== 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=pnmdi1HxAaiintQUfeA4DTwTnjZJp1F3fMKj3+MbCE4=; b=BMlYEtqs8L8juGimwXBPMYktrHojEs/UGMRAg0KBVxuxLuHdXjtROvqKUKc+il2WqN26fpRT9ZNn8olhT4G5O/CnkwwLo4jGW3x1JTXqcwGBDGfEk5Dhd23X5GyJyw0qFZI8NFgQ6KZOIh9MKlKxmhVeeC3cylTrsHD6CHYdvqD+6ncHjxDXB3gtIn1f9tV/FQtgh4eGLjmRlpMeYmcTHDiNP9sW3yrdxHzUz/PsgvbMKH2VMImt8UtQY5YbjvKpo1wsVjwrslKv/N0KbFn5lMCQsPM1OPYpZHW98vevtYrD+XFSNTYuUodHasv+tFLNlUruc9ie5/mvV7zG2/geMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pnmdi1HxAaiintQUfeA4DTwTnjZJp1F3fMKj3+MbCE4=; b=NtuTxmzv1YHol0kW5iQgh0S78sCIZMrxt0oDjwxLYbaj7MfhAb+2hPyijO3LGw4MNB94/1b22GEq98NdllR8eEGuZOlSdXzahmRc/9QitLF3FQODJz7TEtybWKNcFGbpX6vniHzrbqk1hO+q7kLQFMLH6fZlEkea3jMXZ+0sXEI= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BYAPR10MB3223.namprd10.prod.outlook.com (2603:10b6:a03:157::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.25; Fri, 6 Aug 2021 16:21:46 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::1d3c:d31b:8add:1958]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::1d3c:d31b:8add:1958%5]) with mapi id 15.20.4373.027; Fri, 6 Aug 2021 16:21:46 +0000 From: Drew Adams Thread-Topic: [External] : bug#41343: tab-bar-mode: Close tab on mouse-2 click Thread-Index: AQHXil9io1tS5keriUO+fLySjDARq6tmqKQQ Date: Fri, 6 Aug 2021 16:21:46 +0000 Message-ID: References: <87wnp2cg52.fsf@linkov.net> <83tuk5la2u.fsf@gnu.org> <877dh18lj3.fsf@mail.linkov.net> <83y29gjvjh.fsf@gnu.org> <8735rn8jz6.fsf@mail.linkov.net> In-Reply-To: <8735rn8jz6.fsf@mail.linkov.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linkov.net; dkim=none (message not signed) header.d=none;linkov.net; dmarc=none action=none header.from=oracle.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0b0b582e-c9c0-484f-18ce-08d958f64966 x-ms-traffictypediagnostic: BYAPR10MB3223: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4ii6G8kZ5hdOoh1HJy68d/Jyyk26SooqZTevVaRTU+1A7ttxN/3GLG1f3LPwevjMOYhxW45SDESXsxNOj7MkMkCN5nRLUrMZa5n++zNwYelQ8HbR4Q9+nroRMnrSFcXHo12CWTblm3NKSWGRn4b43dDa8QdeVNemJW1xQOTzew/PFWm3VivSEtkRsWvPv3/yzub90ORI8h8aEzj77x+yoXUdaHx69N4YJNUXvl5DEUFZb+dcil2fKSeaacLBTska3xq9tKSk1F85SLUQrfiwtrroaUpAzA1AdoBEpl/59sIHkS78xfXx7wlM154ih/hbehuxAL5edraryrTPvJ/xUPBvYH2qvB2uYOGyzLBJlSloASlwgkhccUKqJLe0jz0fkNkQHaJzcRsOniH5QtMHthLL5zyM+88Kh9UdZlr56K3xWMsvXH+jbafhEUOdeok+HC+n+Un4Z1qO71cMfL1vebVEzOUWilQjlR+elpab5UmLYRIBZfL6pWcD2oG8QN525poPjLgKgyfhnDseVZwbeIimdPU3VvLNFstRLouj5bQLhgoDZab99G5YO96OwiR4QTaakncuQv/7fk9coDEPt5xEtjwioEnQ7wlDZaHLlDsV6mm0OSO4hcnFb2kKYRXOyqKOPkWQ/S0wfBBrNySWwGMBDHWWgW79xjMIlB1WGbeRNLq2S36aQKt9mvDIt9VoAttM7Iai2mys7SvrjooUAw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(396003)(39850400004)(136003)(366004)(376002)(4326008)(66446008)(66476007)(5660300002)(9686003)(8676002)(66556008)(66946007)(76116006)(55016002)(122000001)(6506007)(64756008)(186003)(2906002)(26005)(8936002)(44832011)(71200400001)(38100700002)(316002)(4744005)(38070700005)(110136005)(54906003)(52536014)(478600001)(7696005)(33656002)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: N2DaWUZfzEVSmrE1x61q0YnaMB36GsLizB4gK+TRXPfCz3xdfT5RZlpfWxYSULHbO8GwUDaiBFzBlHEHDjEgsDGUV54E+9dbZjdAMegNWmjghhV2sD2jag24OD31y8VZSfXHv36QTrRvF+LOOh+MqM87Klw/51yJcD8XzQQLNqLau7wfYktunc67C3RclCcjVtFPzFGp+f1gNzxnhpC4R2w7Yh7PYVh38j5o22iHKQu1P7uGV0IcuqESu4/e2y6Iy36el33l0UZrhoQTNjqU85Sy6YrkfFFdXcwVG5HtGkOeRfCP5vHqvlvlTfpZxdUWB1ZZH4mM6OD198jvtIJTNE07ZER6fo3T3eiZG1wCj+Qb19gGEDcVctzxZP3iKqG+ZI/r0MrpZLZnCK7sBlLTmF2GxnvlrgTB1GasjC9VK3GmdqPb8E7aUwSHaFj3KNkJOLkCbM1Y8XrPvWAO0LuyCNANuFEK78M6/00I7huGezMqlemJigyPCGtPwqXUQFCcB06W8QApPzNdqm38Eg4LsIu408IqatA06NYZ0SsJCyaFRC53f6ALzX9SPcKEzgwlCZUEd4QweL3zeZO75uLsfm3Nz3jit1bcZiSv6cFbOCsIqLq2zUmXasSxi2uWzv2QSid/se1qjV14LIEFhBIpztGUaL+rPmcHUOcFSmiX4aU45z5ZiHW7YApouqT9JKHs3ekTKwExkUC4DmV3ntNvMKBNyIT3nuAUObtWHOGzviOlcVjKGSayH3uNk/A5P6N1Gidia6Oun32utqXg2XD5ev0hhwzyxYklk7gBgLGimpvUTSJkkzuxvK/Q/p/Rnvr7JRjpialKnqXYRJhrRx/fR0Xq1CY7LeB6+QmiXZafNc/oI4O7a6bEHR1lGwAYbqnyOTuqmGZRgklH9b/zpx+5GFiYGqMMPwl8dC+8iAoPGZqKSp/5dIepX7KOjRaLXiPcxbQLTrf5Aafc/MhNz3EmC650uA00QYZsAvFQiVRF2IW9RoCpr4ncJp3Nr1SlX/5ER7quRXJg7y+KRvg0UnT40SksQzWkLWNwde34yz7L4yY4vwTsuaxEPc0fsihCdjnbKsVBdHq1NgaYaYNwUn+wGIcDgTsfZilMunuxwXyfu7Pl7OTUGS5Kfu6he9sjBHRfzJqBecP6YHK9ELoj/Kca4+KzXaXUMqApSkMkLJhvMEacs8ZhpIpWpA1TCyLzhhl9JyBIUQHJyKNpHqmteSkyS2502BjhmCWJzh445ci4KTdgfW4cX2XKpMyPwKPp28ndi1TCrsAjnGlC0PSrdr2FGO7EZVzjYEtp+Av2Hqyfrmz90GpbjJxtNRPREJik6k85 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b0b582e-c9c0-484f-18ce-08d958f64966 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Aug 2021 16:21:46.5127 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: N/eqWIMXdx32UGW1XUc6NA7mHS0Y7vUFl+f/GWSoVj9VxSNQUqG82WQdvwNeZQ5io7WaCamU3ZnVG0I/xGHI+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3223 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10068 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=818 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108060112 X-Proofpoint-GUID: LCUWEiEgN_NMBbCOyDUXeqUmAQgk-WHt X-Proofpoint-ORIG-GUID: LCUWEiEgN_NMBbCOyDUXeqUmAQgk-WHt X-Spam-Score: -0.7 (/) 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 (-) > It's too late to change how keys are implemented for tab-bar. > The tab-bar keymap contains such keys as 'tab-1' and 'C-tab-2', > and clicking mouse-1 on tabs emits such events. It doesn't emit > 'mouse-1' and 'mouse-2'. IIUC, tab-bar is not in any Emacs release, the most recent of which is Emacs 27.2. If that's correct, how is it that it's too late to change something in the implementation or design of the incipient Emacs 28 feature tab-bar? Just asking. A priori, I don't care one way or the other about how tab-bar implements keys, and I don't know how it does that currently. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2021 07:24:02 +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: To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162849378816546 (code B ref 41343); Mon, 09 Aug 2021 07:24:02 +0000 Received: (at 41343) by debbugs.gnu.org; 9 Aug 2021 07:23:08 +0000 Received: from localhost ([127.0.0.1]:55590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCzcp-0004Ih-BP for submit@debbugs.gnu.org; Mon, 09 Aug 2021 03:23:08 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:57027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCzcl-0004Hp-An; Mon, 09 Aug 2021 03:23:05 -0400 Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 027401C000D; Mon, 9 Aug 2021 07:22:55 +0000 (UTC) From: Juri Linkov Organization: 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> Date: Mon, 09 Aug 2021 10:03:28 +0300 In-Reply-To: <83im0iiw8n.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 06 Aug 2021 15:38:32 +0300") Message-ID: <877dgvkt1z.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) 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 (-) --=-=-= Content-Type: text/plain forcemerge 41343 41342 tags 41342 + patch tags 41343 + patch thanks > Are you talking about handle_tab_bar_click and the processing of > TAB_BAR_EVENT in make_lispy_event? Or are there other/additional > parts to this processing? So now I've completely redesigned the event processing on the tab bar. With the following patch 'down-mouse-1' is bound to 'tab-bar-mouse-select-tab' 'down-mouse-2' is bound to 'tab-bar-mouse-close-tab' 'down-mouse-3' is bound to 'tab-bar-mouse-context-menu' The context menu that pops up on down-mouse-3 was requested in bug#41342. Now also it should be possible even to implement drag-drop to move tabs with the mouse since they produce normal mouse events that now are accepted by the tab bar. All aforementioned bindings work on X, xterm, and even on console. For example, clicking mouse-3 on the tab bar displays a menu with blue background on a console terminal. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=tab-bar-events.patch diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 7459e1b78c..162dc43876 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -224,6 +224,11 @@ tab-bar-mode (tab-bar--define-keys) (tab-bar--undefine-keys))) +(defun tab--symbol-to-number (symbol) + (unless (eq symbol 'current-tab) + (string-to-number + (string-replace "tab-" "" (format "%S" symbol))))) + (defun tab-bar-handle-mouse (event) "Text-mode emulation of switching tabs on the tab bar. This command is used when you click the mouse in the tab bar @@ -238,18 +243,52 @@ tab-bar-handle-mouse (lambda (key binding) (when (eq (car-safe binding) 'menu-item) (when (> (+ column (length (nth 1 binding))) x-position) - (if (get-text-property (- x-position column) 'close-tab (nth 1 binding)) - (let* ((close-key (vector (intern (format "C-%s" key)))) - (close-def (lookup-key keymap close-key))) - (when close-def - (call-interactively close-def))) - (call-interactively (nth 2 binding))) + (if (get-text-property + (- x-position column) 'close-tab (nth 1 binding)) + (tab-bar-close-tab (tab--symbol-to-number key)) + (if (nth 2 binding) + (call-interactively (nth 2 binding)) + (tab-bar-select-tab (tab--symbol-to-number key)))) (throw 'done t)) (setq column (+ column (length (nth 1 binding)))))) keymap)) ;; Clicking anywhere outside existing tabs will add a new tab (tab-bar-new-tab))))) +(defun tab-bar-mouse-select-tab (event) + (interactive "e") + (if (posn-window (event-start event)) + (let* ((tab (posn-string (event-start event))) + (tab-symbol (nth 0 tab)) + (tab-number (tab--symbol-to-number tab-symbol))) + (if (nth 1 tab) + (tab-bar-close-tab tab-number) + (let ((binding (lookup-key (cons 'keymap (nreverse (current-active-maps))) + (vector 'tab-bar tab-symbol)))) + (if binding + (call-interactively binding) + (tab-bar-select-tab tab-number))))) + ;; TTY + (tab-bar-handle-mouse event))) + +(defun tab-bar-mouse-close-tab (event) + (interactive "e") + (tab-bar-close-tab (tab--symbol-to-number + (nth 0 (posn-string (event-start event)))))) + +(defun tab-bar-mouse-context-menu (event) + (interactive "e") + (let* ((tab (posn-string (event-start event))) + (tab-number (tab--symbol-to-number (nth 0 tab))) + (menu (make-sparse-keymap "Context Menu"))) + + (define-key-after menu [close] + `(menu-item "Close" (lambda () (interactive) + (tab-bar-close-tab ,tab-number)) + :help "Close the tab")) + + (popup-menu menu event))) + (defun toggle-tab-bar-mode-from-frame (&optional arg) "Toggle tab bar on or off, based on the status of the current frame. Used in the Show/Hide menu, to have the toggle reflect the current frame. @@ -614,19 +654,12 @@ tab-bar--format-tab `((,(intern (format "tab-%i" i)) menu-item ,(funcall tab-bar-tab-name-format-function tab i) - ,(or - (alist-get 'binding tab) - `(lambda () - (interactive) - (tab-bar-select-tab ,i))) + ,(alist-get 'binding tab) :help "Click to visit tab")))) - `((,(if (eq (car tab) 'current-tab) 'C-current-tab (intern (format "C-tab-%i" i))) - menu-item "" - ,(or - (alist-get 'close-binding tab) - `(lambda () - (interactive) - (tab-bar-close-tab ,i))))))) + (when (alist-get 'close-binding tab) + `((,(if (eq (car tab) 'current-tab) 'C-current-tab (intern (format "C-tab-%i" i))) + menu-item "" + ,(alist-get 'close-binding tab)))))) (defun tab-bar-format-tabs () (let ((i 0)) @@ -767,7 +800,11 @@ tab-bar-format-list (defun tab-bar-make-keymap-1 () "Generate an actual keymap from `tab-bar-map', without caching." (append - '(keymap (mouse-1 . tab-bar-handle-mouse)) + '(keymap (down-mouse-1 . tab-bar-mouse-select-tab) + (mouse-1 . ignore) + (down-mouse-2 . tab-bar-mouse-close-tab) + (mouse-2 . ignore) + (down-mouse-3 . tab-bar-mouse-context-menu)) (tab-bar-format-list tab-bar-format))) diff --git a/src/dispextern.h b/src/dispextern.h index 33fcaa4c07..f4c7575b35 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3415,8 +3415,8 @@ #define TTY_CAP_STRIKE_THROUGH 0x20 NativeRectangle *nr); extern Lisp_Object find_hot_spot (Lisp_Object, int, int); -extern void handle_tab_bar_click (struct frame *, - int, int, bool, int); +extern Lisp_Object handle_tab_bar_click (struct frame *, + int, int, bool, int); extern void handle_tool_bar_click (struct frame *, int, int, bool, int); diff --git a/src/keyboard.c b/src/keyboard.c index 820229cf8f..5dabad98a8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5647,6 +5647,12 @@ make_lispy_event (struct input_event *event) position = make_lispy_position (f, event->x, event->y, event->timestamp); + + if (CONSP (event->arg) && EQ (XCAR (event->arg), Qtab_bar)) + { + XSETCAR (XCDR (position), Qtab_bar); + position = nconc2(position, Fcons (XCDR (event->arg), Qnil)); + } } #ifndef USE_TOOLKIT_SCROLL_BARS else diff --git a/src/term.c b/src/term.c index c995a4499c..89b3568003 100644 --- a/src/term.c +++ b/src/term.c @@ -2568,21 +2568,8 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event) { f->mouse_moved = 0; term_mouse_click (&ie, event, f); - /* eassert (ie.kind == MOUSE_CLICK_EVENT); */ - if (tty_handle_tab_bar_click (f, event->x, event->y, - (ie.modifiers & down_modifier) != 0, &ie)) - { - /* eassert (ie.kind == MOUSE_CLICK_EVENT - * || ie.kind == TAB_BAR_EVENT); */ - /* tty_handle_tab_bar_click stores 2 events in the event - queue, so we are done here. */ - /* FIXME: Actually, `tty_handle_tab_bar_click` returns true - without storing any events, when - (ie.modifiers & down_modifier) != 0 */ - count += 2; - return count; - } - /* eassert (ie.kind == MOUSE_CLICK_EVENT); */ + ie.arg = tty_handle_tab_bar_click (f, event->x, event->y, + (ie.modifiers & down_modifier) != 0, &ie); kbd_buffer_store_event (&ie); count++; } diff --git a/src/termchar.h b/src/termchar.h index f50c1bfb6e..7ab9337fbe 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -234,7 +234,7 @@ #define FRAME_TTY(f) \ #define CURTTY() FRAME_TTY (SELECTED_FRAME()) struct input_event; -extern bool tty_handle_tab_bar_click (struct frame *, int, int, bool, - struct input_event *); +extern Lisp_Object tty_handle_tab_bar_click (struct frame *, int, int, bool, + struct input_event *); #endif /* EMACS_TERMCHAR_H */ diff --git a/src/w32inevt.c b/src/w32inevt.c index 1255072b7f..9a69b32bcb 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -586,9 +586,8 @@ do_mouse_event (MOUSE_EVENT_RECORD *event, int x = event->dwMousePosition.X; int y = event->dwMousePosition.Y; struct frame *f = get_frame (); - if (tty_handle_tab_bar_click (f, x, y, (button_state & mask) != 0, - emacs_ev)) - return 0; /* tty_handle_tab_bar_click adds the event to queue */ + emacs_ev->arg = tty_handle_tab_bar_click (f, x, y, (button_state & mask) != 0, + emacs_ev); emacs_ev->modifiers |= ((button_state & mask) ? down_modifier : up_modifier); @@ -597,7 +596,6 @@ do_mouse_event (MOUSE_EVENT_RECORD *event, XSETFASTINT (emacs_ev->x, x); XSETFASTINT (emacs_ev->y, y); XSETFRAME (emacs_ev->frame_or_window, f); - emacs_ev->arg = Qnil; return 1; } diff --git a/src/w32term.c b/src/w32term.c index ad4d1a3282..c9570b0c67 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -168,8 +168,8 @@ #define SM_CYVIRTUALSCREEN 79 int w32_message_fd = -1; #endif /* CYGWIN */ -static void w32_handle_tab_bar_click (struct frame *, - struct input_event *); +static Lisp_Object w32_handle_tab_bar_click (struct frame *, + struct input_event *); static void w32_handle_tool_bar_click (struct frame *, struct input_event *); static void w32_define_cursor (Window, Emacs_Cursor); @@ -3684,17 +3684,17 @@ w32_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, frame-relative coordinates X/Y. EVENT_TYPE is either ButtonPress or ButtonRelease. */ -static void +static Lisp_Object w32_handle_tab_bar_click (struct frame *f, struct input_event *button_event) { int x = XFIXNAT (button_event->x); int y = XFIXNAT (button_event->y); if (button_event->modifiers & down_modifier) - handle_tab_bar_click (f, x, y, 1, 0); + return handle_tab_bar_click (f, x, y, 1, 0); else - handle_tab_bar_click (f, x, y, 0, - button_event->modifiers & ~up_modifier); + return handle_tab_bar_click (f, x, y, 0, + button_event->modifiers & ~up_modifier); } @@ -5186,6 +5186,7 @@ w32_read_socket (struct terminal *terminal, { /* If we decide we want to generate an event to be seen by the rest of Emacs, we put it here. */ + Lisp_Object tab_bar_key = Qnil; bool tab_bar_p = 0; bool tool_bar_p = 0; int button = 0; @@ -5208,12 +5209,12 @@ w32_read_socket (struct terminal *terminal, if (EQ (window, f->tab_bar_window)) { - w32_handle_tab_bar_click (f, &inev); + tab_bar_key = w32_handle_tab_bar_click (f, &inev); tab_bar_p = 1; } } - if (tab_bar_p + if ((tab_bar_p && NILP (tab_bar_key)) || (dpyinfo->w32_focus_frame && f != dpyinfo->w32_focus_frame /* This does not help when the click happens in @@ -5221,6 +5222,9 @@ w32_read_socket (struct terminal *terminal, && !frame_ancestor_p (f, dpyinfo->w32_focus_frame))) inev.kind = NO_EVENT; + if (!NILP (tab_bar_key)) + inev.arg = tab_bar_key; + /* Is this in the tool-bar? */ if (WINDOWP (f->tool_bar_window) && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) diff --git a/src/xdisp.c b/src/xdisp.c index e62f7e3df6..0cbfa4bfff 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13745,7 +13745,7 @@ get_tab_bar_item (struct frame *f, int x, int y, struct glyph **glyph, false for button release. MODIFIERS is event modifiers for button release. */ -void +Lisp_Object handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, int modifiers) { @@ -13763,12 +13763,12 @@ handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, /* If the button is released on a tab other than the one where it was pressed, don't generate the tab-bar button click event. */ || (ts != 0 && !down_p)) - return; + return Qnil; /* If item is disabled, do nothing. */ enabled_p = AREF (f->tab_bar_items, prop_idx + TAB_BAR_ITEM_ENABLED_P); if (NILP (enabled_p)) - return; + return Qnil; if (down_p) { @@ -13779,24 +13779,15 @@ handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, } else { - Lisp_Object key, frame; - struct input_event event; - EVENT_INIT (event); - /* Show item in released state. */ if (!NILP (Vmouse_highlight)) show_mouse_face (hlinfo, DRAW_IMAGE_RAISED); - - key = AREF (f->tab_bar_items, prop_idx + TAB_BAR_ITEM_KEY); - - XSETFRAME (frame, f); - event.kind = TAB_BAR_EVENT; - event.frame_or_window = frame; - event.arg = key; - event.modifiers = close_p ? ctrl_modifier | modifiers : modifiers; - kbd_buffer_store_event (&event); f->last_tab_bar_item = -1; } + + return list3 (Qtab_bar, + AREF (f->tab_bar_items, prop_idx + TAB_BAR_ITEM_KEY), + close_p ? Qt : Qnil); } @@ -13920,14 +13911,14 @@ tty_get_tab_bar_item (struct frame *f, int x, int *idx, ptrdiff_t *end) structure, store it in keyboard queue, and return true; otherwise return false. MODIFIERS are event modifiers for generating the tab release event. */ -bool +Lisp_Object tty_handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, struct input_event *event) { /* Did they click on the tab bar? */ if (y < FRAME_MENU_BAR_LINES (f) || y >= FRAME_MENU_BAR_LINES (f) + FRAME_TAB_BAR_LINES (f)) - return false; + return Qnil; /* Find the tab-bar item where the X,Y coordinates belong. */ int prop_idx; @@ -13935,46 +13926,33 @@ tty_handle_tab_bar_click (struct frame *f, int x, int y, bool down_p, Lisp_Object caption = tty_get_tab_bar_item (f, x, &prop_idx, &clen); if (NILP (caption)) - return false; + return Qnil; if (NILP (AREF (f->tab_bar_items, prop_idx * TAB_BAR_ITEM_NSLOTS + TAB_BAR_ITEM_ENABLED_P))) - return false; + return Qnil; if (down_p) f->last_tab_bar_item = prop_idx; else { - /* Force reset of up_modifier bit from the event modifiers. */ - if (event->modifiers & up_modifier) - event->modifiers &= ~up_modifier; - - /* Generate a TAB_BAR_EVENT event. */ - Lisp_Object frame; - Lisp_Object key = AREF (f->tab_bar_items, - prop_idx * TAB_BAR_ITEM_NSLOTS - + TAB_BAR_ITEM_KEY); - /* Kludge alert: we assume the last two characters of a tab - label are " x", and treat clicks on those 2 characters as a - Close Tab command. */ - eassert (STRINGP (caption)); - int lastc = SSDATA (caption)[SCHARS (caption) - 1]; - bool close_p = false; - if ((x == clen - 1 || (clen > 1 && x == clen - 2)) && lastc == 'x') - close_p = true; - - event->code = 0; - XSETFRAME (frame, f); - event->kind = TAB_BAR_EVENT; - event->frame_or_window = frame; - event->arg = key; - if (close_p) - event->modifiers |= ctrl_modifier; - kbd_buffer_store_event (event); f->last_tab_bar_item = -1; } - return true; + /* Generate a TAB_BAR_EVENT event. */ + Lisp_Object key = AREF (f->tab_bar_items, + prop_idx * TAB_BAR_ITEM_NSLOTS + + TAB_BAR_ITEM_KEY); + /* Kludge alert: we assume the last two characters of a tab + label are " x", and treat clicks on those 2 characters as a + Close Tab command. */ + eassert (STRINGP (caption)); + int lastc = SSDATA (caption)[SCHARS (caption) - 1]; + bool close_p = false; + if ((x == clen - 1 || (clen > 1 && x == clen - 2)) && lastc == 'x') + close_p = true; + + return list3 (Qtab_bar, key, close_p ? Qt : Qnil); } diff --git a/src/xterm.c b/src/xterm.c index 1887c3255d..80fa747b97 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9166,6 +9166,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, { /* If we decide we want to generate an event to be seen by the rest of Emacs, we put it here. */ + Lisp_Object tab_bar_key = Qnil; bool tab_bar_p = false; bool tool_bar_p = false; @@ -9215,7 +9216,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, tab_bar_p = EQ (window, f->tab_bar_window); if (tab_bar_p && event->xbutton.button < 4) - handle_tab_bar_click + tab_bar_key = handle_tab_bar_click (f, x, y, event->xbutton.type == ButtonPress, x_x_to_emacs_modifiers (dpyinfo, event->xbutton.state)); } @@ -9239,7 +9240,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, } #endif /* !USE_GTK */ - if (!tab_bar_p && !tool_bar_p) + if (!(tab_bar_p && NILP (tab_bar_key)) && !tool_bar_p) #if defined (USE_X_TOOLKIT) || defined (USE_GTK) if (! popup_activated ()) #endif @@ -9257,6 +9258,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, } else x_construct_mouse_click (&inev.ie, &event->xbutton, f); + + if (!NILP (tab_bar_key)) + inev.ie.arg = tab_bar_key; } if (FRAME_X_EMBEDDED_P (f)) xembed_send_message (f, event->xbutton.time, --=-=-=-- From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: [External] : bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2021 07:24:03 +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: To: Drew Adams Cc: Eli Zaretskii , "41343@debbugs.gnu.org" <41343@debbugs.gnu.org>, "stefankangas@gmail.com" Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162849379016574 (code B ref 41343); Mon, 09 Aug 2021 07:24:03 +0000 Received: (at 41343) by debbugs.gnu.org; 9 Aug 2021 07:23:10 +0000 Received: from localhost ([127.0.0.1]:55597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCzcs-0004JB-MS for submit@debbugs.gnu.org; Mon, 09 Aug 2021 03:23:10 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:59535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCzcp-0004IF-T6 for 41343@debbugs.gnu.org; Mon, 09 Aug 2021 03:23:09 -0400 Received: (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 09A6FE0005; Mon, 9 Aug 2021 07:22:59 +0000 (UTC) From: Juri Linkov Organization: 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> Date: Mon, 09 Aug 2021 10:06:14 +0300 In-Reply-To: (Drew Adams's message of "Fri, 6 Aug 2021 16:21:46 +0000") Message-ID: <87wnovjecx.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) > IIUC, tab-bar is not in any Emacs release, the most > recent of which is Emacs 27.2. If that's correct, > how is it that it's too late to change something in > the implementation or design of the incipient Emacs > 28 feature tab-bar? You missed all the fun that everyone had with tabs in Emacs 27. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Aug 2021 12:39: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 To: Juri Linkov Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162859909120047 (code B ref 41343); Tue, 10 Aug 2021 12:39:01 +0000 Received: (at 41343) by debbugs.gnu.org; 10 Aug 2021 12:38:11 +0000 Received: from localhost ([127.0.0.1]:58657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDR1H-0005DG-Kv for submit@debbugs.gnu.org; Tue, 10 Aug 2021 08:38:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDR1E-0005D3-1I for 41343@debbugs.gnu.org; Tue, 10 Aug 2021 08:38:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47534) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDR17-0002O9-NN; Tue, 10 Aug 2021 08:38:01 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1192 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDR17-0002MX-B4; Tue, 10 Aug 2021 08:38:01 -0400 Date: Tue, 10 Aug 2021 15:38:11 +0300 Message-Id: <83wnotfpak.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <877dgvkt1z.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 09 Aug 2021 10:03:28 +0300) 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> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Juri Linkov > Cc: stefankangas@gmail.com, 41343@debbugs.gnu.org > Date: Mon, 09 Aug 2021 10:03:28 +0300 > > So now I've completely redesigned the event processing on the tab bar. > With the following patch > > 'down-mouse-1' is bound to 'tab-bar-mouse-select-tab' > 'down-mouse-2' is bound to 'tab-bar-mouse-close-tab' > 'down-mouse-3' is bound to 'tab-bar-mouse-context-menu' > > The context menu that pops up on down-mouse-3 was requested in bug#41342. > Now also it should be possible even to implement drag-drop to move tabs > with the mouse since they produce normal mouse events that now are accepted > by the tab bar. Thanks, this looks much, much better to me. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Aug 2021 07:07: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 To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.1628665562668 (code B ref 41343); Wed, 11 Aug 2021 07:07:01 +0000 Received: (at 41343) by debbugs.gnu.org; 11 Aug 2021 07:06:02 +0000 Received: from localhost ([127.0.0.1]:33107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiJO-0000Ac-0w for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:06:02 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:35911) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiJM-0000AC-5h for 41343@debbugs.gnu.org; Wed, 11 Aug 2021 03:06:00 -0400 Received: (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 8688EE0003; Wed, 11 Aug 2021 07:05:53 +0000 (UTC) From: Juri Linkov Organization: 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> Date: Wed, 11 Aug 2021 10:01:53 +0300 In-Reply-To: <83wnotfpak.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 10 Aug 2021 15:38:11 +0300") Message-ID: <87k0ksecbq.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) >> So now I've completely redesigned the event processing on the tab bar. > > Thanks, this looks much, much better to me. Could you please help to check if everything is correct on the Windows part (unfortunately, I don't have Windows). The changes in w32inevt.c and w32term.c just mirror the changes in xdisp.c and xterm.c, but I'm sure I might have made a typo. I could push the changes to a new branch if you want. 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) The Info node (info "(elisp) Click Events") documents the event format as: (WINDOW POS-OR-AREA (X . Y) TIMESTAMP OBJECT TEXT-POS (COL . ROW) IMAGE (DX . DY) (WIDTH . HEIGHT)) and the events emitted by the previous patch look like: (down-mouse-1 (# (tab-bar) (X . Y) TIMESTAMP (tab-5 t))) where '(tab-5 t)' in the OBJECT slot defines the clicked tab symbol and whether the close button was clicked. And I can't find a slot more suitable than OBJECT to carry event metadata. diff --git a/lisp/mouse.el b/lisp/mouse.el index cf7c17be28..557d9ab1df 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1176,7 +1362,7 @@ mouse-posn-property its value is returned." (if (consp pos) (let ((w (posn-window pos)) (pt (posn-point pos)) - (str (posn-string pos))) + (str (unless (eq (posn-area pos) 'tab-bar) (posn-string pos)))) ;; FIXME: When STR has a `category' property and there's another ;; `category' property at PT, we should probably disregard the ;; `category' property at PT while doing the (get-char-property @@ -1187,7 +1373,8 @@ mouse-posn-property ;; (nth 5). This is useful but is not exactly where we clicked, so ;; don't look up that position's properties! (and pt (not (memq (posn-area pos) '(left-fringe right-fringe - left-margin right-margin))) + left-margin right-margin + tab-bar))) (get-char-property pt property w)))) (get-char-property pos property))) From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Aug 2021 11:57: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 To: Juri Linkov Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162868298431796 (code B ref 41343); Wed, 11 Aug 2021 11:57:01 +0000 Received: (at 41343) by debbugs.gnu.org; 11 Aug 2021 11:56:24 +0000 Received: from localhost ([127.0.0.1]:33690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDmqO-0008Gl-EK for submit@debbugs.gnu.org; Wed, 11 Aug 2021 07:56:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDmqM-0008GV-Th for 41343@debbugs.gnu.org; Wed, 11 Aug 2021 07:56:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55768) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDmqG-0003rm-Eg; Wed, 11 Aug 2021 07:56:16 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3838 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDmqE-0002SB-Vi; Wed, 11 Aug 2021 07:56:16 -0400 Date: Wed, 11 Aug 2021 14:56:26 +0300 Message-Id: <83v94cdwk5.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87k0ksecbq.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 11 Aug 2021 10:01:53 +0300) 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> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Juri Linkov > Cc: stefankangas@gmail.com, 41343@debbugs.gnu.org > Date: Wed, 11 Aug 2021 10:01:53 +0300 > > >> So now I've completely redesigned the event processing on the tab bar. > > > > Thanks, this looks much, much better to me. > > Could you please help to check if everything is correct > on the Windows part (unfortunately, I don't have Windows). > The changes in w32inevt.c and w32term.c just mirror the changes > in xdisp.c and xterm.c, but I'm sure I might have made a typo. I will, if you tell me what to try after applying the patch. > 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? From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click 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 To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162875610630447 (code B ref 41343); Thu, 12 Aug 2021 08:16:01 +0000 Received: (at 41343) by debbugs.gnu.org; 12 Aug 2021 08:15:06 +0000 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 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 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) From: Juri Linkov Organization: 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> Date: Thu, 12 Aug 2021 11:09:35 +0300 In-Reply-To: <83v94cdwk5.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Aug 2021 14:56:26 +0300") Message-ID: <87bl6384ow.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) >> 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? From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Aug 2021 08:45:02 +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 To: Juri Linkov Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.16287578651217 (code B ref 41343); Thu, 12 Aug 2021 08:45:02 +0000 Received: (at 41343) by debbugs.gnu.org; 12 Aug 2021 08:44:25 +0000 Received: from localhost ([127.0.0.1]:37518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE6K8-0000JZ-R0 for submit@debbugs.gnu.org; Thu, 12 Aug 2021 04:44:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE6K6-0000JL-FL for 41343@debbugs.gnu.org; Thu, 12 Aug 2021 04:44:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60046) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mE6K0-0006XC-N4; Thu, 12 Aug 2021 04:44:16 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2247 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mE6K0-0000FL-AJ; Thu, 12 Aug 2021 04:44:16 -0400 Date: Thu, 12 Aug 2021 11:43:59 +0300 Message-Id: <83zgtncasw.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87bl6384ow.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 12 Aug 2021 11:09:35 +0300) 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> <87bl6384ow.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Juri Linkov > Cc: stefankangas@gmail.com, 41343@debbugs.gnu.org > Date: Thu, 12 Aug 2021 11:09:35 +0300 > > 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? Hmm... I cannot find a function named tab-bar-format, so I don't think I understand the question. In general, if existing code doesn't add some text properties, how can that be a problem? > 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. If you use property names that are unlikely to conflict, I see no problem here. These are special properties used by Emacs for internal needs of handling the tab bar, so we can use any name that suits us. And since all of the property names are produced by Emacs itself, we can easily enough have a set of names without conflicts. Right? Or what am I missing? > 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? I don't think the problem is severe, see above. Alternatively, we could introduce a new format for OBJECT, but then we'd need to document it, and try to make sure it won't cause compatibility problems in existing code. I think this is a more complicated alternative, so my recommendation is to try to deconflict the properties. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Aug 2021 07:34:02 +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 To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.16288399828357 (code B ref 41343); Fri, 13 Aug 2021 07:34:02 +0000 Received: (at 41343) by debbugs.gnu.org; 13 Aug 2021 07:33:02 +0000 Received: from localhost ([127.0.0.1]:40445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mERgb-0002Af-OI for submit@debbugs.gnu.org; Fri, 13 Aug 2021 03:33:02 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:53031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mERgY-0002AO-BK for 41343@debbugs.gnu.org; Fri, 13 Aug 2021 03:33:00 -0400 Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 669121C0007; Fri, 13 Aug 2021 07:32:50 +0000 (UTC) From: Juri Linkov Organization: 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> <87bl6384ow.fsf@mail.linkov.net> <83zgtncasw.fsf@gnu.org> Date: Fri, 13 Aug 2021 10:24:32 +0300 In-Reply-To: <83zgtncasw.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 12 Aug 2021 11:43:59 +0300") Message-ID: <875yw9dcy7.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) >> 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? > > Hmm... I cannot find a function named tab-bar-format, so I don't think > I understand the question. In general, if existing code doesn't add > some text properties, how can that be a problem? 'tab-bar-format' is a variable that contains functions including 'tab-bar-format-tabs' that calls 'tab-bar--format-tab' that doesn't put special text properties on tab captions. Without text properties, it's impossible to identify the clicked tab in the command called by the click event. > If you use property names that are unlikely to conflict, I see no > problem here. These are special properties used by Emacs for internal > needs of handling the tab bar, so we can use any name that suits us. > And since all of the property names are produced by Emacs itself, we > can easily enough have a set of names without conflicts. Right? Or > what am I missing? Maybe it's not a problem to add text properties, need to test this more. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Aug 2021 18:13: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 To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162931034417080 (code B ref 41343); Wed, 18 Aug 2021 18:13:01 +0000 Received: (at 41343) by debbugs.gnu.org; 18 Aug 2021 18:12:24 +0000 Received: from localhost ([127.0.0.1]:57578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGQ35-0004RQ-Vb for submit@debbugs.gnu.org; Wed, 18 Aug 2021 14:12:24 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:60077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGQ34-0004RA-Gt for 41343@debbugs.gnu.org; Wed, 18 Aug 2021 14:12:23 -0400 Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 888531BF204; Wed, 18 Aug 2021 18:12:14 +0000 (UTC) From: Juri Linkov Organization: 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> Date: Wed, 18 Aug 2021 21:11:43 +0300 In-Reply-To: <83v94cdwk5.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Aug 2021 14:56:26 +0300") Message-ID: <87a6lepqqo.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) I moved the development to the branch 'feature/tab-bar-events' since more fixes are necessary to support tab-bar events on tty. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Aug 2021 14:38:02 +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 To: Juri Linkov Cc: Eli Zaretskii , 41343@debbugs.gnu.org Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.162981587911597 (code B ref 41343); Tue, 24 Aug 2021 14:38:02 +0000 Received: (at 41343) by debbugs.gnu.org; 24 Aug 2021 14:37:59 +0000 Received: from localhost ([127.0.0.1]:44975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIXYe-00030j-OE for submit@debbugs.gnu.org; Tue, 24 Aug 2021 10:37:59 -0400 Received: from mail-pg1-f174.google.com ([209.85.215.174]:36436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIXYc-00030W-Hb for 41343@debbugs.gnu.org; Tue, 24 Aug 2021 10:37:43 -0400 Received: by mail-pg1-f174.google.com with SMTP id t1so19980546pgv.3 for <41343@debbugs.gnu.org>; Tue, 24 Aug 2021 07:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IqDaezAPEsvMnCiC4ICUF+BJShhq1NiVVbFNnIyghCU=; b=HhTeqQL6CZ9lRoBhT5djQPDxkWHDsyc5+UfkT3cB6oU8eNeoTjn1iIoSu9YT8k4z/i eTMHt0W9YoVZ+pUxhP9gE6UEuHotAGodiJXjBJZ0ETVOhlgEGU0llBwdqAszhwgx4dPS XAHTnxlHP69qeWeQisVc6jWD7BQNw9H5PRTb/pqatyR5yogmpce1IBLXbno1sZm+UgeO 05x6wBRK5aKjZDKJwSjdrV3FPWB9SZubxYvXCiZXGRszwwJFkNFc/eLwaoqhoEcoY3Uz e6Otg1wvVCNvLMZHdk7o9Cucdofa2Jx4ZL7riVMy9U6fXSKJU5MXoawGkqVlvVjS6vGY S2ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IqDaezAPEsvMnCiC4ICUF+BJShhq1NiVVbFNnIyghCU=; b=S7Tn3MMn8eqaySIXm19KItg7cdX6Vh/uBhz6zhvqDnTe968nFEqIaQPhSAFgCqW8Tz z+BZweXpvFUscphE6hkbk2P5VFw/pmGj/lJx4FK3jLusjqJX496LifHrCkAjx+mguu7/ p8nJ+XMHw/A8t+LhkMlydj/BIgldyizftutRqM2Tc6Rz/4jLzdSjv4dk46PUpQz+ndYX IJBEj0vuP+8GlizLYVB6PJsoax6EzFvVb5DGR9/MVPtEGwD508QuaGlfxKFEmh0tzHoe NBl/JKwK/B/D5zIuYNCQ/wvwG4WEV5n8fMTJnzPRq1hCNE29RENKkEctK9P536zOpd1g RcSw== X-Gm-Message-State: AOAM533YmESl2ETtfyVBvqmSxaxKDjseGj0zcv/C1jZueLVZ4jxDYB+4 ajc0mw+1a+3dVgC+wXfgEJlI7yaY7e69HYzkQYpa5tTR X-Google-Smtp-Source: ABdhPJzrgp05Yv1nLW0k8j/MnubWLw7NhW3/snFuK4EQ5dnKBqHoVZhlXZfp7qINdGTGkSNVCkeGrRvq7JVTidlt4B0= X-Received: by 2002:a63:5604:: with SMTP id k4mr37412130pgb.363.1629815856786; Tue, 24 Aug 2021 07:37:36 -0700 (PDT) MIME-Version: 1.0 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> <87a6lepqqo.fsf@mail.linkov.net> In-Reply-To: <87a6lepqqo.fsf@mail.linkov.net> From: Stefan Kangas Date: Tue, 24 Aug 2021 16:37:25 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) 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.0 (-) Juri Linkov writes: > I moved the development to the branch 'feature/tab-bar-events' > since more fixes are necessary to support tab-bar events on tty. Thanks for working on this. Please let us know when you have something you'd like help testing. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Sep 2021 17:20: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 To: Eli Zaretskii Cc: 41343@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.16308623692607 (code B ref 41343); Sun, 05 Sep 2021 17:20:01 +0000 Received: (at 41343) by debbugs.gnu.org; 5 Sep 2021 17:19:29 +0000 Received: from localhost ([127.0.0.1]:50932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvnl-0000fz-67 for submit@debbugs.gnu.org; Sun, 05 Sep 2021 13:19:29 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:59039) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvnj-0000fl-TS for 41343@debbugs.gnu.org; Sun, 05 Sep 2021 13:19:28 -0400 Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 5CE821BF206; Sun, 5 Sep 2021 17:19:20 +0000 (UTC) From: Juri Linkov Organization: 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> Date: Sun, 05 Sep 2021 20:17:20 +0300 In-Reply-To: <83v94cdwk5.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Aug 2021 14:56:26 +0300") Message-ID: <87y28brlgf.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) 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.0 (-) >> Could you please help to check if everything is correct >> on the Windows part (unfortunately, I don't have Windows). >> The changes in w32inevt.c and w32term.c just mirror the changes >> in xdisp.c and xterm.c, but I'm sure I might have made a typo. > > I will, if you tell me what to try after applying the patch. Now the branch 'feature/tab-bar-events' is ready for merging to master. What remains to do is to test it on Windows. Could you please try on Windows GUI and on Windows console to use mouse-1 to select a tab, to click mouse-1 a close button to close it, to drag a tab by mouse-1, to click mouse-2 to close the clicked tab, mouse-3 to pop up the context menu and select "Close", and also wheel-left/wheel-right to switch to the next/previous tab, and S-wheel-left/wheel-right to move the tab. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Sep 2021 17:20:02 +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 To: Stefan Kangas Cc: Eli Zaretskii , 41343@debbugs.gnu.org Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.16308623712621 (code B ref 41343); Sun, 05 Sep 2021 17:20:02 +0000 Received: (at 41343) by debbugs.gnu.org; 5 Sep 2021 17:19:31 +0000 Received: from localhost ([127.0.0.1]:50935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvnn-0000gD-CG for submit@debbugs.gnu.org; Sun, 05 Sep 2021 13:19:31 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:55163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMvnm-0000fp-NR for 41343@debbugs.gnu.org; Sun, 05 Sep 2021 13:19:30 -0400 Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 1565A240003; Sun, 5 Sep 2021 17:19:23 +0000 (UTC) From: Juri Linkov Organization: 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> <87a6lepqqo.fsf@mail.linkov.net> Date: Sun, 05 Sep 2021 20:18:06 +0300 In-Reply-To: (Stefan Kangas's message of "Tue, 24 Aug 2021 16:37:25 +0200") Message-ID: <87mtorrlf5.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) 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.0 (-) >> I moved the development to the branch 'feature/tab-bar-events' >> since more fixes are necessary to support tab-bar events on tty. > > Thanks for working on this. Please let us know when you have > something you'd like help testing. Now the branch 'feature/tab-bar-events' is ready for testing. Please help to find any possible problems. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Sep 2021 19:41:02 +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 To: Juri Linkov Cc: Eli Zaretskii , 41343@debbugs.gnu.org Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.163095723119083 (code B ref 41343); Mon, 06 Sep 2021 19:41:02 +0000 Received: (at 41343) by debbugs.gnu.org; 6 Sep 2021 19:40:31 +0000 Received: from localhost ([127.0.0.1]:54480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNKTm-0004xj-Ol for submit@debbugs.gnu.org; Mon, 06 Sep 2021 15:40:30 -0400 Received: from mail-pg1-f172.google.com ([209.85.215.172]:36512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNKTl-0004xW-3m for 41343@debbugs.gnu.org; Mon, 06 Sep 2021 15:40:29 -0400 Received: by mail-pg1-f172.google.com with SMTP id t1so7687553pgv.3 for <41343@debbugs.gnu.org>; Mon, 06 Sep 2021 12:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0vWmM+madeEjrWB3dnp3meUFjRlJk46XiHLfBSmrOwk=; b=Xs4MRmvY0VCXwUthkl/J3vXTa9ZS4rD57cNGita9TLPlD9OkHe8CkIspbCHlPazhwi QS2h2/mtpgGCplsfHXefTE0eGVCIDFRs2AurQ/dhCTbZMeaQ43Dh69ea6a44B3UvW2T6 cqcfTAHzRgLtPX+j6YgJ0+WZ2qSK5/YJBqQdlLX4P6IHF3P/5pPfcEqaMFax0DUEznTD qnjXNA9UYT+ANYFt5C8S44lKD4kkh7InpCvEsaLe+hraf+xKuOrkkD4p7gc7grYtC7F0 J6UYbq/65NNqO19OvCUxNbc0w3cw77cjlALmdD0g9bxGep3vUHUEHmfp9Jd6DAhuhebG BTug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0vWmM+madeEjrWB3dnp3meUFjRlJk46XiHLfBSmrOwk=; b=Hv3mzPyLyIVGqMCJQvopM9m89SDiA+xQOudhNjfcNXcd59IYVwDNzE1AvskgQE15Z/ fk19+rPxZ+r8QMZb6AFiPzsGsfV50p4y1G6rn6oSQKamqTK0sLfWoZRkbTVac3uhW1LX DegRUChF+qTmDGvo/ccfB+4XW8zfecN83R8vE2gG4aCz9cMtTunuSZH+wfQWzbeTp5Zu zsul6H4NlNFs6ESA2U+1nYmeT98uAn4b1bDZs6+TqyjrbnAJKzMFrFunjBpJDyEbtQW4 2P3IEBwfKoHYiFayzZIHb2ItPxTMNIZaDu+LJPnQ3tY6EfXNSwWPsIRTANoNPVA6tdNI ESkg== X-Gm-Message-State: AOAM533bKzAsqImFpimtZpZXhqBAf/KXmlNv/c7Qf5qdgGQRXnQU60Eh oR1OSdWyFK1P6iuJLeThaqXYaALjY0V3vFpUI/Y= X-Google-Smtp-Source: ABdhPJw2R93N4E3b/htHSbtkE1ZS7nEGDtLjWio3LlfEkdc8VjKhFpVygPM4GoKlR3X9JKJzZqof9DtYRaV7EvA6NTk= X-Received: by 2002:a63:7d5d:: with SMTP id m29mr3632770pgn.114.1630957223108; Mon, 06 Sep 2021 12:40:23 -0700 (PDT) MIME-Version: 1.0 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> <87a6lepqqo.fsf@mail.linkov.net> <87mtorrlf5.fsf@mail.linkov.net> In-Reply-To: <87mtorrlf5.fsf@mail.linkov.net> From: Stefan Kangas Date: Mon, 6 Sep 2021 21:40:11 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) 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.0 (-) Juri Linkov writes: > Now the branch 'feature/tab-bar-events' is ready for testing. > Please help to find any possible problems. I have tested it on GNU/Linux and macOS, and it seems to work fine. One concern is that tabs close on mouse down, rather than release. In Firefox, tabs close instead on mouse release. This is good, because it gives me a second to react and move the mouse cursor away in case I misclick. This is currently less important in Emacs, as the buffer survives even such a misclick. But maybe in the future users will want tabs to be more strongly connected to their associated buffers, and work would then easily be lost to a misclick. Could we change this to close on mouse release instead? From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Sep 2021 19:45:02 +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 To: Stefan Kangas Cc: Eli Zaretskii , 41343@debbugs.gnu.org Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.163113029431284 (code B ref 41343); Wed, 08 Sep 2021 19:45:02 +0000 Received: (at 41343) by debbugs.gnu.org; 8 Sep 2021 19:44:54 +0000 Received: from localhost ([127.0.0.1]:33622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mO3V7-00088W-Ta for submit@debbugs.gnu.org; Wed, 08 Sep 2021 15:44:54 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:41445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mO3V3-00088G-T1 for 41343@debbugs.gnu.org; Wed, 08 Sep 2021 15:44:52 -0400 Received: (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 510F01BF206; Wed, 8 Sep 2021 19:44:41 +0000 (UTC) From: Juri Linkov Organization: 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> <87a6lepqqo.fsf@mail.linkov.net> <87mtorrlf5.fsf@mail.linkov.net> Date: Wed, 08 Sep 2021 22:28:58 +0300 In-Reply-To: (Stefan Kangas's message of "Mon, 6 Sep 2021 21:40:11 +0200") Message-ID: <87v93asw79.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) 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.0 (-) > I have tested it on GNU/Linux and macOS, and it seems to work fine. > > One concern is that tabs close on mouse down, rather than release. > > In Firefox, tabs close instead on mouse release. This is good, > because it gives me a second to react and move the mouse cursor away > in case I misclick. > > This is currently less important in Emacs, as the buffer survives even > such a misclick. But maybe in the future users will want tabs to be > more strongly connected to their associated buffers, and work would > then easily be lost to a misclick. > > Could we change this to close on mouse release instead? It will be easy to implement closing on mouse release. There are also many other small adjustments planned. But first I'd like to merge the basic completed work. Then to continue tweaking in master. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Sep 2021 21:19:02 +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 To: Juri Linkov Cc: Eli Zaretskii , 41343@debbugs.gnu.org Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.16311359287914 (code B ref 41343); Wed, 08 Sep 2021 21:19:02 +0000 Received: (at 41343) by debbugs.gnu.org; 8 Sep 2021 21:18:48 +0000 Received: from localhost ([127.0.0.1]:33685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mO4y0-00023a-Km for submit@debbugs.gnu.org; Wed, 08 Sep 2021 17:18:48 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:42519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mO4xv-00023J-Ui for 41343@debbugs.gnu.org; Wed, 08 Sep 2021 17:18:47 -0400 Received: by mail-pf1-f175.google.com with SMTP id 18so3167594pfh.9 for <41343@debbugs.gnu.org>; Wed, 08 Sep 2021 14:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qd2T+hRE70mY1/8qKZtYAj1GLoGSnY5uiGC3wj0Jonc=; b=lcKqcOt+6DpbbRx6Ev8okRvlzD68gYIsDPzz6RMbZ0Mn6Wj2x2vfOrmwlznUVg6VRF S9HGkgA0LvwuglREjMHwAw2lUVaBu+weiQRyNNsGtnrXxHRLsU30RNYXUn5x9E11Wkp1 PlnNkgIt2oqa/BRupLRTNz7lH1ZxpiAHRiE7UYr0gZGc/KF7A9kwUE1gX+cvX2vM55d0 Yff24Ynu75McprWQHv0KD0lUONkeJfhluFYmboB6g06zznwsLtwIB3icEc66EsDD1VqB ohTiF3BxRNmXm+YC3+pnAyLftTU0DTPjDk3pShWkCkzGKCnrIfHiR2+wjz2TNsVuYtBa 6MNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qd2T+hRE70mY1/8qKZtYAj1GLoGSnY5uiGC3wj0Jonc=; b=iOIsqTmHvRrgLZB936ua/nY/fMkM5d8h4bHoWudw/BKbDW7FZW2jMMPq8//0UjEOQe m/lMmn2I/NK1F47RtagSOaqiOno/errj6hI/g91xRfi3u68e0p/KDCM8PzzNTUlKuuYQ UPcwPcuuGem1LYJYSKuw9FevmgMrqvtLQJKtUbXG05BDDn+WhhLpfadFoqWsJBa/4BPS HOePUUFuCWOmq9lQJep+mGDHL8wfomrDbZvNYfeGX2fiJ2QKIJnpAC1HsipgnDnO/KyA exAJyNyzJ7fmXDJfPq99vemXdY/zsgWPXo/Ka76O2o2AYRChk933Y7cr3uCnwVWYAQTk pIGQ== X-Gm-Message-State: AOAM531Fv9mhewUFOJc8ft7ZSrdnJHjfPgY9etrFPGkN/lgHUIQIfxaC bkTi7QGh2CIm+L/Yy70Uln8qexoNe63dBJx+w60= X-Google-Smtp-Source: ABdhPJygsK0K0nUbOhlExrjZwYWMn50s9M5Rfnb68tAcn5gNcHLKZuLhkJ1cR9R3zzxdsez92uwlZnrL1wcrgTfq17g= X-Received: by 2002:a62:82c6:0:b0:410:afa1:6028 with SMTP id w189-20020a6282c6000000b00410afa16028mr121887pfd.35.1631135918103; Wed, 08 Sep 2021 14:18:38 -0700 (PDT) MIME-Version: 1.0 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> <87a6lepqqo.fsf@mail.linkov.net> <87mtorrlf5.fsf@mail.linkov.net> <87v93asw79.fsf@mail.linkov.net> In-Reply-To: <87v93asw79.fsf@mail.linkov.net> From: Stefan Kangas Date: Wed, 8 Sep 2021 23:18:26 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) 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.0 (-) Juri Linkov writes: > It will be easy to implement closing on mouse release. > There are also many other small adjustments planned. > But first I'd like to merge the basic completed work. > Then to continue tweaking in master. Sounds good, thanks. From unknown Sat Jun 21 12:31:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41343: tab-bar-mode: Close tab on mouse-2 click Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Sep 2021 06:45:02 +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 To: Stefan Kangas Cc: Eli Zaretskii , 41343@debbugs.gnu.org Received: via spool by 41343-submit@debbugs.gnu.org id=B41343.163160184827207 (code B ref 41343); Tue, 14 Sep 2021 06:45:02 +0000 Received: (at 41343) by debbugs.gnu.org; 14 Sep 2021 06:44:08 +0000 Received: from localhost ([127.0.0.1]:47356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQ2Aq-00074k-As for submit@debbugs.gnu.org; Tue, 14 Sep 2021 02:44:08 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:38437) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQ2Ao-00073m-91; Tue, 14 Sep 2021 02:44:06 -0400 Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 703F0240008; Tue, 14 Sep 2021 06:43:57 +0000 (UTC) From: Juri Linkov Organization: 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> <87a6lepqqo.fsf@mail.linkov.net> <87mtorrlf5.fsf@mail.linkov.net> Date: Tue, 14 Sep 2021 09:43:06 +0300 In-Reply-To: (Stefan Kangas's message of "Mon, 6 Sep 2021 21:40:11 +0200") Message-ID: <878rzzu079.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (-) tags 41343 fixed close 41343 28.0.50 thanks >> Now the branch 'feature/tab-bar-events' is ready for testing. >> Please help to find any possible problems. > > I have tested it on GNU/Linux and macOS, and it seems to work fine. > > One concern is that tabs close on mouse down, rather than release. > > In Firefox, tabs close instead on mouse release. This is good, > because it gives me a second to react and move the mouse cursor away > in case I misclick. > > This is currently less important in Emacs, as the buffer survives even > such a misclick. But maybe in the future users will want tabs to be > more strongly connected to their associated buffers, and work would > then easily be lost to a misclick. > > Could we change this to close on mouse release instead? Thanks for the suggestion. It was trivially easy to implement this with the new design of the event handling on the tab bar.