unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47755: 27.1; mouse-yank-at-click fails
@ 2021-04-13 17:57 Bob Floyd
  2021-04-13 18:11 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Bob Floyd @ 2021-04-13 17:57 UTC (permalink / raw)
  To: 47755

[-- Attachment #1: Type: text/plain, Size: 3873 bytes --]

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))


[-- Attachment #2: Type: text/html, Size: 8940 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47755: 27.1; mouse-yank-at-click fails
  2021-04-13 17:57 bug#47755: 27.1; mouse-yank-at-click fails Bob Floyd
@ 2021-04-13 18:11 ` Eli Zaretskii
  2021-04-13 18:31   ` Bob Floyd
  2021-04-13 19:44   ` Juri Linkov
  0 siblings, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2021-04-13 18:11 UTC (permalink / raw)
  To: Bob Floyd; +Cc: 47755

> From: "Bob Floyd" <bobfloyd@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47755: 27.1; mouse-yank-at-click fails
  2021-04-13 18:11 ` Eli Zaretskii
@ 2021-04-13 18:31   ` Bob Floyd
  2021-04-13 19:44   ` Juri Linkov
  1 sibling, 0 replies; 9+ messages in thread
From: Bob Floyd @ 2021-04-13 18:31 UTC (permalink / raw)
  To: 'Eli Zaretskii'; +Cc: 47755

Happy you can reproduce it. We don't like infinite recursions!!!

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

> From: "Bob Floyd" <bobfloyd@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.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47755: 27.1; mouse-yank-at-click fails
  2021-04-13 18:11 ` Eli Zaretskii
  2021-04-13 18:31   ` Bob Floyd
@ 2021-04-13 19:44   ` Juri Linkov
  2021-04-13 20:27     ` Juri Linkov
  2021-04-13 20:55     ` Gregory Heytings
  1 sibling, 2 replies; 9+ messages in thread
From: Juri Linkov @ 2021-04-13 19:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Bob Floyd, 47755

>> 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'.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47755: 27.1; mouse-yank-at-click fails
  2021-04-13 19:44   ` Juri Linkov
@ 2021-04-13 20:27     ` Juri Linkov
  2021-04-13 20:55     ` Gregory Heytings
  1 sibling, 0 replies; 9+ messages in thread
From: Juri Linkov @ 2021-04-13 20:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Bob Floyd, 47755

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

>>> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: isearch-mouse-2.patch --]
[-- Type: text/x-diff, Size: 667 bytes --]

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#47755: 27.1; mouse-yank-at-click fails
  2021-04-13 19:44   ` Juri Linkov
  2021-04-13 20:27     ` Juri Linkov
@ 2021-04-13 20:55     ` Gregory Heytings
  2021-04-13 20:57       ` Gregory Heytings
  2021-04-14 18:36       ` Juri Linkov
  1 sibling, 2 replies; 9+ messages in thread
From: Gregory Heytings @ 2021-04-13 20:55 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Bob Floyd, 47755


>>> 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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47755: 27.1; mouse-yank-at-click fails
  2021-04-13 20:55     ` Gregory Heytings
@ 2021-04-13 20:57       ` Gregory Heytings
  2021-04-14 16:24         ` Bob Floyd
  2021-04-14 18:36       ` Juri Linkov
  1 sibling, 1 reply; 9+ messages in thread
From: Gregory Heytings @ 2021-04-13 20:57 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Bob Floyd, 47755

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]


>>>> 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 ;-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=Fix-Bug-47755-in-Isearch.patch, Size: 995 bytes --]

From 1146545d7249dcb7e4901ff852e36fc8a4d88abd Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Tue, 13 Apr 2021 20:49:02 +0000
Subject: [PATCH] Fix Bug#47755 in Isearch

* lisp/isearch.el (isearch-mouse-2): Let-bind minor-mode-map-alist
to nil.
---
 lisp/isearch.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 5efac4c78f..1525913948 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2561,7 +2561,8 @@ 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)
+                       (minor-mode-map-alist nil))
                    (key-binding (this-command-keys-vector) t))))
     (if (and (window-minibuffer-p w)
 	     (not (minibuffer-window-active-p w))) ; in echo area
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#47755: 27.1; mouse-yank-at-click fails
  2021-04-13 20:57       ` Gregory Heytings
@ 2021-04-14 16:24         ` Bob Floyd
  0 siblings, 0 replies; 9+ messages in thread
From: Bob Floyd @ 2021-04-14 16:24 UTC (permalink / raw)
  To: 'Gregory Heytings', 'Juri Linkov'; +Cc: 47755

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@heytings.org] 
Sent: Tuesday, April 13, 2021 1:57 PM
To: Juri Linkov
Cc: Bob Floyd; 47755@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 ;-)






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#47755: 27.1; mouse-yank-at-click fails
  2021-04-13 20:55     ` Gregory Heytings
  2021-04-13 20:57       ` Gregory Heytings
@ 2021-04-14 18:36       ` Juri Linkov
  1 sibling, 0 replies; 9+ messages in thread
From: Juri Linkov @ 2021-04-14 18:36 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: Bob Floyd, 47755

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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-14 18:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 17:57 bug#47755: 27.1; mouse-yank-at-click fails Bob Floyd
2021-04-13 18:11 ` Eli Zaretskii
2021-04-13 18:31   ` Bob Floyd
2021-04-13 19:44   ` Juri Linkov
2021-04-13 20:27     ` Juri Linkov
2021-04-13 20:55     ` Gregory Heytings
2021-04-13 20:57       ` Gregory Heytings
2021-04-14 16:24         ` Bob Floyd
2021-04-14 18:36       ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).