GNU bug report logs - #47755
27.1; mouse-yank-at-click fails

Previous Next

Package: emacs;

Reported by: "Bob Floyd" <bobfloyd <at> comcast.net>

Date: Tue, 13 Apr 2021 17:58:01 UTC

Severity: normal

Tags: fixed

Found in version 27.1

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47755 in the body.
You can then email your comments to 47755 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47755; Package emacs. (Tue, 13 Apr 2021 17:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Bob Floyd" <bobfloyd <at> comcast.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 13 Apr 2021 17:58:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Bob Floyd" <bobfloyd <at> comcast.net>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 27.1; mouse-yank-at-click fails
Date: Tue, 13 Apr 2021 10:57:43 -0700
[Message part 1 (text/plain, inline)]
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 should have inserted `main` before `xyzz` -> `mainxyzz`.

 

 

 

STUFF:

Recent messages:

Mark saved where search started

Mark set

isearch-mouse-2: Lisp nesting exceeds 'max-lisp-eval-depth'

Mark saved where search started

Beginning of buffer [5 times]

Type C-x 1 to delete the help window, C-M-v to scroll help.

You can run the command 'describe-bindings' with C-h b

Quit

call-interactively: Lisp nesting exceeds 'max-lisp-eval-depth'

Quit

 

Configured using:

'configure --without-dbus --host=x86_64-w64-mingw32

--without-compress-install 'CFLAGS=-O2 -static''

 

Configured features:

XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2

HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP

 

Important settings:

  value of $LANG: ENU

  locale-coding-system: cp1252

 

Major mode: C++//la

 

Minor modes in effect:

  shell-dirtrack-mode: t

  show-paren-mode: t

  tooltip-mode: t

  global-eldoc-mode: t

  electric-indent-mode: t

  mouse-wheel-mode: t

  menu-bar-mode: t

  file-name-shadow-mode: t

  global-font-lock-mode: t

  font-lock-mode: t

  blink-cursor-mode: t

  auto-composition-mode: t

  auto-encryption-mode: t

  auto-compression-mode: t

  line-number-mode: t

  transient-mark-mode: t

  abbrev-mode: t

 

Load-path shadows:

d:/Bob/.emacs.d/elpa/verilog-mode-2020.6.27.14326051/verilog-mode hides
c:/Program
Files/Emacs-27.1/x86_64/share/emacs/27.1/lisp/progmodes/verilog-mode

 

Features:

(shadow sort mail-extr two-column iso-transl help-mode emacsbug message

rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec epa epg

epg-config gnus-util rmail rmail-loaddefs text-property-search mm-decode

mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader

sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils

mule-util time-date misearch multi-isearch web-mode advice derived

edmacro kmacro shell pcomplete comint ansi-color ring printing ps-print

ps-print-loaddefs ps-def lpr paren cc-mode cc-fonts cc-guess cc-menus

cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs finder-inf tex-site

info package easymenu browse-url url-handlers url-parse auth-source

cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json

subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv

cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks

lisp-float-type mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win

w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe

tabulated-list replace newcomment text-mode elisp-mode lisp-mode

prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer

select scroll-bar mouse jit-lock font-lock syntax facemenu font-core

term/tty-colors frame minibuffer cl-generic 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 charscript charprop case-table epa-hook

jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs

button faces cus-face macroexp files text-properties overlay sha1 md5

base64 format env code-pages mule custom widget hashtable-print-readable

backquote threads w32notify w32 lcms2 multi-tty make-network-process

emacs)

 

Memory information:

((conses 16 187692 13831)

(symbols 48 13647 1)

(strings 32 47767 1864)

(string-bytes 1 1504351)

(vectors 16 18961)

(vector-slots 8 232897 20308)

(floats 8 283 55)

(intervals 56 2218 4)

(buffers 1000 17))

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47755; Package emacs. (Tue, 13 Apr 2021 18:12:02 GMT) Full text and rfc822 format available.

Message #8 received at 47755 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Bob Floyd" <bobfloyd <at> comcast.net>
Cc: 47755 <at> debbugs.gnu.org
Subject: Re: bug#47755: 27.1; mouse-yank-at-click fails
Date: Tue, 13 Apr 2021 21:11:32 +0300
> From: "Bob Floyd" <bobfloyd <at> comcast.net>
> Date: Tue, 13 Apr 2021 10:57:43 -0700
> 
> 
> [1:text/plain Hide]
> 
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47755; Package emacs. (Tue, 13 Apr 2021 18:32:01 GMT) Full text and rfc822 format available.

Message #11 received at 47755 <at> debbugs.gnu.org (full text, mbox):

From: "Bob Floyd" <bobfloyd <at> comcast.net>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>
Cc: 47755 <at> debbugs.gnu.org
Subject: RE: bug#47755: 27.1; mouse-yank-at-click fails
Date: Tue, 13 Apr 2021 11:31:46 -0700
Happy you can reproduce it. We don't like infinite recursions!!!

-----Original Message-----
From: Eli Zaretskii [mailto:eliz <at> gnu.org] 
Sent: Tuesday, April 13, 2021 11:12 AM
To: Bob Floyd
Cc: 47755 <at> debbugs.gnu.org
Subject: Re: bug#47755: 27.1; mouse-yank-at-click fails

> From: "Bob Floyd" <bobfloyd <at> comcast.net>
> Date: Tue, 13 Apr 2021 10:57:43 -0700
> 
> 
> [1:text/plain Hide]
> 
> 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.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47755; Package emacs. (Tue, 13 Apr 2021 19:46:02 GMT) Full text and rfc822 format available.

Message #14 received at 47755 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Bob Floyd <bobfloyd <at> comcast.net>, 47755 <at> debbugs.gnu.org
Subject: Re: bug#47755: 27.1; mouse-yank-at-click fails
Date: Tue, 13 Apr 2021 22:44:57 +0300
>> 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'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47755; Package emacs. (Tue, 13 Apr 2021 20:56:01 GMT) Full text and rfc822 format available.

Message #17 received at 47755 <at> debbugs.gnu.org (full text, mbox):

From: Gregory Heytings <gregory <at> heytings.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: Bob Floyd <bobfloyd <at> comcast.net>, Eli Zaretskii <eliz <at> gnu.org>,
 47755 <at> debbugs.gnu.org
Subject: Re: bug#47755: 27.1; mouse-yank-at-click fails
Date: Tue, 13 Apr 2021 20:55:48 +0000
>>> 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.
>

No, it's because commit 57b14370cd added isearch-mode to 
minor-mode-map-alist without let-binding it to nil in isearch-mouse-2. 
Patch attached.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47755; Package emacs. (Tue, 13 Apr 2021 20:58:01 GMT) Full text and rfc822 format available.

Message #20 received at 47755 <at> debbugs.gnu.org (full text, mbox):

From: Gregory Heytings <gregory <at> heytings.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: Bob Floyd <bobfloyd <at> comcast.net>, 47755 <at> debbugs.gnu.org
Subject: Re: bug#47755: 27.1; mouse-yank-at-click fails
Date: Tue, 13 Apr 2021 20:57:20 +0000
[Message part 1 (text/plain, inline)]
>>>> 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.
>
> No, it's because commit 57b14370cd added isearch-mode to 
> minor-mode-map-alist without let-binding it to nil in isearch-mouse-2. 
> Patch attached.
>

Patch attached now ;-)
[Fix-Bug-47755-in-Isearch.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47755; Package emacs. (Tue, 13 Apr 2021 21:00:02 GMT) Full text and rfc822 format available.

Message #23 received at 47755 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Bob Floyd <bobfloyd <at> comcast.net>, 47755 <at> debbugs.gnu.org
Subject: Re: bug#47755: 27.1; mouse-yank-at-click fails
Date: Tue, 13 Apr 2021 23:27:45 +0300
[Message part 1 (text/plain, inline)]
>>> 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:

[isearch-mouse-2.patch (text/x-diff, inline)]
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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47755; Package emacs. (Wed, 14 Apr 2021 16:25:02 GMT) Full text and rfc822 format available.

Message #26 received at 47755 <at> debbugs.gnu.org (full text, mbox):

From: "Bob Floyd" <bobfloyd <at> comcast.net>
To: "'Gregory Heytings'" <gregory <at> heytings.org>,
 "'Juri Linkov'" <juri <at> linkov.net>
Cc: 47755 <at> debbugs.gnu.org
Subject: RE: bug#47755: 27.1; mouse-yank-at-click fails
Date: Wed, 14 Apr 2021 09:24:38 -0700
Hi,

Thanks!

The biggest issue driving me nuts with 27.1 is with `tags-search` and
`tags-query-replace`. Neither finds all instances of whatever I'm searching.

One time I discovered `exchange-point-and-mark` took me to the text searched
on. I repeat `tags-query-replace` multiple times - often the 1st time is
says 0 replaces, then the 2nd replaces a bunch, and a 3rd replaces more (2nd
and 3rd use the text I entered in the 1st). Usually when it's in this broken
state it's repeatable, but I can't identify what got it into this state. A
fresh execution of emacs always works, at least for the 1st several
searches.

Any suggestions as to what I can do to get something to you that illustrates
this?

Thanks,
Bob

-----Original Message-----
From: Gregory Heytings [mailto:gregory <at> heytings.org] 
Sent: Tuesday, April 13, 2021 1:57 PM
To: Juri Linkov
Cc: Bob Floyd; 47755 <at> debbugs.gnu.org
Subject: Re: bug#47755: 27.1; mouse-yank-at-click fails


>>>> 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.
>
> No, it's because commit 57b14370cd added isearch-mode to 
> minor-mode-map-alist without let-binding it to nil in isearch-mouse-2.
> Patch attached.
>

Patch attached now ;-)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47755; Package emacs. (Wed, 14 Apr 2021 18:38:01 GMT) Full text and rfc822 format available.

Message #29 received at 47755 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: Bob Floyd <bobfloyd <at> comcast.net>, Eli Zaretskii <eliz <at> gnu.org>,
 47755 <at> debbugs.gnu.org
Subject: Re: bug#47755: 27.1; mouse-yank-at-click fails
Date: Wed, 14 Apr 2021 21:36:08 +0300
tags 47755 fixed
close 47755 28.0.50
thanks

>>>> 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.
>
> No, it's because commit 57b14370cd added isearch-mode to
> minor-mode-map-alist without let-binding it to nil in
> isearch-mouse-2. Patch attached.

Thanks for identifying the breaking commit.
Now this is fixed in Emacs 28.




Added tag(s) fixed. Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Wed, 14 Apr 2021 18:38:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.0.50, send any further explanations to 47755 <at> debbugs.gnu.org and "Bob Floyd" <bobfloyd <at> comcast.net> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Wed, 14 Apr 2021 18:38:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 May 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 342 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.