GNU bug report logs -
#71934
31.0.50; edebug--called-interactively-skip vs. new fun objects
Previous Next
Full log
View this message in rfc822 format
[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)]
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)]
>> 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.