In the following code I have a reproducible example of strange behavior (the macro body is probably not important):
(setq annoying-commands ())
(defmacro add-annoying-arrows-advice (cmd alternatives &optional evil-cmd evil-alternatives)
`(progn
(add-to-list 'annoying-commands (quote ,cmd))
(put (quote ,cmd) 'aa--alts ,alternatives)
(put (quote ,cmd) 'aa--evil-alts ,evil-alternatives)
(put (quote ,cmd) 'aa--evil-cmd ,evil-cmd)
(defadvice ,cmd (before annoying-arrows activate)
(when annoying-arrows-mode
(aa--maybe-complain (quote ,cmd))))))
(add-annoying-arrows-advice next-line
'(ace-jump-mode) evil-next-visual-line '(evil-search-backward))
Evaulating this buffer gives the error:
Symbol's value as variable is void: evil-next-visual-line
This is a shame because I'd like to leave the third argument to the defmacro, namely evil-next-visual-line
unquoted, just like next-line
(the first argument) is.
Some really flaky behavior shows if I do the following:
(add-annoying-arrows-advice evil-next-visual-line '(smart-up) 'evil-next-visual-line '(evil-find-char-backward))
Now all of a sudden having evil-next-visual-line
as an unquoted argument is okay!
How could this possibly be?