Nicolas Goaziou writes: > This looks hackish. Any bit in particular? AFAICT hack-local-variables-hook is the expected way to perform plumbing that might be affected by file/directory-local variables. It is used by e.g. shell-script-mode, cc-mode, markdown-mode and AUCTeX, to name a few. The docstring says: > Major modes can use this to examine user-specified local variables > in order to initialize other data structure based on them. I think the buffer-file-name bit looks dodgy; I mainly did that to get the unit tests to pass on this POC. > Also, Org needs the STARTUP part early on, so you > cannot really delay it. > > I /think/ the rest can be delayed, but I admit I'm not too sure either. Right. Now that I've looked at other major modes (especially AUCTeX[1]), it seems a more conventional approach would be to - keep the calls to org-set-regexps-and-options and org-set-font-lock-defaults where they are now, - in hack-local-variables-hook, *if* file-local-variables-alist contains Org variables that affect those functions, and call them again to refresh regexps and fontification. IIUC this would pretty much guarantee that things can only break for weirdos like me who try to use directory-local variables. > I think the expected way to do this is to add a SETUPFILE. Thanks for the pointer! Unless I'm misreading (info "(org) In-buffer Settings"), I could move my SEQ_TODO settings there, but that wouldn't work for org-todo-keyword-faces, right? In light of your comments, and based on what I've seen in AUCTeX, I'm attaching what I believe to be a less intrusive patch. WDYT? Thank you for taking the time to review this. I'm not opposed to using SETUPFILE (if I can handle org-todo-keyword-faces there); I'm just wondering if this could be one more opportunity to have Org play nice with other Emacs facilities (directory-local variables). [1] https://git.savannah.gnu.org/cgit/auctex.git/tree/font-latex.el?h=release_12_2#n1435