3

enable-remote-dir-locals is a variable defined in ‘files.el’. Its value is nil You can customize this variable. This variable was introduced, or its default value was changed, in version 24.3 of Emacs. Probably introduced at or before Emacs version 24.3. Documentation: Non-nil means dir-local variables will be applied to remote files. n.b. I believe ...


3

Not as such (AFAIK). However, both those modes derive from prog-mode which might be fine to target for this directory. ((prog-mode . ((comment-start . "/* ") (comment-end . " */") (comment-padding . 0)))) Or you could even use nil, which applies to every mode (again, maybe that's ok in practice). ((nil . ((comment-start . "/*...


2

You're lucky that the files for the different languages are segregated by directory like that. You can define directory-local values for variable auto-mode-alist. See the Elisp manual, node Directory Local Variables. As the intro text of that node says: This is useful when the files in the directory belong to some “project” and therefore share the same ...


2

Is it expected that dir-local variables are applied only after major-mode hooks are run? Yes. The local variables are normally processed in run-mode-hooks, after running the mode hooks and before running after-change-major-mode-hook. You could use the latter to deal with your problem. Alternatively you can use hack-local-variables-hook which runs after ...


1

Did you save the .dir-locals.el file? Are you loading these files via TRAMP? By default, Emacs doesn't look for the .dir-locals.el file when loading files via TRAMP, as it might add significant delays. If this is the problem, you can set enable-remote-dir-locals to t to opt in.


1

No, there isn't. You can set the variable in the directory-local variables, and the unset it in the child directory's variables. Or you can use file-local variables.


1

I tried instead of setting a hook, just eval the variable with the python-mode association and seems to work fine, here is the code: ((python-mode . ((eval . (setq-local realgud:pdb-command-name (concat (projectile-project-root) "envs/default/bin/python -m pdb"))))))


1

Local variables are set after hooks are run. Try using a timer: (let ((buf (current-buffer))) (run-with-timer 0.01 nil (lambda () (with-current-buffer buf (if (bound-and-true-p projectile-project-name) (my/activate-venv-for-project) (my/activate-venv-for-script)) (require 'lsp-...


Only top voted, non community-wiki answers of a minimum length are eligible