I understand from here, that I can use dir-locals.el to customize modes, such as given in the example:
;; Warn about spaces used for indentation:
(haskell-mode . ((eval . (highlight-regexp "^ *"))))
(c-mode . ((c-file-style . "BSD")))
(java-mode . ((c-file-style . "BSD")))
("src/imported"
. ((nil . ((change-log-default-name . "ChangeLog.local"))))))
However, all of these make 1 change per language-mode. I would like to make multiple changes to the same mode, python-mode
, and I think my syntax is only keeping the first one.
What's the right syntax to combine these two variables settings in dir-locals.el
?
I have:
;; misc
((python-mode
(python-shell-buffer-name . "Python[This Project]")))
;; set the local pyvenv
((python-mode . ((pyvenv-activate . "./envs/default")
)))
;; find local pylintrc vs global
((python-mode . ((eval . (lambda () (setq flycheck-pylintrc ".pylintrc"))))))
Other refs consulted:
- How to set up elpy to use python3?
- https://stackoverflow.com/questions/25288836/elpy-and-pylint-where-should-a-pylintrc-file-be-placed-in-order-to-customize-py
- https://www.reddit.com/r/emacs/comments/1s9f9y/using_a_functionhook_instead_of_dir_local/
- https://seandavi.github.io/post/2018-12-08-directory-local-variables-for-custom-emacs-projects/
- https://chromium.googlesource.com/chromiumos/chromite/+/master/.dir-locals.el
- How to use .dir-locals.el with Projectile?