emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Imran Khan <imran@khan.ovh>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Writing table to a folded drawer unfolds it. [9.7.12 (release_9.7.12 @ /home/natrys/.emacs.d/elpa/org-mode/lisp/)]
Date: Wed, 16 Oct 2024 19:05:39 +0600	[thread overview]
Message-ID: <a9a0b0d00a4fb0ac83db319fcf87ed3a@khan.ovh> (raw)
In-Reply-To: <8734kxfdap.fsf@localhost>

Ihor Radchenko <yantar92@posteo.net> writes:

> Imran Khan <imran@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'.


      reply	other threads:[~2024-10-16 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 19:07 [BUG] Writing table to a folded drawer unfolds it. [9.7.12 (release_9.7.12 @ /home/natrys/.emacs.d/elpa/org-mode/lisp/)] Imran Khan
2024-10-15 18:09 ` Ihor Radchenko
2024-10-16 13:05   ` Imran Khan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9a0b0d00a4fb0ac83db319fcf87ed3a@khan.ovh \
    --to=imran@khan.ovh \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).