all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: daanturo <daanturo@gmail.com>
Cc: 59820@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#59820: [PATCH] * nadvice/nadvice.el: support non-symbol (closure/lambda) advices (old Emacs)
Date: Mon, 12 Dec 2022 17:04:01 -0800	[thread overview]
Message-ID: <CADwFkmkWhaNogsX4kYcEtfiO2aho61NH37aWy+VVWt5qajBWCA@mail.gmail.com> (raw)
In-Reply-To: <93f01864-6cdf-2d04-d08c-d0b52dc7773f@gmail.com> (daanturo@gmail.com's message of "Mon, 5 Dec 2022 00:14:49 +0700")

daanturo <daanturo@gmail.com> writes:

> This patch provides the ELPA version (for Emacs < 24.4) of nadvice.el's
> advice-add the ability to handle anonymous advices.
>
> I have tested with a simple example:
>
> ```emacs-lisp
>
> (let* ((sym (make-symbol "nadvice λ")))
>   (defalias sym (lambda (&rest args) '(1)))
>   (advice-add sym :around (lambda (func &rest args)
>                             (append (apply func args) '(2))))
>   (vector
>    ;; advised returned value
>    (funcall sym)
>    (progn
>      (advice-remove sym (lambda (func &rest args)
>                           (append (apply func args) '(2))))
>      ;; unadvised returned value
>      (funcall sym))))
>
> ;; => [(1 2) (1)]
>
> ```

Stefan, any comments here?





  reply	other threads:[~2022-12-13  1:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-04 17:14 bug#59820: [PATCH] * nadvice/nadvice.el: support non-symbol (closure/lambda) advices (old Emacs) daanturo
2022-12-13  1:04 ` Stefan Kangas [this message]
2022-12-13 13:50 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-13 14:59   ` daanturo
2022-12-13 15:02     ` Daan Ro
2023-10-09  9:45       ` Stefan Kangas
2023-10-09 22:06         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-10 10:44           ` Stefan Kangas
2023-10-11  6:04             ` Daan Ro
2023-10-11  6:50               ` 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

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

  git send-email \
    --in-reply-to=CADwFkmkWhaNogsX4kYcEtfiO2aho61NH37aWy+VVWt5qajBWCA@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=59820@debbugs.gnu.org \
    --cc=daanturo@gmail.com \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.