syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.89k forks source link

tracking issue: Fix directory/file specific layer configuration #14653

Closed lebensterben closed 1 year ago

lebensterben commented 3 years ago

As reported in https://github.com/syl20bnr/spacemacs/pull/14652, there's a regression since https://github.com/syl20bnr/spacemacs/pull/14509.

This is a regression we have in multiple languages. We need to add the backend setup function to -local-vars-hook so that people can override a language backend in a given project. See the Emacs documentation on this wonderfully named variable hack-local-variables.

For instance with the following .dir-locals.el at the root of a git repository I can choose to use anaconda instead of lsp (useful for legacy python projects):

;;; Directory Local Variables ;;; For more information see (info "(emacs) Directory Variables")

((python-mode . ((python-test-runner . pytest) (python-backend . anaconda))))

This feature is explained in the README.org files of all the languages supporting multiple backends. Example in the Python README: https://github.com/syl20bnr/spacemacs/tree/develop/layers/+lang/python#choosing-a-backend

Review progress

Not affected:

smile13241324 commented 3 years ago

Good catch I will check the commits and merge them one by one.

syl20bnr commented 3 years ago

Taking care of Ruby.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!