Ihor Radchenko <yanta...@posteo.net> writes: > Imran Khan <im...@khan.ovh> writes: > >> ... Writing table to a folded drawer unfolds it >> ... >> (insert "| " (format "%f" (time-to-seconds)) " |\n") > > This is expected. > In the middle of the editing, you are breaking the drawer structure, > transiently having something like > > :DRAWER: > ... > | :END: > > So, Org mode unfolds the drawer to avoid having a fold that cannot be > unfolded by normal means.
Oh, not only does it make complete sense, but turns out that I had been operating under the misassumption all this while that one `insert' call amounts to one atomic change to the buffer (after concatenation of arguments). I had to do a double take now when I tested that `(insert a b)' is in fact two changes, oof. Shows the danger of such implicit assumptions. I can now also construct the table in a way that doesn't leave the drawer structure broken at any point. Regardless, thanks for also telling me about `org-fold-core-ignore-fragility-checks'.