emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting org-todo-keywords through directory-local variables


From: Ihor Radchenko
Subject: Re: Setting org-todo-keywords through directory-local variables
Date: Sun, 30 Oct 2022 03:10:09 +0000

[sending to Org ML in-reply to the relevant thread]

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57003
28.1.90; Can local variables be loaded before loading major mode?

> … reminded me of a patch I submitted to the Org ML… some time ago 😣
> (sorry for not following up) to set TODO keywords via .dir-locals.el:
>
> https://list.orgmode.org/87a70stkmv.fsf@gmail.com/

Your patch is not listed on https://updates.orgmode.org/
It is also not in my records (I am only following patches closely since
the beginning of this year).
So, it slipped through the cracks.
I am bumping it herein.

At least, the :safe marking is something we can merge right away.

> My rationale with this patch was that AUCTeX and markdown-mode both use
> hack-local-variables-hook successfully to (re)compute stuff from
> dir/file-locals; I figured Org…
>
> * should bite the bullet, at some point: it'd just be really neat for
>   Emacs users used to this feature,

Maybe. That's why this emacs-devel thread.

> * could do so piecemeal, adding support for variables one at a time as
>   people chime in the ML to express a need.

> E.g. my patch only added support for org-todo-keywords and
> org-todo-keyword-faces, but it laid the foundation for adding support
> for other variables later.

I'd prefer to solve it once and for all. I tried early loading of
file-local variables in the past, but had to revert the commit because
of major issues. See
https://list.orgmode.org/87r11wkmew.fsf@ucl.ac.uk/T/#mab6359ed2107d5515c6bb6b266551f0c5049ceca

Maybe the hook approach can work better. But I'd prefer to discuss all
the possible caveats first.

> Also to try to reduce the risk of breakage, it went for "compute Org
> settings normally; then selectively recompute some if relevant variables
> are found in dir/file-locals".  That way "regular" Org users who rely
> rather on SETUPFILEs wouldn't be impacted, only "early adopters" of
> dir/file-locals might shoot themselves in the foot.

I am not sure what is the problem with SETUPFILE.
We can simply load it in the hook. Though the priority of SETUPFILE vs.
local variables should be discussed. Probably, local variables should
take precedence to keep things consistent with the rest of Emacs.

> (Also it had tests 😊)

Tests are always welcome :)

> Anyhoo.  Not even sure the patch applies after two years, but the
> general approach might be worth looking into?

Sure.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]