Here it says that the type of lsp-clients-pylsp-library-directories is (repeat string)

How do I write my dir_locals.el file ?

I tried this but it doesn't work (see here)

((lsp-mode . ((lsp-clients-pylsp-library-directories . '("contrib" "odoo")))))

1 Answer 1


(repeat string) is a composite customize type.

In general an easy way to find out is to use M-x customize-option to set a value, and then use C-hv to check the value which was set.

In this specific case:

(repeat element-type)

The value must be a list and each element of the list must fit the type element-type. This appears in the customization buffer as a list of elements, with ‘[INS]’ and ‘[DEL]’ buttons for adding more elements or removing elements.

Hence (repeat string) is a list of strings.

((lsp-mode . ((lsp-clients-pylsp-library-directories . '("contrib" "odoo")))))

Remember that a dir-locals file is implicitly data, not code; so your problem is that quote.

Try this:

((lsp-mode . ((lsp-clients-pylsp-library-directories . ("contrib" "odoo")))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.