From: Marcin Borkowski <mbork@mbork.pl>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 13023@debbugs.gnu.org
Subject: bug#13023: 24.3.50; lexical binding does not work within defadvice
Date: Tue, 02 Feb 2016 19:35:35 +0100 [thread overview]
Message-ID: <87io27dkp4.fsf@mbork.pl> (raw)
In-Reply-To: <87zk213do1@ch.ristopher.com>
On 2012-11-28, at 23:32, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> ;; -*- lexical-binding: t -*-
>> (funcall (let ((rms "works"))
>> (lambda ()
>> (message "lex-bind %s" rms))))
>
>> (defun asdf (b) (funcall b))
>
>> (defadvice asdf (before rms (b) activate)
>> (setf b (let ((abc 1) (b b)) (lambda () (print abc) (funcall b)))))
>
>> (asdf 'ding)
>
>> I think this code should work fine. It doesn't work with trunk and
>> emacs-24, though:
>
> Indeed, it doesn't work. And because of the way advice.el works
> (building a new function by combining the code chunks from all the
> pieces of advice applied to that function) it's not easy to fix.
>
> This is partly related to the issue mentioned recently that macro calls
> in pieces of advice are expanded late (typically when the advised
> function is defined).
>
> BTW, this does not affect the new `advice-add' feature in Emacs trunk.
Hi Stefan,
hi all,
does the above mean that this bug should be closed? AFAIU, new code
should (at least usually) use advice-add, and while the "old" advice
system is not going to be deleted, it is kind of deprecated.
Best,
--
Marcin Borkowski
http://mbork.pl/en
next prev parent reply other threads:[~2016-02-02 18:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-28 16:17 bug#13023: 24.3.50; lexical binding does not work within defadvice Christopher Schmidt
2012-11-29 4:32 ` Stefan Monnier
2012-11-29 22:50 ` Richard Stallman
2012-11-30 3:45 ` Stefan Monnier
2012-11-30 20:11 ` Richard Stallman
2012-12-01 4:23 ` Stefan Monnier
2012-12-02 0:00 ` Juanma Barranquero
2012-12-02 4:15 ` Richard Stallman
2012-12-03 0:01 ` Richard Stallman
2016-02-02 18:35 ` Marcin Borkowski [this message]
2016-02-02 19:42 ` Stefan Monnier
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=87io27dkp4.fsf@mbork.pl \
--to=mbork@mbork.pl \
--cc=13023@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).