Hello, I would like to re-submit this idea, now that I am reasonably sure that my implementation will not impact users who do not use the feature. (I understand that Org 9.4 is on the way. I am not asking for this feature to be included right now; I would like to get some feedback first, then move on to documenting it.) * Motivation To recap: AFAIK it is not possible to define both org-todo-keywords and org-todo-keyword-faces per-directory. The former can be set with #+SETUPFILE, but the latter simply can't be set locally, unless I'm mistaken. I'd like to specify, for all Org files in a directory, which keywords to use and how they must look. Setting both org-todo-* variables in .dir-locals.el would be ideal IMO: the definitions for keywords and their faces would be right next to each other. This cannot work right now because (1) of a stray call to default-value (2) Org computes the TODO machinery (regexps and font-lock) when setting up the major mode, before directory-local variables are in effect. * Prior art AUCTeX[1] and markdown-mode[2] both solve this using hack-local-variables-hook. This seems to be the expected way for modes to (re)compute things that may be affected by file or directory-local variables. [1] http://git.savannah.gnu.org/cgit/auctex.git/tree/font-latex.el?h=release_12_2#n1331 [2] https://github.com/jrblevin/markdown-mode/blob/v2.4/markdown-mode.el#L9403 The idea is to register a function that will check whether the user overloaded variables we care about; if that's the case, then we recompute what we need to. * Patch The attached patch: - does not change org-mode's default setup logic, - adds a function to hack-local-variables-hook that will look for org-todo-* variables, and recompute org-set-regexps-and-options and org-set-font-lock-defaults if needed, - adds :safe predicates for these variables, - adds unit tests.