Ihor Radchenko writes: > "Christopher M. Miles" writes: > >> I'm also try to improve this file to improve large Org buffer saving performance. > > org-encrypt already caches the encrypted text and takes basically no > time for the repeated encryption, as long the text to be encrypted is unchanged. > >> I have some ideas: >> >> - auto encrypt buffer on buffer save hook (currently mechanism, your patch improved it) > > Sorry, but my patch has nothing to do with save hook. It only changes decryption. > >> - auto decrypt on org-cycle expand headline if current headline is encrypted. e.g. on `org-cycle-hook` > > I am not sure how it has anything to do with performance. > You can already use C-c C-r (or M-x org-reveal) to decrypt entry at > point. > We should certainly not attempt decryption on by default - it may > be annoying when you actually do not want to decrypt anything, just > look inside. You're right, I have not consider enough. > >> - auto encrypt ONLY current fold action on headline scope if has crypt key specified. e.g. on `org-cycle-hook` > > That might be possible, but I often do not want my encrypted > sub-headings being encrypted while I re-structure and re-fold my file. > > May you elaborate what performance issues you are experiencing? My performance issue is a large Org file about 2M size on saving. I will reproduce and generate profiler report for more detailed data and update in this thread. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3