From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#47755: 27.1; mouse-yank-at-click fails Date: Tue, 13 Apr 2021 23:27:45 +0300 Organization: LINKOV.NET Message-ID: <874kg9oqbt.fsf@mail.linkov.net> References: <004501d7308e$81727450$84575cf0$@net> <83eefe12cr.fsf@gnu.org> <87o8einfci.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21458"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Bob Floyd , 47755@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 13 23:00:21 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWQ8y-0005QS-Am for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Apr 2021 23:00:20 +0200 Original-Received: from localhost ([::1]:45520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWQ8w-0000wq-NB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Apr 2021 17:00:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWQ8g-0000w8-SG for bug-gnu-emacs@gnu.org; Tue, 13 Apr 2021 17:00:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWQ8g-0008Gn-Ju for bug-gnu-emacs@gnu.org; Tue, 13 Apr 2021 17:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lWQ8g-00035t-GW for bug-gnu-emacs@gnu.org; Tue, 13 Apr 2021 17:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Apr 2021 21:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47755 X-GNU-PR-Package: emacs Original-Received: via spool by 47755-submit@debbugs.gnu.org id=B47755.161834758211837 (code B ref 47755); Tue, 13 Apr 2021 21:00:02 +0000 Original-Received: (at 47755) by debbugs.gnu.org; 13 Apr 2021 20:59:42 +0000 Original-Received: from localhost ([127.0.0.1]:60976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWQ8L-00034r-LJ for submit@debbugs.gnu.org; Tue, 13 Apr 2021 16:59:41 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:58063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWQ8K-00034b-M5 for 47755@debbugs.gnu.org; Tue, 13 Apr 2021 16:59:40 -0400 X-Originating-IP: 91.129.96.157 Original-Received: from mail.gandi.net (m91-129-96-157.cust.tele2.ee [91.129.96.157]) (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id CC596FF804; Tue, 13 Apr 2021 20:59:32 +0000 (UTC) In-Reply-To: <87o8einfci.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 13 Apr 2021 22:44:57 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203988 Archived-At: --=-=-= Content-Type: text/plain >>> int main() >>> { >>> xyzz = abcc; >>> } >>> >>> 1. Place mouse over `main` and left double click - `main` is selected >>> 2. isearch-forward (C-s) `xyzz` - `xyzz` is selected >>> 3. place cursor over `x` of `xyzz` and mouse-yank-at-click (middle mouse >>> down) >>> >>> You should see error "Lisp nesting exceeds `max-lisp-eval-depth`" >> >> It's an infinite recursion inside isearch-mouse-2. > > This is because let-binding overriding-terminal-local-map to nil > > (let ((overriding-terminal-local-map nil)) > (key-binding (this-command-keys-vector) t)) > > doesn't disable its current value anymore. It used to work when bug#23007 > was fixed in 2017. So in Emacs 26.3 it correctly returned 'mouse-yank-primary', > but in Emacs 27 it's broken and returns 'isearch-mouse-2' without ignoring > the current value of overriding-terminal-local-map, i.e. currently let-binding > 'overriding-terminal-local-map nil' has no effect for 'key-binding'. In 2018 the logic of searching a key binding was changed. Now it magically depends of the current mode instead of more explicit keymaps as before: Before 2018: (let ((isearch-mode t)) (key-binding [mouse-2] t)) => mouse-yank-primary After 2018: (let ((isearch-mode t)) (key-binding [mouse-2] t)) => isearch-mouse-2 Anyway here is the fix: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=isearch-mouse-2.patch diff --git a/lisp/isearch.el b/lisp/isearch.el index 5efac4c78f..d3c0f261ba 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2561,7 +2561,9 @@ isearch-mouse-2 is bound to outside of Isearch." (interactive "e") (let ((w (posn-window (event-start click))) - (binding (let ((overriding-terminal-local-map nil)) + (binding (let ((overriding-terminal-local-map nil) + ;; Key search now depends on mode (bug#47755). + (isearch-mode nil)) (key-binding (this-command-keys-vector) t)))) (if (and (window-minibuffer-p w) (not (minibuffer-window-active-p w))) ; in echo area --=-=-=--