That's because it's inside a macro. A macro needs to return a Lisp form, which then in turn gets evaluated.
For example, looking at the first invocation of this macro:
(add-annoying-arrows-advice previous-line '(ace-jump-mode backward-paragraph isearch-backward ido-imenu smart-up))
We need the expansion to contain:
(put 'previous-line 'aa-alts '(ace-jump-mode backward-paragraph isearch-backward ido-imenu smart-up))
which is what (quote ,cmd)
achieves. If the macro would use plain cmd
instead, it would be kept literally and the expansion would be:
(put cmd 'aa-alts '(ace-jump-mode backward-paragraph isearch-backward ido-imenu smart-up))
which is an error, because cmd
is not defined in the environment where the macro is invoked.
progn
means that you have to put a comma in front of stuff you want evaluated, no matter how far it is nested? (The,cmd
is within another list, not directly within(progn)
.) – The Unfun Cat Jan 21 '15 at 14:23(setq a "a's value" b "b's value" c "c's value")
and then evaluating\
(a '(,b c))`. – Dan Jan 21 '15 at 14:25