From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 27 18:13:02 2025 Received: (at submit) by debbugs.gnu.org; 27 Feb 2025 23:13:02 +0000 Received: from localhost ([127.0.0.1]:39706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tnn3t-00082Q-9Z for submit@debbugs.gnu.org; Thu, 27 Feb 2025 18:13:02 -0500 Received: from lists.gnu.org ([2001:470:142::17]:34386) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tnn2m-0007vI-CF for submit@debbugs.gnu.org; Thu, 27 Feb 2025 18:11:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnn2e-0002zl-ED for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2025 18:11:44 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnn2c-0000KG-38 for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2025 18:11:44 -0500 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button X-Debbugs-Cc: Jonas Bernoulli Date: Thu, 27 Feb 2025 18:11:36 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1740697898; bh=wa3Dydm0F5gLtVPRAL5kx3VEmP62tppEE/vr2Y4l468=; h=From:To:Subject:Date; b=pvUSi6OsUn2J+Wfncd5+ZeK8dDEir1e9RW9F4KYQmp+oYIjiA0YqX8F8G0uQm1IrQ Izz1AlwHz0BBdBA8T7fIo9wAVOVybTkRiowdn2xOYM+i+a/tXxz2ZXiw5gqkv89bNf FEpINToqHoEIXtVvFd5ro6kGdTms349ZO6dYCjCpQGHlqsDlIPPNevocK8S8ZZnZmy ueJpKrgQnOoLlkh6CYLIMBOc5v2A1NlDnIh1p+Y/FFj3o69A/YdoGRTTWRRuAEYJpi z5U5a3yoBnX9EICn/+Q2tD/PX1zSqPL5EXmj3JhN/heNviySXlqthEn+tZ53wok5w0 F/YQ40HXklfKQ== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) 1. emacs -Q 2. Position point over a button.el button, e.g. (progn (view-emacs-news) (forward-button 1)) 3. mouse-2 anywhere on the mode line. 4. Note that instead of the usual mouse-delete-other-windows binding, the button at point is activated. This is because the local keymap for buttons is button-map, which binds " ". This is confusing, and probably a bug, but not too bad of a bug. Substantially worse is this: 5. mouse-1 on a part of the mode-line with a mouse-1 binding; for example, mouse-1 on the buffer coding system indicator "U" at the start of the mode line. 6. Instead of describing the buffer's coding system, the button at point is activated. This is because mouse-1-click-follows-link translates the mouse-1 into a mouse-2. This makes all mouse-1 bindings on the mode line basically broken while point is on a button. The mode-line (and header-line) binding was added to button.el in 24fc9480399b2d018e8d85f34e9c5d8c327ce3bf to support using buttons in the mode-line and header-line. I suggest that we should remove those bindings, in favor of some other way to use button.el in the mode-line or header-line. Especially because, from grepping through ~400 popular packages (the ones installed at my site), I see no usage of buttons in the mode-line or header-line. In GNU Emacs 30.1.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2025-02-24 built on igm-qws-u22796a Repository revision: b3f0c1a30a1fee5a81b7a0c6c7f52ec0ef5bade6 Repository branch: emacs-30 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.10 (Green Obsidian) Configured using: 'configure --config-cache --with-x-toolkit=lucid --without-gpm --without-gconf --without-selinux --without-imagemagick --with-modules --with-gif=no --with-cairo --with-rsvg --without-compress-install --with-tree-sitter' Configured features: CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr compile comint ansi-osc ansi-color ring comp-run bytecomp byte-compile comp-common rx emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 92421 9053) (symbols 48 6739 0) (strings 32 26097 2919) (string-bytes 1 786157) (vectors 16 16424) (vector-slots 8 188776 8192) (floats 8 37 1) (intervals 56 320 0) (buffers 992 11)) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 28 02:52:28 2025 Received: (at 76620) by debbugs.gnu.org; 28 Feb 2025 07:52:29 +0000 Received: from localhost ([127.0.0.1]:44541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tnvAZ-0002Wn-8S for submit@debbugs.gnu.org; Fri, 28 Feb 2025 02:52:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45134) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tnvAT-0002VW-2h for 76620@debbugs.gnu.org; Fri, 28 Feb 2025 02:52:21 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnvAK-0006j6-WD; Fri, 28 Feb 2025 02:52:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=U3P12pG6p9IR/NS0B/1iy6XIAgvXGMSaCcyZMUZfSAA=; b=jUgocm4w0Rrc Fut7jAPu/czYcmy5yXKLFXf+zvTS7SHI6M15DbuYo3gw3OWO8ovJHjrnakVv5EbW+wyQ7en9CEm3/ TbQpt9w0nIpeEWzbKl6o/cFJJ/nwgRi0exqH6CCGYYgQSs7o5ondzTrVaZymxldGnvkbCO5vuGnQ6 pupgY2Fc2vHVCVIp94PAxHDsdUFnMJnC7DSLPnLAZBcjPFtH06fN/yQJlT9hb8YUmken0HP/bUMGD b8174MkuZh28tUz1OTc55tXD2mOITUfA4rYiHbuh/f0GTCMv6d4uzZBVlF2LcJojKpK7HwtRSejM5 B7tUgKTypx66DxN4zqKYVQ==; Date: Fri, 28 Feb 2025 09:52:10 +0200 Message-Id: <86tt8esdzp.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh , Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: 76620@debbugs.gnu.org, jonas@bernoul.li 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 (---) > Cc: Jonas Bernoulli > Date: Thu, 27 Feb 2025 18:11:36 -0500 > From: Spencer Baugh via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > 1. emacs -Q > 2. Position point over a button.el button, e.g. > (progn (view-emacs-news) (forward-button 1)) > 3. mouse-2 anywhere on the mode line. > 4. Note that instead of the usual mouse-delete-other-windows binding, > the button at point is activated. > > This is because the local keymap for buttons is button-map, which binds > " ". This is confusing, and probably a bug, but not > too bad of a bug. > > Substantially worse is this: > > 5. mouse-1 on a part of the mode-line with a mouse-1 binding; for > example, mouse-1 on the buffer coding system indicator "U" at the > start of the mode line. > > 6. Instead of describing the buffer's coding system, the button at point > is activated. > > This is because mouse-1-click-follows-link translates the mouse-1 into a > mouse-2. This makes all mouse-1 bindings on the mode line basically > broken while point is on a button. The bugs with mouse-1 are solved on the master branch (see bug#75219). So I can reproduce the last two items in Emacs 30, but not in Emacs 31. The problems with mouse-2 are still present on the master branch. > The mode-line (and header-line) binding was added to button.el in > 24fc9480399b2d018e8d85f34e9c5d8c327ce3bf to support using buttons in the > mode-line and header-line. I suggest that we should remove those > bindings, in favor of some other way to use button.el in the mode-line > or header-line. Especially because, from grepping through ~400 popular > packages (the ones installed at my site), I see no usage of buttons in > the mode-line or header-line. Adding Stefan to the discussion. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 28 03:27:20 2025 Received: (at 76620) by debbugs.gnu.org; 28 Feb 2025 08:27:20 +0000 Received: from localhost ([127.0.0.1]:44784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tnviK-0005Ey-Au for submit@debbugs.gnu.org; Fri, 28 Feb 2025 03:27:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45186) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tnviH-0005Ei-Dm for 76620@debbugs.gnu.org; Fri, 28 Feb 2025 03:27:18 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tnvi8-0002ED-SR; Fri, 28 Feb 2025 03:27:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qMIDeQsklv+YmlzG8znXs0skpmqUFXZvG6E6/TB7sTE=; b=oSFoh2zv7nih t0MtTcIU0GzX4LlWjjhQQGXrviKZV7Cu87tPzvdpLsn07HGGkeEojetIa6n2t+xwceyVr0EFZs+TS Ianu7kGiP1cgVemyjd/CefRIKAhI+FBLQNU5MFuhAkxruO2/XStQXtYjPlGHH1hgocLx9cDd9Vuxy tzRPHvqpUyjz6jUCBgsXuYHNzwTKzX8Cv/m3Qm6UPEastCXMXmcaaC2xn8FSjpUYYfyo5LSoDYCR5 TjJ/1vqa6ycLyDKjfOAUnhYcMrwOAHrvbN+aAx1YNJlh0DpjPTL9ayh/9ae9XGD1FEXqIJ+CHgYhd sn+8UCCng59kcnvT6RZxNQ==; Date: Fri, 28 Feb 2025 10:27:04 +0200 Message-Id: <86ldtqscdj.fsf@gnu.org> From: Eli Zaretskii To: sbaugh@janestreet.com, monnier@iro.umontreal.ca In-Reply-To: <86tt8esdzp.fsf@gnu.org> (message from Eli Zaretskii on Fri, 28 Feb 2025 09:52:10 +0200) Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button References: <86tt8esdzp.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: 76620@debbugs.gnu.org, jonas@bernoul.li 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 (---) > Cc: 76620@debbugs.gnu.org, jonas@bernoul.li > Date: Fri, 28 Feb 2025 09:52:10 +0200 > From: Eli Zaretskii > > > 5. mouse-1 on a part of the mode-line with a mouse-1 binding; for > > example, mouse-1 on the buffer coding system indicator "U" at the > > start of the mode line. > > > > 6. Instead of describing the buffer's coding system, the button at point > > is activated. > > > > This is because mouse-1-click-follows-link translates the mouse-1 into a > > mouse-2. This makes all mouse-1 bindings on the mode line basically > > broken while point is on a button. > > The bugs with mouse-1 are solved on the master branch (see bug#75219). > So I can reproduce the last two items in Emacs 30, but not in Emacs > 31. The problems with mouse-2 are still present on the master branch. I've now cherry-picked that fix to the emacs-30 branch, so the issues with mouse-1 on the mode line in this situation should be solved in Emacs 30.2. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 28 10:44:15 2025 Received: (at 76620) by debbugs.gnu.org; 28 Feb 2025 15:44:16 +0000 Received: from localhost ([127.0.0.1]:51047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1to2X9-0003Oc-Hq for submit@debbugs.gnu.org; Fri, 28 Feb 2025 10:44:15 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7969) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1to2X2-0003Nk-TS for 76620@debbugs.gnu.org; Fri, 28 Feb 2025 10:44:12 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E63C3442E4E; Fri, 28 Feb 2025 10:44:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1740757441; bh=OZgjIbariDuasfHonIrM55O1mPY3MX5VnmyD/UBJofY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=SMVa4by1w6uPrElJWOA3LDKhFreUxVajA1TRmfixbtWD6c/3JF48ySqq5SZ8UXxYj FA5xq4UfTgo4qOFo7LxjOfU72j1urzIzKcsIq6xnOdzq7ISz+Cxgireq7XXY75+q3D tSJBxtWJAzZ00uujR+fpGlkqHadHfveSrjCw2SpAk8N82xzmFqQvyoC1JnRzCHcax0 vRxUYtMZ/xNLvFiAwY7sQXBidMPamNa8KyawsLHVEXgrnG2FgvplESyxu3JLjf88Ug ZofapX06ktT28igS3SrBfpLzqBbxheD1CfUw58Hdp5Mo4vK9i5CM5GAjTKdqF1PIJL LxR+9WgeRFulw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C8BC744084B; Fri, 28 Feb 2025 10:44:01 -0500 (EST) Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A3840120541; Fri, 28 Feb 2025 10:44:01 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button In-Reply-To: <86tt8esdzp.fsf@gnu.org> Message-ID: References: <86tt8esdzp.fsf@gnu.org> Date: Fri, 28 Feb 2025 10:44:00 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.014 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: Spencer Baugh , 76620@debbugs.gnu.org, jonas@bernoul.li 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 (---) >> The mode-line (and header-line) binding was added to button.el in >> 24fc9480399b2d018e8d85f34e9c5d8c327ce3bf to support using buttons in the >> mode-line and header-line. I suggest that we should remove those >> bindings, in favor of some other way to use button.el in the mode-line >> or header-line. Especially because, from grepping through ~400 popular >> packages (the ones installed at my site), I see no usage of buttons in >> the mode-line or header-line. > > Adding Stefan to the discussion. FWIW, I've used code which used the same text (with buttons) in the header-line and in the buffer. But yeah, that was more an experiment than anything. I don't think I still use such code. So, it's a "nice to have" but not if it breaks something else. [ In another similar experiment, I tried to make an "in-buffer toolbar", but for that one using the same data was simply not an option, I needed a translation function. ] Seeing some of the crazy things some people do in fancy packages, I wouldn't be completely surprised to hear that some people actually use such things rather than just experiment with them. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 09 05:50:33 2025 Received: (at 76620) by debbugs.gnu.org; 9 Mar 2025 09:50:33 +0000 Received: from localhost ([127.0.0.1]:58389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trDIm-0005Z5-Vc for submit@debbugs.gnu.org; Sun, 09 Mar 2025 05:50:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41716) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1trDIl-0005Yu-Fd for 76620@debbugs.gnu.org; Sun, 09 Mar 2025 05:50:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1trDIc-0006Z7-KK; Sun, 09 Mar 2025 05:50:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=g5HNksrj1ZqlcndQIMoENR4FOZqzBTnYxkHOX9EZig0=; b=dwIobXUdkKBO 2nA/KZHee7NWofu7VzZ4L0HGRcQbvIvRD5FGePZ0k5ZlBE8iB05H8PaLAiqnQu753ywtDO5lt6wz5 ZQlmYs4trsa5fImA/VVBjcMexqMOQEKqBnFHp++yg+2o3tZjh38ZSRGa2I+47OHs0QdBtaB9YLxT/ 5kkmduES7VUa1g+pANPU923x8BsklATxYDkPGzl0NkqP/GCgIHpnr3saoCXD9obzfrhmAmF1Xm3qC XNyuEVDZxuOz27qEdQhYBs4+y1dEMoSmkM14JUd69hMov0t0JtpouewwwzqNTSCwi5sMQKOr7ROez LxgTxIOpTlbOvrDoEnOwbw==; Date: Sun, 09 Mar 2025 11:50:20 +0200 Message-Id: <86bjuah6sj.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Fri, 28 Feb 2025 10:44:00 -0500) Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button References: <86tt8esdzp.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: sbaugh@janestreet.com, 76620@debbugs.gnu.org, jonas@bernoul.li 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: Stefan Monnier > Cc: Spencer Baugh , 76620@debbugs.gnu.org, > jonas@bernoul.li > Date: Fri, 28 Feb 2025 10:44:00 -0500 > > >> The mode-line (and header-line) binding was added to button.el in > >> 24fc9480399b2d018e8d85f34e9c5d8c327ce3bf to support using buttons in the > >> mode-line and header-line. I suggest that we should remove those > >> bindings, in favor of some other way to use button.el in the mode-line > >> or header-line. Especially because, from grepping through ~400 popular > >> packages (the ones installed at my site), I see no usage of buttons in > >> the mode-line or header-line. > > > > Adding Stefan to the discussion. > > FWIW, I've used code which used the same text (with buttons) in > the header-line and in the buffer. But yeah, that was more an > experiment than anything. I don't think I still use such code. > So, it's a "nice to have" but not if it breaks something else. So, on balance, you think we should revert commit 24fc9480399b2d018e8d85f34e9c5d8c327ce3bf? From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 09 18:25:37 2025 Received: (at 76620) by debbugs.gnu.org; 9 Mar 2025 22:25:37 +0000 Received: from localhost ([127.0.0.1]:34863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1trP5V-0004GG-5o for submit@debbugs.gnu.org; Sun, 09 Mar 2025 18:25:37 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57985) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1trP5S-0004Fv-95 for 76620@debbugs.gnu.org; Sun, 09 Mar 2025 18:25:34 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DF460809AC; Sun, 9 Mar 2025 18:25:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1741559126; bh=PZqfOrfWLI5fvJwXT6cTeAdimb6CCyCniGfrU5cLFgE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QuafIozGS0lW4RxFKy34qEvq3ixlhLD5ug2faenI4+i2s2ylgdA3VsNl1xhGPQqKD XK7qs0y03PSZU6dJIvH2Im9OcMEDqBcmfBcPX6MX6am9IQuFSgXZ9AacK7R4NRfcdV WwJMBXr6YU0XmdXFPdFKNwaijU2xGL2Wlzp34xmhKViT9CqHd0uTD4pb7svfzoAlqb aDlQcGnAoxpxgGWe3jkTt/obLhv27NHT5BEFxJBilaasNqRMXQmGxSQWbCqzfg49ag iGyFCZDoS9g6j02hJjjen7XLUUnBARlp4gnf00c/LNKYMSxxwUB/GtpAfG+E96pXDs oNJh+ycvvdoMA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F05EE807F9; Sun, 9 Mar 2025 18:25:25 -0400 (EDT) Received: from alfajor (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B877F120642; Sun, 9 Mar 2025 18:25:25 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button In-Reply-To: <86bjuah6sj.fsf@gnu.org> Message-ID: References: <86tt8esdzp.fsf@gnu.org> <86bjuah6sj.fsf@gnu.org> Date: Sun, 09 Mar 2025 18:25:24 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.272 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: sbaugh@janestreet.com, 76620@debbugs.gnu.org, jonas@bernoul.li 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 (---) >> FWIW, I've used code which used the same text (with buttons) in >> the header-line and in the buffer. But yeah, that was more an >> experiment than anything. I don't think I still use such code. >> So, it's a "nice to have" but not if it breaks something else. > > So, on balance, you think we should revert commit > 24fc9480399b2d018e8d85f34e9c5d8c327ce3bf? I haven't looked at the problem closely enough to have an opinion, sorry. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 28 14:22:44 2025 Received: (at 76620) by debbugs.gnu.org; 28 Aug 2025 18:22:44 +0000 Received: from localhost ([127.0.0.1]:39951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1urhGl-0001Ls-Lm for submit@debbugs.gnu.org; Thu, 28 Aug 2025 14:22:44 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:44869) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1urhGh-0001Kd-Iy for 76620@debbugs.gnu.org; Thu, 28 Aug 2025 14:22:41 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button In-Reply-To: <86tt8esdzp.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 Feb 2025 09:52:10 +0200") References: <86tt8esdzp.fsf@gnu.org> Date: Thu, 28 Aug 2025 14:22:32 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1756405353; bh=R8a6c0kn9dKlvFctAK3LtHoPXEFF2LkqVDzpf8Zet5k=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=p0a63rOmUlfXLzsdESFiMIijOLbpr8OdGsBIOF92HwDnrguZ7YmlGGrCOR+WbAQFl Y+KDvBkTd7kQRJmlVYRT7FQJj6DZZ89lx5ETC45cBxZNMn7z9yhZpCXxJdL7jpCYTa moe1RyGbeWoxdZaEefCGEkp7eIc8JZrC7ga6eD3kAm4chX5FaKTgjBTwHBi2P6MDlZ 73KY9toBDoj2/l1I/RBOWnX3MQZPaqEGHkXrD0tAllHRqQYB+rXT8MDfvxB72Y1SKz xpCGfg5ZpNZmjMvKPe7XksG/I8JD/YBeR9bJ/TofFUCNo6h456E7UWTo4crfufkbAs 5LRpkm7UzkJtg== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: 76620@debbugs.gnu.org, jonas@bernoul.li, Stefan Monnier 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 (---) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Cc: Jonas Bernoulli >> Date: Thu, 27 Feb 2025 18:11:36 -0500 >> From: Spencer Baugh via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> >> 1. emacs -Q >> 2. Position point over a button.el button, e.g. >> (progn (view-emacs-news) (forward-button 1)) >> 3. mouse-2 anywhere on the mode line. >> 4. Note that instead of the usual mouse-delete-other-windows binding, >> the button at point is activated. >> >> This is because the local keymap for buttons is button-map, which binds >> " ". This is confusing, and probably a bug, but not >> too bad of a bug. >> >> Substantially worse is this: >> >> 5. mouse-1 on a part of the mode-line with a mouse-1 binding; for >> example, mouse-1 on the buffer coding system indicator "U" at the >> start of the mode line. >> >> 6. Instead of describing the buffer's coding system, the button at point >> is activated. >> >> This is because mouse-1-click-follows-link translates the mouse-1 into a >> mouse-2. This makes all mouse-1 bindings on the mode line basically >> broken while point is on a button. > > The bugs with mouse-1 are solved on the master branch (see bug#75219). > So I can reproduce the last two items in Emacs 30, but not in Emacs > 31. The problems with mouse-2 are still present on the master branch. The attached patch should fix the remaining bug, without dropping support for button.el in the mode-line or header-line. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Always-ignore-keymaps-at-point-when-clicking-mode-an.patch >From 1ebb6e8822b5fc635549be14a3d4f2dd6f2d77a4 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Thu, 28 Aug 2025 14:13:24 -0400 Subject: [PATCH] Always ignore keymaps at point when clicking mode and header line In c41ea047a43, we started ignoring the keymap at point when a position is a click on the mode line or header line. However, we only did this when POSN_STRING was non-nil, which isn't always the case for clicks on the mode line and header line. Move the check for mode line or header line outside the check for non-nil POSN_STRING so it takes effect in that case. * src/keymap.c (Fcurrent_active_maps): Ignore keymaps at point for all clicks on mode and header line. (bug#76620) --- src/keymap.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index 2c250578b00..263bf336a71 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1735,6 +1735,16 @@ DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps, } } + Lisp_Object pos_area = POSN_POSN (position); + if (EQ (pos_area, Qmode_line) || EQ (pos_area, Qheader_line)) + { + /* For clicks on mode line or header line, ignore the maps + we found at POSITION, because properties at point are + not relevant in that case. */ + local_map = Qnil; + keymap = Qnil; + } + /* If on a mode line string with a local keymap, or for a click on a string, i.e. overlay string or a string displayed via the `display' property, @@ -1751,20 +1761,10 @@ DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps, { Lisp_Object map = Fget_text_property (pos, Qlocal_map, string); - Lisp_Object pos_area = POSN_POSN (position); - /* For clicks on mode line or header line, override - the maps we found at POSITION unconditionally, even - if the corresponding properties of the mode- or - header-line string are nil, because propertries at - point are not relevant in that case. */ - if (!NILP (map) - || EQ (pos_area, Qmode_line) - || EQ (pos_area, Qheader_line)) + if (!NILP (map)) local_map = map; map = Fget_text_property (pos, Qkeymap, string); - if (!NILP (map) - || EQ (pos_area, Qmode_line) - || EQ (pos_area, Qheader_line)) + if (!NILP (map)) keymap = map; } } -- 2.43.7 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 30 06:55:33 2025 Received: (at 76620) by debbugs.gnu.org; 30 Aug 2025 10:55:33 +0000 Received: from localhost ([127.0.0.1]:45552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usJF6-0001ei-Rx for submit@debbugs.gnu.org; Sat, 30 Aug 2025 06:55:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53386) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usJF2-0001dW-IY for 76620@debbugs.gnu.org; Sat, 30 Aug 2025 06:55:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1usJEv-0002zC-MV; Sat, 30 Aug 2025 06:55:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=8C+Tb5zNLZR/Y4TWb63fBgkN2k6wcMCxjx1XmGFOuIA=; b=hrOQhjoJ+J22 6G503i4qv8LDkR34hRq3bpiiEVgBrWHR8exPtNmugDfcSa6zeM6KmajhwiUcuJfhMj/92Uvt/T9w4 M24d1Z8M54rzQ+NybGY7RQhGhR1Kdp98Kzu3WJ+rw7ejOK80P8WQkJP/m1owEPlnYVua/Km3u76wh oiF+84xyjP3TetwOuEXcKbQSkAXUEY57AB42EyvIFuf/xC+gpzfNBIX73S+S6QR/LtO0zvgLA1wj1 vr+YSj0bNB9OrPNgu2HEIz9ufIC4tjuYBgJ43eLyeMZ1o1yVLyh6gZWRkT9tsUQRddc/NowJrxKSe 03bgQNWF3UbFvfTWsNfrNA==; Date: Sat, 30 Aug 2025 13:55:18 +0300 Message-Id: <86seh9oz8p.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Thu, 28 Aug 2025 14:22:32 -0400) Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button References: <86tt8esdzp.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: 76620@debbugs.gnu.org, jonas@bernoul.li, monnier@iro.umontreal.ca 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: Spencer Baugh > Cc: Stefan Monnier , 76620@debbugs.gnu.org, > jonas@bernoul.li > Date: Thu, 28 Aug 2025 14:22:32 -0400 > > Eli Zaretskii writes: > > >> Cc: Jonas Bernoulli > >> Date: Thu, 27 Feb 2025 18:11:36 -0500 > >> From: Spencer Baugh via "Bug reports for GNU Emacs, > >> the Swiss army knife of text editors" > >> > >> > >> 1. emacs -Q > >> 2. Position point over a button.el button, e.g. > >> (progn (view-emacs-news) (forward-button 1)) > >> 3. mouse-2 anywhere on the mode line. > >> 4. Note that instead of the usual mouse-delete-other-windows binding, > >> the button at point is activated. > >> > >> This is because the local keymap for buttons is button-map, which binds > >> " ". This is confusing, and probably a bug, but not > >> too bad of a bug. > >> > >> Substantially worse is this: > >> > >> 5. mouse-1 on a part of the mode-line with a mouse-1 binding; for > >> example, mouse-1 on the buffer coding system indicator "U" at the > >> start of the mode line. > >> > >> 6. Instead of describing the buffer's coding system, the button at point > >> is activated. > >> > >> This is because mouse-1-click-follows-link translates the mouse-1 into a > >> mouse-2. This makes all mouse-1 bindings on the mode line basically > >> broken while point is on a button. > > > > The bugs with mouse-1 are solved on the master branch (see bug#75219). > > So I can reproduce the last two items in Emacs 30, but not in Emacs > > 31. The problems with mouse-2 are still present on the master branch. > > The attached patch should fix the remaining bug, without dropping > support for button.el in the mode-line or header-line. > > >From 1ebb6e8822b5fc635549be14a3d4f2dd6f2d77a4 Mon Sep 17 00:00:00 2001 > From: Spencer Baugh > Date: Thu, 28 Aug 2025 14:13:24 -0400 > Subject: [PATCH] Always ignore keymaps at point when clicking mode and header > line > > In c41ea047a43, we started ignoring the keymap at point when a > position is a click on the mode line or header line. However, > we only did this when POSN_STRING was non-nil, which isn't > always the case for clicks on the mode line and header line. > Move the check for mode line or header line outside the check > for non-nil POSN_STRING so it takes effect in that case. > > * src/keymap.c (Fcurrent_active_maps): Ignore keymaps at point > for all clicks on mode and header line. (bug#76620) I'm not sure I understand the logic of this change, so please elaborate, by showing the form(s) of POSITION for which the current code doesn't work, and please explain how this patch fixes that. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 30 09:37:55 2025 Received: (at 76620) by debbugs.gnu.org; 30 Aug 2025 13:37:55 +0000 Received: from localhost ([127.0.0.1]:46936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usLmF-0007uh-1k for submit@debbugs.gnu.org; Sat, 30 Aug 2025 09:37:55 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:47543) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usLmC-0007ty-0R for 76620@debbugs.gnu.org; Sat, 30 Aug 2025 09:37:52 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button In-Reply-To: <86seh9oz8p.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Aug 2025 13:55:18 +0300") References: <86tt8esdzp.fsf@gnu.org> <86seh9oz8p.fsf@gnu.org> Date: Sat, 30 Aug 2025 09:37:46 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1756561066; bh=qPOL04bwkoC+TZOJ7LCiUo+9UbVMs6O66T1e4a2Rh8Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=29mZ3M4AG9Smld1VHNRSmYuDvjlE4ofaG6ZILSKg1ec2sgkqc0ASpDKyOD/E1MNd+ bz/U8Sn1+4xAP/t9JUOKW+TiypMSNrce43ZP00j+KVAZcY/FYA8sw+OI7BWWn+5GTF gmYkrMZ1pDywxdp98ePom4UQoMHVamXv2dZliuSQ2GaTZC/sk5gftcGupzq3nVTf/Z Dvd+LE73I1zuPrOBf5n/GcnQJaB+iy5CUIMjFrPpdwrcFyjgVgNp+NtiC6eoN29olc +N94S9BHVIx9ivwl8anBhEB8HSR1sQ2/i8PMuvlIiczIfB9MV4hyY9aR63P/3/SrTA bwp/VVl1ixehg== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: 76620@debbugs.gnu.org, jonas@bernoul.li, monnier@iro.umontreal.ca 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 (---) Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: Stefan Monnier , 76620@debbugs.gnu.org, >> jonas@bernoul.li >> Date: Thu, 28 Aug 2025 14:22:32 -0400 >> >> Eli Zaretskii writes: >> >> >> Cc: Jonas Bernoulli >> >> Date: Thu, 27 Feb 2025 18:11:36 -0500 >> >> From: Spencer Baugh via "Bug reports for GNU Emacs, >> >> the Swiss army knife of text editors" >> >> >> >> >> >> 1. emacs -Q >> >> 2. Position point over a button.el button, e.g. >> >> (progn (view-emacs-news) (forward-button 1)) >> >> 3. mouse-2 anywhere on the mode line. >> >> 4. Note that instead of the usual mouse-delete-other-windows binding, >> >> the button at point is activated. >> >> >> >> This is because the local keymap for buttons is button-map, which binds >> >> " ". This is confusing, and probably a bug, but not >> >> too bad of a bug. >> >> >> >> Substantially worse is this: >> >> >> >> 5. mouse-1 on a part of the mode-line with a mouse-1 binding; for >> >> example, mouse-1 on the buffer coding system indicator "U" at the >> >> start of the mode line. >> >> >> >> 6. Instead of describing the buffer's coding system, the button at point >> >> is activated. >> >> >> >> This is because mouse-1-click-follows-link translates the mouse-1 into a >> >> mouse-2. This makes all mouse-1 bindings on the mode line basically >> >> broken while point is on a button. >> > >> > The bugs with mouse-1 are solved on the master branch (see bug#75219). >> > So I can reproduce the last two items in Emacs 30, but not in Emacs >> > 31. The problems with mouse-2 are still present on the master branch. >> >> The attached patch should fix the remaining bug, without dropping >> support for button.el in the mode-line or header-line. >> >> >From 1ebb6e8822b5fc635549be14a3d4f2dd6f2d77a4 Mon Sep 17 00:00:00 2001 >> From: Spencer Baugh >> Date: Thu, 28 Aug 2025 14:13:24 -0400 >> Subject: [PATCH] Always ignore keymaps at point when clicking mode and header >> line >> >> In c41ea047a43, we started ignoring the keymap at point when a >> position is a click on the mode line or header line. However, >> we only did this when POSN_STRING was non-nil, which isn't >> always the case for clicks on the mode line and header line. >> Move the check for mode line or header line outside the check >> for non-nil POSN_STRING so it takes effect in that case. >> >> * src/keymap.c (Fcurrent_active_maps): Ignore keymaps at point >> for all clicks on mode and header line. (bug#76620) > > I'm not sure I understand the logic of this change, so please > elaborate, by showing the form(s) of POSITION for which the current > code doesn't work, and please explain how this patch fixes that. When you click on a part of the mode line which is after the end of mode-line-format, (at least on GNU/Linux) you get an event like this: (down-mouse-1 (# mode-line (2379 . 2071) 21536370 nil nil (157 . 88) nil (8 . 19) (15 . 32))) posn-string is nil for this but it's still in the mode-line. My change checks for whether a position is in the mode-line before checking if posn-string is nil, so it catches such events. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 30 09:51:21 2025 Received: (at 76620) by debbugs.gnu.org; 30 Aug 2025 13:51:21 +0000 Received: from localhost ([127.0.0.1]:47038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usLzE-0000WE-FK for submit@debbugs.gnu.org; Sat, 30 Aug 2025 09:51:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57162) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usLzC-0000Vj-0F for 76620@debbugs.gnu.org; Sat, 30 Aug 2025 09:51:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1usLz5-0008Il-OU; Sat, 30 Aug 2025 09:51:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZifrNZthYs+mNhmXpm46Y/lV0imqDTkPFRZjj0CBrKo=; b=UdcWRwcTKvJi sH9FiWLK2Nu78o3IHZXqMoeoTwdDTM5IVxBcZHCgPbmTBK0Esd38+QqufO3hyguplwbU4Cf+zqttG Nv0ZyBNtEdyo2OWHaNu1k2K2t6OOcNL1eK+kHNW+4WxyAsELcmmm6iFF7VEVhem0LuijudrQd9gF9 VaNg2VFgBGwxIq5AtAEN5i5SJpQL+rkKxu+8eJjGaqUF+ge/tRD3O7OgeTeNIFVXmQVU3cJjMmfDB l+omxNsIWs2hbxRGIXjAg6ImlxSTWdNbPOLTbVzHrQfhZAMRghuW+DYzMwVaM7Lvt8ydS/arl03/Z qsl6EbwjiWKvQhSp5whZ+g==; Date: Sat, 30 Aug 2025 16:50:52 +0300 Message-Id: <86plccq5oj.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Sat, 30 Aug 2025 09:37:46 -0400) Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button References: <86tt8esdzp.fsf@gnu.org> <86seh9oz8p.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: 76620@debbugs.gnu.org, jonas@bernoul.li, monnier@iro.umontreal.ca 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: Spencer Baugh > Cc: 76620@debbugs.gnu.org, jonas@bernoul.li, monnier@iro.umontreal.ca > Date: Sat, 30 Aug 2025 09:37:46 -0400 > > Eli Zaretskii writes: > > >> From: Spencer Baugh > >> Cc: Stefan Monnier , 76620@debbugs.gnu.org, > >> jonas@bernoul.li > >> Date: Thu, 28 Aug 2025 14:22:32 -0400 > >> > >> Eli Zaretskii writes: > >> > >> >> Cc: Jonas Bernoulli > >> >> Date: Thu, 27 Feb 2025 18:11:36 -0500 > >> >> From: Spencer Baugh via "Bug reports for GNU Emacs, > >> >> the Swiss army knife of text editors" > >> >> > >> >> > >> >> 1. emacs -Q > >> >> 2. Position point over a button.el button, e.g. > >> >> (progn (view-emacs-news) (forward-button 1)) > >> >> 3. mouse-2 anywhere on the mode line. > >> >> 4. Note that instead of the usual mouse-delete-other-windows binding, > >> >> the button at point is activated. > >> >> > >> >> This is because the local keymap for buttons is button-map, which binds > >> >> " ". This is confusing, and probably a bug, but not > >> >> too bad of a bug. > >> >> > >> >> Substantially worse is this: > >> >> > >> >> 5. mouse-1 on a part of the mode-line with a mouse-1 binding; for > >> >> example, mouse-1 on the buffer coding system indicator "U" at the > >> >> start of the mode line. > >> >> > >> >> 6. Instead of describing the buffer's coding system, the button at point > >> >> is activated. > >> >> > >> >> This is because mouse-1-click-follows-link translates the mouse-1 into a > >> >> mouse-2. This makes all mouse-1 bindings on the mode line basically > >> >> broken while point is on a button. > >> > > >> > The bugs with mouse-1 are solved on the master branch (see bug#75219). > >> > So I can reproduce the last two items in Emacs 30, but not in Emacs > >> > 31. The problems with mouse-2 are still present on the master branch. > >> > >> The attached patch should fix the remaining bug, without dropping > >> support for button.el in the mode-line or header-line. > >> > >> >From 1ebb6e8822b5fc635549be14a3d4f2dd6f2d77a4 Mon Sep 17 00:00:00 2001 > >> From: Spencer Baugh > >> Date: Thu, 28 Aug 2025 14:13:24 -0400 > >> Subject: [PATCH] Always ignore keymaps at point when clicking mode and header > >> line > >> > >> In c41ea047a43, we started ignoring the keymap at point when a > >> position is a click on the mode line or header line. However, > >> we only did this when POSN_STRING was non-nil, which isn't > >> always the case for clicks on the mode line and header line. > >> Move the check for mode line or header line outside the check > >> for non-nil POSN_STRING so it takes effect in that case. > >> > >> * src/keymap.c (Fcurrent_active_maps): Ignore keymaps at point > >> for all clicks on mode and header line. (bug#76620) > > > > I'm not sure I understand the logic of this change, so please > > elaborate, by showing the form(s) of POSITION for which the current > > code doesn't work, and please explain how this patch fixes that. > > When you click on a part of the mode line which is after the end of > mode-line-format, (at least on GNU/Linux) you get an event like this: > > (down-mouse-1 (# mode-line (2379 . 2071) 21536370 > nil nil (157 . 88) nil (8 . 19) (15 . 32))) > > posn-string is nil for this but it's still in the mode-line. My change > checks for whether a position is in the mode-line before checking if > posn-string is nil, so it catches such events. Ah, okay. But what does this have to do with mouse-2 vs mouse-1? From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 30 10:06:02 2025 Received: (at 76620) by debbugs.gnu.org; 30 Aug 2025 14:06:02 +0000 Received: from localhost ([127.0.0.1]:48250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usMDS-0001zZ-39 for submit@debbugs.gnu.org; Sat, 30 Aug 2025 10:06:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48040) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usMDP-0001yj-45 for 76620@debbugs.gnu.org; Sat, 30 Aug 2025 10:06:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1usMDI-0001Ls-IC; Sat, 30 Aug 2025 10:05:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=C1hmwlS3cArTvnEL0n6CkQLMPZqFVuBcUFm6eGTYb1w=; b=ddvsmkX3cq+d oY4+HuojpZ+1KobMgEIk4YBpoErS2WJOl/5k2PCRmdn0cEvNeC1rp5MUMA1gDDAhdjy4JNylEvxIV YYZkrzb8p0sqbXT9xzkm3Y2IUT+On2y9hyEfFDB2poXp2+rI79hDrETbiHdy73lsSUPTuba+4AoH2 sdK7rHn5CiJm6qR6ALP7GUfSxrK+Vl5jBFwhYxzpXAR1xnjrfBEwVputtuZyYbonUA3OTzxETQKnQ F75j6ucn1YWnUOcI4sFC4hX7n1GZ7U/V3PeoQFIjVbwkzGjbQi0bJqhjOwvI7gUcutWMHOUxO9lfx NvZASc+lzwOT9+YFs3skYw==; Date: Sat, 30 Aug 2025 17:05:49 +0300 Message-Id: <86o6rwq4zm.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Sat, 30 Aug 2025 09:37:46 -0400) Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button References: <86tt8esdzp.fsf@gnu.org> <86seh9oz8p.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: 76620@debbugs.gnu.org, jonas@bernoul.li, monnier@iro.umontreal.ca 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: Spencer Baugh > Cc: 76620@debbugs.gnu.org, jonas@bernoul.li, monnier@iro.umontreal.ca > Date: Sat, 30 Aug 2025 09:37:46 -0400 > > When you click on a part of the mode line which is after the end of > mode-line-format, (at least on GNU/Linux) you get an event like this: > > (down-mouse-1 (# mode-line (2379 . 2071) 21536370 > nil nil (157 . 88) nil (8 . 19) (15 . 32))) > > posn-string is nil for this but it's still in the mode-line. My change > checks for whether a position is in the mode-line before checking if > posn-string is nil, so it catches such events. Btw, please make sure to test on TTY frames as well, AFAICT the format of the event there is somewhat different, since there's no "end of mode-line-format" on TTYs. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 30 11:34:34 2025 Received: (at 76620) by debbugs.gnu.org; 30 Aug 2025 15:34:34 +0000 Received: from localhost ([127.0.0.1]:48919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usNb7-0007Xp-Fe for submit@debbugs.gnu.org; Sat, 30 Aug 2025 11:34:34 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:57503) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usNb4-0007XY-Ii for 76620@debbugs.gnu.org; Sat, 30 Aug 2025 11:34:31 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button In-Reply-To: <86plccq5oj.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Aug 2025 16:50:52 +0300") References: <86tt8esdzp.fsf@gnu.org> <86seh9oz8p.fsf@gnu.org> <86plccq5oj.fsf@gnu.org> Date: Sat, 30 Aug 2025 11:34:24 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1756568064; bh=vQ79ezoYuJXjLqmv1l/cZLSdKa6j38qsA/MgKuWAJ8g=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=LfTmrXdMOkcAcAI4L3AtkQFYz2d84rVQCDsuSjarynLs77gZJ5QwgMf97SHVJT5W8 w4fzuurhDuXTHPLOljqBzDDoFp7UJnGHRofZSYHcGN06Hq59eZ0T/3LZeGmj/efQ62 ua33AGJJvfX7iRcFNjkXyeDoUHO+B/g3WnjuQ7sTuxNYKGLGKsHDy8BpNTxJRazj0x fN7p5o+sSCviizVhj6J0xFpf9NLcR6gMmaPRCavu9tYc5CYKuwuZ3j/+4vB2sKkFZ8 B2x7h0BwMC6D7vRKLxUtRc6x0ga2HFHIc4XHSxyqJLt/32o6DNceGSphloi9a7f4WI 8iYsw1FsyX2MA== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: 76620@debbugs.gnu.org, jonas@bernoul.li, monnier@iro.umontreal.ca 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 (---) Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: 76620@debbugs.gnu.org, jonas@bernoul.li, monnier@iro.umontreal.ca >> Date: Sat, 30 Aug 2025 09:37:46 -0400 >> >> Eli Zaretskii writes: >> >> >> From: Spencer Baugh >> >> Cc: Stefan Monnier , 76620@debbugs.gnu.org, >> >> jonas@bernoul.li >> >> Date: Thu, 28 Aug 2025 14:22:32 -0400 >> >> >> >> Eli Zaretskii writes: >> >> >> >> >> Cc: Jonas Bernoulli >> >> >> Date: Thu, 27 Feb 2025 18:11:36 -0500 >> >> >> From: Spencer Baugh via "Bug reports for GNU Emacs, >> >> >> the Swiss army knife of text editors" >> >> >> >> >> >> >> >> >> 1. emacs -Q >> >> >> 2. Position point over a button.el button, e.g. >> >> >> (progn (view-emacs-news) (forward-button 1)) >> >> >> 3. mouse-2 anywhere on the mode line. >> >> >> 4. Note that instead of the usual mouse-delete-other-windows binding, >> >> >> the button at point is activated. >> >> >> >> >> >> This is because the local keymap for buttons is button-map, which binds >> >> >> " ". This is confusing, and probably a bug, but not >> >> >> too bad of a bug. >> >> >> >> >> >> Substantially worse is this: >> >> >> >> >> >> 5. mouse-1 on a part of the mode-line with a mouse-1 binding; for >> >> >> example, mouse-1 on the buffer coding system indicator "U" at the >> >> >> start of the mode line. >> >> >> >> >> >> 6. Instead of describing the buffer's coding system, the button at point >> >> >> is activated. >> >> >> >> >> >> This is because mouse-1-click-follows-link translates the mouse-1 into a >> >> >> mouse-2. This makes all mouse-1 bindings on the mode line basically >> >> >> broken while point is on a button. >> >> > >> >> > The bugs with mouse-1 are solved on the master branch (see bug#75219). >> >> > So I can reproduce the last two items in Emacs 30, but not in Emacs >> >> > 31. The problems with mouse-2 are still present on the master branch. >> >> >> >> The attached patch should fix the remaining bug, without dropping >> >> support for button.el in the mode-line or header-line. >> >> >> >> >From 1ebb6e8822b5fc635549be14a3d4f2dd6f2d77a4 Mon Sep 17 00:00:00 2001 >> >> From: Spencer Baugh >> >> Date: Thu, 28 Aug 2025 14:13:24 -0400 >> >> Subject: [PATCH] Always ignore keymaps at point when clicking mode and header >> >> line >> >> >> >> In c41ea047a43, we started ignoring the keymap at point when a >> >> position is a click on the mode line or header line. However, >> >> we only did this when POSN_STRING was non-nil, which isn't >> >> always the case for clicks on the mode line and header line. >> >> Move the check for mode line or header line outside the check >> >> for non-nil POSN_STRING so it takes effect in that case. >> >> >> >> * src/keymap.c (Fcurrent_active_maps): Ignore keymaps at point >> >> for all clicks on mode and header line. (bug#76620) >> > >> > I'm not sure I understand the logic of this change, so please >> > elaborate, by showing the form(s) of POSITION for which the current >> > code doesn't work, and please explain how this patch fixes that. >> >> When you click on a part of the mode line which is after the end of >> mode-line-format, (at least on GNU/Linux) you get an event like this: >> >> (down-mouse-1 (# mode-line (2379 . 2071) 21536370 >> nil nil (157 . 88) nil (8 . 19) (15 . 32))) >> >> posn-string is nil for this but it's still in the mode-line. My change >> checks for whether a position is in the mode-line before checking if >> posn-string is nil, so it catches such events. > > Ah, okay. But what does this have to do with mouse-2 vs mouse-1? Nothing at all - that was a red herring. Fcurrent_active_maps returned the wrong value (a value which included the keymaps at point) for both mouse-2 and mouse-1, when the click was on the part of the mode line after mode-line-format. I think (though haven't checked) that the bug was only observable with mouse-2 because of the quirks of mouse-1-click-follows-link. BTW, I checked and the bug also seems to be fixed on TTY Emacs. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 06 04:40:20 2025 Received: (at 76620) by debbugs.gnu.org; 6 Sep 2025 08:40:20 +0000 Received: from localhost ([127.0.0.1]:34204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uuoT5-0003jP-Ab for submit@debbugs.gnu.org; Sat, 06 Sep 2025 04:40:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60204) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uuoSz-0003dm-IM for 76620@debbugs.gnu.org; Sat, 06 Sep 2025 04:40:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uuoSr-00067F-QZ; Sat, 06 Sep 2025 04:40:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Jn1BfK8LsqvvTg716/SUhWCBconRC2hVtRuPUIlYkiA=; b=O2zE/CLp+DEl XTCxzWnL0Nz0wQTy8SYMAVzC9Qb4ACqWcHrrVjeRbXeT3Edl9t3/JR/qRwEn0jOykThZR4+iQ4MTR LCWDY7zCHodp/HRcl8Td66bv4Ytif2hyJAS3lF6VZf2gzsZxcZ7e8iajdM/AXg80ENshr565DdZrO 8yAz/qUPItz/bvsXJEddlJNHFvBeQc612wkmKKFcTLvrXKqc037IZAeCV2g2tdNvBg26o4BNmHEVF /Kpf8WIoaSHieKlN6Wdug2GNZowCNrt6uBA1naVLKCcjSsS0bTcs7xz6QrnONBPnMIC7u5fjHqk6c wE5Qof+pKMGJWXuLHQBjsQ==; Date: Sat, 06 Sep 2025 11:40:00 +0300 Message-Id: <86y0qsezz3.fsf@gnu.org> From: Eli Zaretskii To: monnier@iro.umontreal.ca, Spencer Baugh In-Reply-To: (message from Spencer Baugh on Thu, 28 Aug 2025 14:22:32 -0400) Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button References: <86tt8esdzp.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: 76620@debbugs.gnu.org, jonas@bernoul.li 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 (---) Stefan, any comments to the patch? > From: Spencer Baugh > Cc: Stefan Monnier , 76620@debbugs.gnu.org, > jonas@bernoul.li > Date: Thu, 28 Aug 2025 14:22:32 -0400 > > Eli Zaretskii writes: > > >> Cc: Jonas Bernoulli > >> Date: Thu, 27 Feb 2025 18:11:36 -0500 > >> From: Spencer Baugh via "Bug reports for GNU Emacs, > >> the Swiss army knife of text editors" > >> > >> > >> 1. emacs -Q > >> 2. Position point over a button.el button, e.g. > >> (progn (view-emacs-news) (forward-button 1)) > >> 3. mouse-2 anywhere on the mode line. > >> 4. Note that instead of the usual mouse-delete-other-windows binding, > >> the button at point is activated. > >> > >> This is because the local keymap for buttons is button-map, which binds > >> " ". This is confusing, and probably a bug, but not > >> too bad of a bug. > >> > >> Substantially worse is this: > >> > >> 5. mouse-1 on a part of the mode-line with a mouse-1 binding; for > >> example, mouse-1 on the buffer coding system indicator "U" at the > >> start of the mode line. > >> > >> 6. Instead of describing the buffer's coding system, the button at point > >> is activated. > >> > >> This is because mouse-1-click-follows-link translates the mouse-1 into a > >> mouse-2. This makes all mouse-1 bindings on the mode line basically > >> broken while point is on a button. > > > > The bugs with mouse-1 are solved on the master branch (see bug#75219). > > So I can reproduce the last two items in Emacs 30, but not in Emacs > > 31. The problems with mouse-2 are still present on the master branch. > > The attached patch should fix the remaining bug, without dropping > support for button.el in the mode-line or header-line. > > >From 1ebb6e8822b5fc635549be14a3d4f2dd6f2d77a4 Mon Sep 17 00:00:00 2001 > From: Spencer Baugh > Date: Thu, 28 Aug 2025 14:13:24 -0400 > Subject: [PATCH] Always ignore keymaps at point when clicking mode and header > line > > In c41ea047a43, we started ignoring the keymap at point when a > position is a click on the mode line or header line. However, > we only did this when POSN_STRING was non-nil, which isn't > always the case for clicks on the mode line and header line. > Move the check for mode line or header line outside the check > for non-nil POSN_STRING so it takes effect in that case. > > * src/keymap.c (Fcurrent_active_maps): Ignore keymaps at point > for all clicks on mode and header line. (bug#76620) > --- > src/keymap.c | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/src/keymap.c b/src/keymap.c > index 2c250578b00..263bf336a71 100644 > --- a/src/keymap.c > +++ b/src/keymap.c > @@ -1735,6 +1735,16 @@ DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps, > } > } > > + Lisp_Object pos_area = POSN_POSN (position); > + if (EQ (pos_area, Qmode_line) || EQ (pos_area, Qheader_line)) > + { > + /* For clicks on mode line or header line, ignore the maps > + we found at POSITION, because properties at point are > + not relevant in that case. */ > + local_map = Qnil; > + keymap = Qnil; > + } > + > /* If on a mode line string with a local keymap, > or for a click on a string, i.e. overlay string or a > string displayed via the `display' property, > @@ -1751,20 +1761,10 @@ DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps, > { > Lisp_Object map = Fget_text_property (pos, Qlocal_map, > string); > - Lisp_Object pos_area = POSN_POSN (position); > - /* For clicks on mode line or header line, override > - the maps we found at POSITION unconditionally, even > - if the corresponding properties of the mode- or > - header-line string are nil, because propertries at > - point are not relevant in that case. */ > - if (!NILP (map) > - || EQ (pos_area, Qmode_line) > - || EQ (pos_area, Qheader_line)) > + if (!NILP (map)) > local_map = map; > map = Fget_text_property (pos, Qkeymap, string); > - if (!NILP (map) > - || EQ (pos_area, Qmode_line) > - || EQ (pos_area, Qheader_line)) > + if (!NILP (map)) > keymap = map; > } > } > -- > 2.43.7 > From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 07 11:21:18 2025 Received: (at 76620) by debbugs.gnu.org; 7 Sep 2025 15:21:18 +0000 Received: from localhost ([127.0.0.1]:45061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvHCf-0003Z1-79 for submit@debbugs.gnu.org; Sun, 07 Sep 2025 11:21:18 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60125) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvHCc-0003Yg-ER for 76620@debbugs.gnu.org; Sun, 07 Sep 2025 11:21:14 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B60C910013E; Sun, 7 Sep 2025 11:21:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1757258466; bh=nrwkZIakU9BMTb6o4R5ZYpjbbiUPvkDxMEoM3FpiMNY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=gxHovF209JspjLuCpJviU+UDZx/mlJ4JIEBgamqyj0DvUxy+6mmY0JG0OUBLXmuRj 7g8h2XUbzG6FnwSs36WGdt+Fo9jzoYreAUmu8tPWfBS5GPMDtv+WPtL8TLtNyTt+GX BtpeDkxiDNBnkybkyTPzRhOhHmfkftDNmhghKZWUH49OAYY5h86m/UoTVyc9yzDB2q UHz0LSfNrZb1nkg5wNm7mygNeofInzsdUZbXZBHTwegSkEmiI5gTyr6CEsQS0TEB4T pjxStMD2cBGN1NX0Nhs7hFcapE2/dVMK/ovRQM/UnePVRCmgK3ZVE6QcXYeVAx/9kG L+9Xd4tYgM2rw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DB57A100034; Sun, 7 Sep 2025 11:21:06 -0400 (EDT) Received: from pastel (104-195-222-212.cpe.teksavvy.com [104.195.222.212]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A3D8D1202C5; Sun, 7 Sep 2025 11:21:06 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button In-Reply-To: Message-ID: References: <86tt8esdzp.fsf@gnu.org> <86seh9oz8p.fsf@gnu.org> Date: Sun, 07 Sep 2025 11:21:06 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.213 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: Eli Zaretskii , jonas@bernoul.li, 76620@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I'm not sure I understand the logic of this change, so please >> elaborate, by showing the form(s) of POSITION for which the current >> code doesn't work, and please explain how this patch fixes that. > When you click on a part of the mode line which is after the end of > mode-line-format, (at least on GNU/Linux) you get an event like this: > > (down-mouse-1 (# mode-line (2379 . 2071) 21536370 > nil nil (157 . 88) nil (8 . 19) (15 . 32))) > > posn-string is nil for this but it's still in the mode-line. My change > checks for whether a position is in the mode-line before checking if > posn-string is nil, so it catches such events. I suspect this answer (in one way or another) should find its way either into a comment or into the commit message. [ I tend to have that impression for most questions that occur during a code review, tho, so maybe it's just me. ] I have a more demanding request: any chance we could concoct an ERT test for that? I realize that it might be difficult, but we keep skipping such "UI" tests because they're difficult, so I think we should try to slowly get closer to having an actual test suite of the UI elements. If you can identify one obstacle that makes it currently impossible, maybe we can fix that obstacle, and thus make one step in that direction. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 08 16:50:13 2025 Received: (at 76620) by debbugs.gnu.org; 8 Sep 2025 20:50:13 +0000 Received: from localhost ([127.0.0.1]:53014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvioV-0001B9-UQ for submit@debbugs.gnu.org; Mon, 08 Sep 2025 16:50:13 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:47795) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvioP-00018y-TW for 76620@debbugs.gnu.org; Mon, 08 Sep 2025 16:50:08 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button In-Reply-To: (Stefan Monnier's message of "Sun, 07 Sep 2025 11:21:06 -0400") References: <86tt8esdzp.fsf@gnu.org> <86seh9oz8p.fsf@gnu.org> Date: Mon, 08 Sep 2025 16:49:59 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1757364599; bh=MZrvbWcqfXu7PVjwMau2Xb1ovrUV3viERj8G/n3nQ+c=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=WHKrWFyc6H3uzZimNtCZtkk8qir4GZ3N+26+Osn18dpe2Td+5YHFQeDX48TO0vrJa /ha131X9bqf68eLVnnyrCnqford/CwZDSq1DJJbSS9r+n9UTWj75s0WS177DwA/a0j pQQpsq9q/5E2tXti2PF90JSOxrcZ/Ve2HKPqmYraHj52FytMxj4m9FRYWCDqOk8Fs2 qT02FEb3ujnRRJQk9lYPGP+P+emGDX6AWwPjsd4qjWYahvp7buSn8lnDue+oYujhaE S8rJUBA2GQ237Viljgznb7yn9SGScO95vJ+GzEFPDq3TitK6fCYWgRzK6dydyJVraH ykcaBxECp/6bQ== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: Eli Zaretskii , jonas@bernoul.li, 76620@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Stefan Monnier writes: >>> I'm not sure I understand the logic of this change, so please >>> elaborate, by showing the form(s) of POSITION for which the current >>> code doesn't work, and please explain how this patch fixes that. >> When you click on a part of the mode line which is after the end of >> mode-line-format, (at least on GNU/Linux) you get an event like this: >> >> (down-mouse-1 (# mode-line (2379 . 2071) 21536370 >> nil nil (157 . 88) nil (8 . 19) (15 . 32))) >> >> posn-string is nil for this but it's still in the mode-line. My change >> checks for whether a position is in the mode-line before checking if >> posn-string is nil, so it catches such events. > > I suspect this answer (in one way or another) should find its way either > into a comment or into the commit message. > [ I tend to have that impression for most questions that occur during > a code review, tho, so maybe it's just me. ] I agree, I added it to the commit message. > I have a more demanding request: any chance we could concoct an ERT test > for that? I realize that it might be difficult, but we keep skipping > such "UI" tests because they're difficult, so I think we should try to > slowly get closer to having an actual test suite of the UI elements. > If you can identify one obstacle that makes it currently impossible, > maybe we can fix that obstacle, and thus make one step in that direction. A very reasonable request, I think. How about the test in the attached patch? It's not really an end-to-end test, but I think it's still useful. In fact, while writing this test, I noticed another bug in this code, which I've now also fixed. Good call :) The test would be improved if we had a nice way to generate click events from Lisp. Then I could write some code which does "click on the mode line" and test that that has the right behavior. But I have no idea how to do that, is there even a way? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Ignore-keymaps-at-point-for-positions-outside-the-bu.patch >From 40881a88b06f3f6bbda2f48b7be908ef49e02d74 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Thu, 28 Aug 2025 14:13:24 -0400 Subject: [PATCH] Ignore keymaps at point for positions outside the buffer Correct a few edge cases where we used the keymaps at point when looking up keymaps for an event position which is outside the current buffer. Namely: - Clicking on a part of the mode line which is after the end of mode-line-format produces an event with non-nil posn-area but nil posn-string. - Even if posn-string doesn't have a local keymap, we should still ignore the keymaps at point if posn-string is non-nil. * src/keymap.c (Fcurrent_active_maps): Ignore keymaps at point for more positions outside the buffer. (bug#76620) --- src/keymap.c | 38 ++++++++++++++++---------------------- test/src/keymap-tests.el | 27 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index 2c250578b00..295b209f06b 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1735,11 +1735,20 @@ DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps, } } - /* If on a mode line string with a local keymap, - or for a click on a string, i.e. overlay string or a - string displayed via the `display' property, - consider `local-map' and `keymap' properties of - that string. */ + Lisp_Object pos_area = POSN_POSN (position); + if (EQ (pos_area, Qmode_line) || EQ (pos_area, Qheader_line)) + { + /* For clicks on mode line or header line, ignore the maps + we found at POSITION, because properties at point are + not relevant in that case. */ + local_map = Qnil; + keymap = Qnil; + } + + /* If on a mode line string with a local keymap, or for a + click on a string, i.e. overlay string or a string + displayed via the `display' property, consider only the + `local-map' and `keymap' properties of that string. */ if (CONSP (string) && STRINGP (XCAR (string))) { @@ -1749,23 +1758,8 @@ DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps, && XFIXNUM (pos) >= 0 && XFIXNUM (pos) < SCHARS (string)) { - Lisp_Object map = Fget_text_property (pos, Qlocal_map, - string); - Lisp_Object pos_area = POSN_POSN (position); - /* For clicks on mode line or header line, override - the maps we found at POSITION unconditionally, even - if the corresponding properties of the mode- or - header-line string are nil, because propertries at - point are not relevant in that case. */ - if (!NILP (map) - || EQ (pos_area, Qmode_line) - || EQ (pos_area, Qheader_line)) - local_map = map; - map = Fget_text_property (pos, Qkeymap, string); - if (!NILP (map) - || EQ (pos_area, Qmode_line) - || EQ (pos_area, Qheader_line)) - keymap = map; + local_map = Fget_text_property (pos, Qlocal_map, string); + keymap = Fget_text_property (pos, Qkeymap, string); } } diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index c605c3eb09d..950c741a6dd 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -509,6 +509,33 @@ keymap-unset-test-remove-and-inheritance ;; From the parent this time/ (should (equal (keymap-lookup map "u") #'undo)))) +(defun keymap-test--maps-for-posn (area string) + (current-active-maps + nil + ;; FIXME: This test would be better if this was a real position + ;; created by a real click. + `(,(selected-window) ,area (1 . 1) 0 (,string . 0) nil (1 . 1) nil (1 . 1) (1 . 1)))) + +(ert-deftest keymap-test-keymaps-for-non-buffer-positions () + "`current-active-maps' with non-buffer positions. (bug#76620)" + (with-temp-buffer + (pop-to-buffer (current-buffer)) + (let ((keymap (make-sparse-keymap "keymap-at-point"))) + (insert (propertize "string" 'keymap keymap)) + (goto-char (point-min)) + (should (memq keymap (current-active-maps))) + (should-not (memq keymap (keymap-test--maps-for-posn 'mode-line nil))) + (should-not (memq keymap (keymap-test--maps-for-posn 'mode-line "s"))) + (should-not (memq keymap (keymap-test--maps-for-posn nil "s"))) + (should (memq keymap (keymap-test--maps-for-posn nil nil))) + (let* ((mode-line-keymap (make-sparse-keymap "keymap-in-mode-line")) + (s (propertize "string" 'keymap mode-line-keymap))) + ;; Respect `keymap' in the string clicked on. + (should-not (memq keymap (keymap-test--maps-for-posn nil s))) + (should-not (memq keymap (keymap-test--maps-for-posn 'mode-line s))) + (should (memq mode-line-keymap (keymap-test--maps-for-posn nil s))) + (should (memq mode-line-keymap (keymap-test--maps-for-posn 'mode-line s))))))) + (provide 'keymap-tests) ;;; keymap-tests.el ends here -- 2.43.7 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 08 18:18:01 2025 Received: (at 76620) by debbugs.gnu.org; 8 Sep 2025 22:18:01 +0000 Received: from localhost ([127.0.0.1]:53342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvkBS-0004Ao-Kj for submit@debbugs.gnu.org; Mon, 08 Sep 2025 18:18:00 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42392) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvkBP-00049T-2j for 76620@debbugs.gnu.org; Mon, 08 Sep 2025 18:17:56 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 44ED3100383; Mon, 8 Sep 2025 18:17:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1757369864; bh=BYkXUZGi9yAHFm3uIuVCZiT8xtKMMwmWnL3O2/UOsAg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=YoCNvAErC2eToBXJiBujMi4CRExDFbGDe0r9O2iHqs3Ska978LsFqZomYbTRn86Dp LR9dtuQ/Ixo7khtVSKWoYxDEscK3fVJn3VpGoHPYEmZio458cGNaT6QxLrffgFkGzs 2CagPGj8gU3ZB7qWe/ZXvu/ZiB560ATKHz5Q2ouM7DbY6Z+a5G2a+WkK7nFwdH+FKS Rwcp4HHrsKtbWCd+KLqjTYi1oS5tCst8YWoTXu8i2/UfOQPgCPxlhl/7NNtoBLGOcy BASVi7hgKA62xICmr8DeqDt1R/C47ZJXdfM15wM9Ii5RmN51CG7Ngs2hARADkUOCTx EehUyWiYAVVBA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 156E61000BC; Mon, 8 Sep 2025 18:17:44 -0400 (EDT) Received: from alfajor (modemcable005.21-80-70.mc.videotron.ca [70.80.21.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E5A1C12059D; Mon, 8 Sep 2025 18:17:43 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button In-Reply-To: Message-ID: References: <86tt8esdzp.fsf@gnu.org> <86seh9oz8p.fsf@gnu.org> Date: Mon, 08 Sep 2025 18:17:43 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.163 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: Eli Zaretskii , jonas@bernoul.li, 76620@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I have a more demanding request: any chance we could concoct an ERT test >> for that? I realize that it might be difficult, but we keep skipping >> such "UI" tests because they're difficult, so I think we should try to >> slowly get closer to having an actual test suite of the UI elements. >> If you can identify one obstacle that makes it currently impossible, >> maybe we can fix that obstacle, and thus make one step in that direction. > A very reasonable request, I think. How about the test in the attached > patch? It's not really an end-to-end test, but I think it's still > useful. Thanks, looks good. > Then I could write some code which does "click on the mode > line" and test that that has the right behavior. Yeah, tho it's not completely clear how to write "click on the mode line" in code (including specifying where on the mode line). > But I have no idea how to do that, is there even a way? In the past, some mentioned running a TTY session of Emacs inside a nested inside a `M-x term` buffer. But maybe some clever use of `posn-at-x-y` could help build up the posn objects in your test in a more "intentional way". In the mean time, I'm happy with your test. Eli, should I push it? Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 09 07:43:06 2025 Received: (at 76620) by debbugs.gnu.org; 9 Sep 2025 11:43:06 +0000 Received: from localhost ([127.0.0.1]:58200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uvwkb-0000yY-U7 for submit@debbugs.gnu.org; Tue, 09 Sep 2025 07:43:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45570) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uvwkX-0000xr-5S for 76620@debbugs.gnu.org; Tue, 09 Sep 2025 07:43:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uvwkM-0000Hf-D5; Tue, 09 Sep 2025 07:42:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BwfoaeJFWjZSf0rzV0c7fkSqssZtyx2O41Wd75gTMdY=; b=m2VDWOye1BnT e+LRrldxRj5nGN+Okcjwtbv10fkmJzQRSoN+JetPZNxxsIW3Js2v9xlJoD9H9wXQs1742Onl7CZvX +qwBzgr6hsn3uU9xtsbHXEl9AzROtWc96U95+GHNxOsFto4YZUKZujcIkVb9U7BCowMcJUgn7U38b Hs9iI5fzNpFxWjkcpyFlCHgCxatLBfPgJ9n9MXdBDC0hBkNF96PxqjDlkQvQlVQ9MfwkXblJYkzyF OvbPQsLQpJPzjVY4mQzClhU4vFAWk9hiIrLusE2DAdDsVBYsGUP18MLr8Qc3hzGygoP+cQoz2QP0D x0OGeK9h+OfDd//fNhuWow==; Date: Tue, 09 Sep 2025 14:42:46 +0300 Message-Id: <86ikhrdf7t.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Mon, 08 Sep 2025 18:17:43 -0400) Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button References: <86tt8esdzp.fsf@gnu.org> <86seh9oz8p.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620 Cc: sbaugh@janestreet.com, 76620@debbugs.gnu.org, jonas@bernoul.li 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: Stefan Monnier > Cc: Eli Zaretskii , jonas@bernoul.li, 76620@debbugs.gnu.org > Date: Mon, 08 Sep 2025 18:17:43 -0400 > > >> I have a more demanding request: any chance we could concoct an ERT test > >> for that? I realize that it might be difficult, but we keep skipping > >> such "UI" tests because they're difficult, so I think we should try to > >> slowly get closer to having an actual test suite of the UI elements. > >> If you can identify one obstacle that makes it currently impossible, > >> maybe we can fix that obstacle, and thus make one step in that direction. > > A very reasonable request, I think. How about the test in the attached > > patch? It's not really an end-to-end test, but I think it's still > > useful. > > Thanks, looks good. > > > Then I could write some code which does "click on the mode > > line" and test that that has the right behavior. > > Yeah, tho it's not completely clear how to write "click on the mode > line" in code (including specifying where on the mode line). > > > But I have no idea how to do that, is there even a way? > > In the past, some mentioned running a TTY session of Emacs inside > a nested inside a `M-x term` buffer. But maybe some clever use of > `posn-at-x-y` could help build up the posn objects in your test in > a more "intentional way". > > In the mean time, I'm happy with your test. > > Eli, should I push it? Yes, please. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 09 18:08:58 2025 Received: (at 76620-done) by debbugs.gnu.org; 9 Sep 2025 22:08:59 +0000 Received: from localhost ([127.0.0.1]:33996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uw6WI-00063p-Hi for submit@debbugs.gnu.org; Tue, 09 Sep 2025 18:08:58 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37543) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uw6WF-00063a-01 for 76620-done@debbugs.gnu.org; Tue, 09 Sep 2025 18:08:55 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5491180916; Tue, 9 Sep 2025 18:08:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1757455728; bh=ARRIjmGDgS2QTppA2qjUB5IMJ16oexYW0Hhyfibcfvk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EeN/5HoFJfQBU4atMP7Krl7RD918SCyDmeLtXRmiSPm6O7RRh74iqtrN/66uYwMzk jSaNkzVET2ruJaGnFPPeJoS3MOaNgadBjSTwO4wRdsn+oeKHj8wqL2aKb2fX6c/FCi nlinvwwWbrlBD0+8KGoBMEhsttT8hCAQYS7TgGnlk2wlJvqprE7GLZZBxlird6J12A tAWKJCd+6S3Dvcw5bXDiS9gqHUsL3RTZ5NorOsi+p8enCgrFEUk9xwAJ/trt9gga8B y36Sc4qDu+btHsL4dDGSjGhuzGGvz0ThUau/xyofsQKJBODf6WKhG46F2fBqMHrw1M VkTTL0cGHefow== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5587E80A64; Tue, 9 Sep 2025 18:08:48 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3D7641205FB; Tue, 9 Sep 2025 18:08:48 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#76620: 30.1.50; mouse-1 mode-line bindings are unusable when point is on a button In-Reply-To: Message-ID: References: <86tt8esdzp.fsf@gnu.org> <86seh9oz8p.fsf@gnu.org> Date: Tue, 09 Sep 2025 18:08:47 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.165 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76620-done Cc: Eli Zaretskii , jonas@bernoul.li, 76620-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > A very reasonable request, I think. How about the test in the attached > patch? It's not really an end-to-end test, but I think it's still > useful. Pushed to `master`, thanks, closing, Stefan