unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 61179@debbugs.gnu.org
Subject: bug#61179: lambda inside interactive form of around advice isn't a closure
Date: Wed, 01 Feb 2023 02:33:55 +0100	[thread overview]
Message-ID: <87ilgm41a4.fsf@bernoul.li> (raw)
In-Reply-To: <jwvy1pi8fa4.fsf-monnier+emacs@gnu.org>

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> I think I'd try something like:
>
>     (let* ((var :value)
>            (interactive-advice
>             (lambda (spec)
>              (message "interactive: %s" var)
>              (advice-eval-interactive-spec spec)))
>            (advice-body
>             (lambda (fn &rest args)
>               (message "body: %s" var)
>               (apply fn args))))
>       (eval `(lambda (&rest args)
>                (interactive ,interactive-advice)
>                (apply ',advice-body args))
>             t))

I'm having troubles falling asleep because my brain insists on rewording
the following (even though --or perhaps exactly because-- there is not
really any need to mention it at all).  So I might as well try if typing
it out helps. ;)

I actually though of that, and the initial poc worked.  I did that late
at night also updated transient to use it.  In the morning I noticed
that there actually were many errors, and while I suspected that the
failure had nothing to do with this part of my change, it still lost
confidence in that approach, and since I felt some pressure to get
things done before the Emacs pre-release I stopped pursuing it.
Somehow I forgot about it when I wrote the above.

Now that you have suggested the same, my confidence is back.  And now
that I have written the above, I should also be able to fall asleep. ;P

> where the last 4 lines are "generic" and could be turned into
> a helper function if you end up using it several times.
> This should also minimize the amount of code that's hidden from the
> compiler by the backquote.

I'll only need it once; would you recommend using a helper in that case
too?

>
>
>         Stefan

    Good night!
    Jonas

    zzzzZZz





  reply	other threads:[~2023-02-01  1:33 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 [this message]
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
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=87ilgm41a4.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=61179@debbugs.gnu.org \
    --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).