GNU bug report logs - #78026
31.0.50; browse-url-interactive-arg does not handle nil (this-command-keys)

Previous Next

Package: emacs;

Reported by: StrawberryTea <look <at> strawberrytea.xyz>

Date: Thu, 24 Apr 2025 02:48:01 UTC

Severity: normal

Found in version 31.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78026 <at> debbugs.gnu.org, look <at> strawberrytea.xyz
Subject: Re: bug#78026: 31.0.50; browse-url-interactive-arg does not handle
 nil (this-command-keys)
Date: Sat, 03 May 2025 09:18:12 -0400
Eli Zaretskii [2025-05-03 11:46:12] wrote:

>> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
>> Cc: StrawberryTea <look <at> strawberrytea.xyz>,  78026 <at> debbugs.gnu.org
>> Date: Sun, 27 Apr 2025 09:54:26 -0400
>> 
>> >> Hello. So when fixing https://github.com/oantolin/embark/pull/750, I
>> >> realized that browse-url-interactive-arg does not handle
>> >> (this-command-keys) being the empty vector and that causes
>> >> browse-url-interactive-arg to emit an error when called programmatically
>> >> in embark.el. We should make it so that if (this-command-keys) returns
>> >> an empty vector, then mouse-set-point is not called.
>> 
>> You mean like in the patch below?
>
> ENOPATCH

Hmm... I remember hesitating between a few different options, but
I think I meant to send this one:

    diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
    index 3b2d3983002..96b4baaa615 100644
    --- a/lisp/net/browse-url.el
    +++ b/lisp/net/browse-url.el
    @@ -713,8 +713,7 @@ browse-url-interactive-arg
     `interactive'.  NEW-WINDOW-FLAG is the prefix arg; if
     `browse-url-new-window-flag' is non-nil, invert the prefix arg
     instead."
    -  (let ((event (elt (this-command-keys) 0)))
    -    (mouse-set-point event))
    +  (mouse-set-point last-nonmenu-event)
       (list (read-string prompt (or (and transient-mark-mode mark-active
                                         ;; rfc2396 Appendix E.
                                         (replace-regexp-in-string


- Stefan





This bug report was last modified 14 days ago.

Previous Next


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