unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Check if a symbol is bound to a macro
@ 2009-12-08 20:43 Nordlöw
  2009-12-08 20:52 ` Barry Margolin
  0 siblings, 1 reply; 3+ messages in thread
From: Nordlöw @ 2009-12-08 20:43 UTC (permalink / raw)
  To: help-gnu-emacs

Is there a way to query if a symbol is bound to a macro?

list-fns.el written by Noah Friedman provides the function

(defun macrop (x)
  "Return `t' if X is a macro, `nil' otherwise.
X may be a raw or byte-compiled macro.  No attempt is made to
determine if
the macro is actually well-formed (i.e. syntactically valid)."
  (cond ((not (consp x))
         nil)
        ((eq (car x) 'macro)
         (functionp (cdr x)))))

but it doesn't work for me.
  (macrop 'case)
returns nil.

Thanks,
Nordlöw


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

end of thread, other threads:[~2009-12-08 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-08 20:43 Check if a symbol is bound to a macro Nordlöw
2009-12-08 20:52 ` Barry Margolin
2009-12-08 22:17   ` Nordlöw

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