I'm trying to loop over a pair of lists using (cl-loop for ..)
but I keep getting "Symbol's value as variable is void: mode" when the code executes at startup (and with eval-buffer
), but not when evaluating it with eval-region
.
;; clean up the modeline
(require 'diminish)
(defmacro diminish-after-load (file mode)
"After loading FILE, execute `diminish' on MODE."
`(eval-after-load ,file '(diminish ,mode)))
(require 'cl-lib)
(cl-loop for file in '("eldoc" "rainbow-mode" "hideshow" "flyspell"
"undo-tree" "whitespace" "smartparens" "auto-complete")
for mode in '(eldoc-mode rainbow-mode hs-minor-mode
flyspell-mode undo-tree-mode whitespace-mode
smartparens-mode auto-complete-mode)
do (diminish-after-load file mode))
How do I fix this?