unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12610: unable to use macro in defadvice
@ 2012-10-09 13:02 Le Wang
  2012-10-12  2:05 ` Glenn Morris
  2020-09-13 16:43 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: Le Wang @ 2012-10-09 13:02 UTC (permalink / raw)
  To: 12610

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-13 16:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-10-12 18:15       ` Stefan Monnier
2020-09-13 16:43 ` Lars Ingebrigtsen

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).