Ihor Radchenko <yanta...@posteo.net> writes: > 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.
Sorry, I have no recipe for now, I will try to produce one ASAP. > 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. However this trigerred the files deletion. >>> 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. I don't use these features, I even didn't know they exists. >>> 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. I don't remember org doing this in old emacs versions and it was working pretty well. > This is how latex previews work. This is how code evaluation works. Code evaluation? Which code evaluation? >>> 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. -- Thierry