unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: 61179@debbugs.gnu.org
Cc: jonas@bernoul.li, monnier@iro.umontreal.ca
Subject: bug#61179: lambda inside interactive form of around advice isn't a closure
Date: Sun, 05 Feb 2023 00:47:58 +0100	[thread overview]
Message-ID: <87edr58029.fsf@web.de> (raw)
In-Reply-To: <jwv1qn5mmal.fsf-monnier+emacs@gnu.org> (Stefan Monnier via's message of "Sat, 04 Feb 2023 11:26:15 -0500")

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

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> I installed a patch in `master` which should fix this problem, both for
> the case where the code is interpreted and for the case where it is
> byte-compiled.

Very good.

This seems to break some of my private code.  Didn't look into your
change so far.

My code generates function advices with the following semantics: You
specify an alternative function and a condition (as a predicate
function).  When the advice is enabled, whenever the function is called
the predicate is first checked for a non-nil result.  When non-nil, the
alternative function that had been specified is called (recursive calls
are bot affected however).  When nil, the original function is called.

I'm using this hack only in my init file for convenience, I like the
semantics for this purpose.

Here is a recipe for emacs -Q:


[-- Attachment #2: int-lambda.el --]
[-- Type: application/emacs-lisp, Size: 2208 bytes --]

[-- Attachment #3: Type: text/plain, Size: 610 bytes --]



Worked as I wanted until now.  But with your patch installed when
compiling the above snipped I get a *Compile Log* saying:

| Compiling internal form(s) at Sun Feb  5 00:36:11 2023
| int-lambda.elc: Error: ‘lambda’ defined after use in (lambda (old-spec3) (let ((test-result0 (#[0 "\300\207" [t] 1]))) (cons (if test-result0 'mel-ad-run-replacement 'mel-ad-run-original) (advice-eval-interactive-spec (if (not test-result0) old-spec3))))) (missing ‘require’ of a library file?)
| int-lambda.elc: Error: ‘lambda’ used as function name is invalid

Who is to blame?


TIA,

Michael.

  reply	other threads:[~2023-02-04 23:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 15:48 bug#61179: lambda inside interactive form of around advice isn't a closure Jonas Bernoulli
2023-01-31 23:33 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-01  1:33   ` Jonas Bernoulli
2023-02-01 22:34     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-02 14:39       ` Jonas Bernoulli
2023-02-01 22:29   ` Jonas Bernoulli
2023-02-04 16:26 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-04 23:47   ` Michael Heerdegen [this message]
2023-02-05 14:05     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-05 22:23       ` Michael Heerdegen
2023-02-05 16:43   ` Jonas Bernoulli
2023-02-05 18:54     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-08 14:38   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edr58029.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=61179@debbugs.gnu.org \
    --cc=jonas@bernoul.li \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).