So, I know that I can assign a variable via .dir-locals.el
...
("thingy" (1 2 3 4))
but is there any way that I can append to an array, if at all?
("that" . "is correct")
(add-to-list 'thingy 5)
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityFrom the GNU Emacs Manual:
You can specify the variables
mode
,eval
, andunibyte
in your .dir-locals.el, and they have the same meanings as they would have in file local variables. coding cannot be specified as a directory local variable. See Local Variables in Files.
Variables in .dir-locals.el
are mode specific. You have to explicitly specify the mode that you are using, it is not a simple key/value store.
The eval
keyword means you can execute Lisp code, this means you may call add-to-list
and modify variables as needed.
((org-mode . ((eval . (add-to-list 'org-publish-project-alist
("org-project" (:output-dir "~/org-out")))))
eval
.