Thierry Volpiatto <thie...@posteo.net> writes: >> As it usually goes, advicing functions comes at your own risk. So, no >> wonder you encountered problems. > > No. I hardly see how advicing functions with :override 'ignore may > delete a whole directory contents of lisp files, so please do not > underestimate this.
When Elisp library calls its own function, it expects the function to behave the way it is written. I simply have no idea how I can write any Elisp code that can work fine if the functions can suddenly not do what they are called for. So, you request in its plain form sounds impossible from my point of view. That said, the problem you encountered, it may be a genuine bug in Org mode where, say, Org does not account for some FS operation failing. But to know for sure, I will need a reproducer. For now, all I know is that org-persist should only ever delete `org-persist-directory' or directories inside `org-persist-directory'. I see nothing obviously wrong in the code that would make org-persist do otherwise. Even when `org-persist-register' is adviced. >> The best you can do is setting org-element-cache-persistent to >> nil. Then, Org mode will not create cache as frequently. But you cannot >> disable caching completely. Cache is necessary for some features to operate. > > Which features? Embedding inline https image links during html export. Also, latex preview in the future. >> P.S. I am confused why multiple people are asking to disable cache. > > For a good reason: People generally don't like things that write to > their disk in their back. Org have been doing it since forever. This is how latex previews work. This is how code evaluation works. >> Org has been creating ltximg directory since forever and nobody ever >> asked to "disable" that one. > > I never see this directory. Then, setting org-element-cache-persistent to nil should be good enough for you. -- Ihor Radchenko // yantar92, Org mode maintainer, 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>