all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Le Wang <l26wang@gmail.com>
To: 12610@debbugs.gnu.org
Subject: bug#12610: unable to use macro in defadvice
Date: Tue, 9 Oct 2012 21:02:58 +0800	[thread overview]
Message-ID: <CAM=K+iq-7ijbLg+-mtnKShVhQQFuPORDc5nbUEsqZidgtNNp=A@mail.gmail.com> (raw)

Relevant stackoverflow question:
http://stackoverflow.com/questions/12767353/using-macros-in-defadvice

I have this simplified macro.

(defadvice kill-buffer (around show-diff-rephrase-question activate compile)
  "Prompt when a buffer is about to be killed."
  (case (read-char-choice
         "(s/k/q)? "
         (append "sSKkQq" nil))
    ((?s ?S)
     ad-do-it)
    ((?k ?K)
     ad-do-it)
    ((?q ?Q) nil))
  ad-do-it)

If I compile the file and load it, then I get "Invalid function: (115 83)"

It works if I evaluate it.

-- 
Le





             reply	other threads:[~2012-10-09 13:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09 13:02 Le Wang [this message]
2012-10-12  2:05 ` bug#12610: unable to use macro in defadvice Glenn Morris
2012-10-12  3:46   ` Glenn Morris
2012-10-12 13:35   ` Stefan Monnier
2012-10-12 17:54     ` Glenn Morris
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

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

  git send-email \
    --in-reply-to='CAM=K+iq-7ijbLg+-mtnKShVhQQFuPORDc5nbUEsqZidgtNNp=A@mail.gmail.com' \
    --to=l26wang@gmail.com \
    --cc=12610@debbugs.gnu.org \
    /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.