emacs-devel
[Top][All Lists]
Advanced

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

Re: [elpa] externals/org 46da64c 4/6: org-persist.el: Fix `add-hook' pri


From: Stefan Monnier
Subject: Re: [elpa] externals/org 46da64c 4/6: org-persist.el: Fix `add-hook' priority argument
Date: Tue, 19 Oct 2021 10:16:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> The idea behind 100 is related to Org usage.  We save buffer-local
> `org-element--cache' to files.  It needs to be done _after_ all the
> possible changes in Org buffers are made.  If any hook changes an Org
> buffer after `org-persist-write-all', the saved value will become
> invalid.  I am not sure what can be a reasonable DEPTH value in such
> case.  Can it be something like 1?  Looking through Emacs code base, I
> can mostly see non-nil values as DEPTH argument.  So, maybe 90? 91?

The value should be chosen in accordance with other possibly
interfering functions.
IOW you need for the functions to agree on a numbering-convention.
Since there is no such convention yet for your functions, you get to
define it.

So you can chose, for example 42 and from then on all function that need
to come before `org-persist-write-all` simply have to refrain from
using a value higher than 42.


        Stefan




reply via email to

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