GNU bug report logs - #71934
31.0.50; edebug--called-interactively-skip vs. new fun objects

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Thu, 4 Jul 2024 05:12:02 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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#71934: closed (31.0.50; edebug--called-interactively-skip vs.
 new fun objects)
Date: Fri, 05 Jul 2024 04:26:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 05 Jul 2024 00:24:55 -0400
with message-id <jwva5iweatz.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new fun objects
has caused the debbugs.gnu.org bug report #71934,
regarding 31.0.50; edebug--called-interactively-skip vs. new fun objects
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
71934: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71934
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; edebug--called-interactively-skip vs. new fun objects
Date: Thu, 04 Jul 2024 07:11:36 +0200
Hi,

AFAIU we must update this test in `edebug--called-interactively-skip':

#+begin_src emacs-lisp
  (when (and (memq (car-safe (nth 1 frame1)) '(lambda closure)) ...
#+end_src


My test case:

#+begin_src emacs-lisp
(defun f (x)
  (interactive "P")
  (message "c-i: %s" (called-interactively-p 'any)))
(global-set-key [print] #'f)
#+end_src

When edebugging `f', (called-interactively-p 'any) will eval to nil in
current master when hitting print.  Evalled to t as expected in older
Emacs versions.


TIA,

Michael.





[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 71934-done <at> debbugs.gnu.org
Subject: Re: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new
 fun objects
Date: Fri, 05 Jul 2024 00:24:55 -0400
>> I pushed a patch to `emacs-30` which should fix this.
>> Can you confirm it fixes it in your real use case as well?
> Thanks.  Other use cases are fixed as well

Thank you, closing.

>  but advices are broken :-(
[...]
> (advice-add 'f :around (defun my-f--around-ad (f &rest args) (apply f args)))

AFAIK that's not new.

> Hitting [print] says nil.  AFAIU this should also work transparently,
> right?  The breakage seems to date further back in this case.

It should work for most advices but not for `:around` advice, because
fundamentally, it's virtually impossible to recognize this

    (apply f args)

as being an "interactive call".

> And i have another request: could you please search for the few other
> occurrences of the symbol 'closure' in the Emacs Elisp code base?
> I guess in most cases there is a need to update these places, too.

I already did.
There's one case on `comp.el` which may require some update, but I don't
understand the code enough to know what it intends to do.
It seems to match both `lambda` and `closure`, hence function *values*,
but somehow it doesn't try and handle byte-code functions which are far
more common function values, so maybe the `closure` is just irrelevant
and the code is expected to match source code expressions (whose
evaluation will return functions)?


        Stefan



This bug report was last modified 1 year and 6 days ago.

Previous Next


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