From: Glenn Morris <rgm@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 12610@debbugs.gnu.org, Le Wang <l26wang@gmail.com>
Subject: bug#12610: unable to use macro in defadvice
Date: Fri, 12 Oct 2012 13:54:47 -0400 [thread overview]
Message-ID: <tbr4p3o9so.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <jwvy5jbhly9.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 12 Oct 2012 09:35:09 -0400")
Stefan Monnier wrote:
> Instead, we should expose the code as code rather than hide it as
> data, so that macro-expansion can take place without calling it
> explicitly and so the byte-compiler gets to see the code, optimize it
> and emit warnings where needed.
Sounds right.
> I.e. I think the patch should start more along the lines of the one
> below (100% guaranteed untested).
It causes warnings like:
In toplevel form:
uniquify.el:479:13:Warning: assignment to free variable `ad-return-value'
uniquify.el:487:41:Warning: reference to free variable `ad-return-value'
In end of data:
uniquify.el:511:1:Warning: the function `ad-get-arg' is not known to be
defined.
More importantly, it doesn't work...
emacs -Q -l uniquify
-> byte-code: Symbol's function definition is void: ad-make-advice
Compiling the initial example from this report gives:
(byte-code "<STUFF>" [ad-add-advice kill-buffer ad-make-advice
show-diff-rephrase-question nil t advice #[nil "<STUFF>" [#:--cl-var--
ad-do-it read-char-choice "(s/k/q)? " append "sSKkQq" nil memql (115 83)
(107 75) (113 81)] 5 "Prompt when a buffer is about to be killed."]
around ad-activate] 8)
next prev parent reply other threads:[~2012-10-12 17:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-09 13:02 bug#12610: unable to use macro in defadvice Le Wang
2012-10-12 2:05 ` Glenn Morris
2012-10-12 3:46 ` Glenn Morris
2012-10-12 13:35 ` Stefan Monnier
2012-10-12 17:54 ` Glenn Morris [this message]
2012-10-12 18:15 ` Stefan Monnier
2020-09-13 16:43 ` Lars Ingebrigtsen
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=tbr4p3o9so.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=12610@debbugs.gnu.org \
--cc=l26wang@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 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).