I was reading about dir-locals and wanted to set up per project settings. However whatever I try results in a malformed function. Why is this ?
.dir-locals.el:4:1:Warning: ‘(php-mode (php-executable . /usr/bin/php))’ is a
malformed function
So I tried this as the most basic example I could think of, and even this raises an error.
((php-mode
(php-executable . /usr/bin/php)))
So what am i doing wrong? I edit the file and then compile it to check things are working and checked multiple examples online and they all seem to use this format.
From the answers below this is an example I wanted to make work, the above was just a simpler test.
((nil .
((pony-settings (make-pony-project
:python "/docker:root@app_django_1:/usr/local/bin/python"
:pythonpath "/app"
:settings "local_settings_file"
:appsdir "/app")
))))
This is where my issues stemmed from, I can switch to a file and I hit an error which is what made me try and compile the code so I could test quickly.
eval: Invalid function: (make-pony-project :python "/docker:root@app_django_1:/usr/local/bin/python" :pythonpath "/app" :settings "local_settings_file" :appsdir "/app")
Perhaps this should be another question now, but in away this is still an issue I am getting an error but cant modify and apply changes quickly to see if its valid. Anyone have any idea on the above error ?
M-x add-dir-local-variable
then you don't need to worry about the format. Besides, I guessphp-executable
requires string type as its value, so you should use"/usr/bin/php"
instead..dir-locals.el
since it is not valid Emacs Lisp code.