emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Sterling Hooten <hooten@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Completely hide properties drawer in 9.6
Date: Wed, 14 Dec 2022 18:40:01 +0000	[thread overview]
Message-ID: <87tu1xx20u.fsf@localhost> (raw)
In-Reply-To: <25EC8C19-CFD9-4973-8F5B-896AF45C7002@gmail.com>

Sterling Hooten <hooten@gmail.com> writes:

>     (let* ((block (org-get-property-block))
> 	   ;; Extremely hacky way to get the whole property drawer
> 	   (beg (- (car block) 14))
> 	   (end (+ (cdr block) 5)))
>       (with-silent-modifications
> 	(org-fold-region beg end t 'org-hide-property-drawer))))
> #+end_src
>
> Is there a better way to get the beginning and end 
> of the property drawer more robustly?

org-element-at-point

> This is a step in the right direction, but it seems too sensitive to accidental editing.

See :fragile in org-fold-core--specs.

> This should be impervious to most types of user interaction,
> and prevent accidentally deleting or abutting anything
> up against either the start or end of the properties box.

which is part of the reason why the proposal was rejected.
Though Org tries hard in org-catch-invisible-edits.

> I tried setting `org-fold-catch-invisible-edits' to different values, but even
> with set to nil I can backward delete and erase some invisible
> text. Is this dependent on their being an ellipsis? Or is there
> another way to make this impervious to most edits?

It's just because only a fixed set of folds is caught in the invisible
edits check now.

> When adding a property with `org-property-put’ this would need
> to be called again, is there a way to do that robustly?

I should not need to be called again once you set
:front-sticky/:rear-sticky folding spec property.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>


  reply	other threads:[~2022-12-14 18:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14  5:37 Completely hide properties drawer in 9.6 Sterling Hooten
2022-12-14  9:15 ` Ihor Radchenko
2022-12-14 14:37   ` Sterling Hooten
2022-12-14 15:14     ` Ihor Radchenko
2022-12-14 18:27       ` Sterling Hooten
2022-12-14 18:40         ` Ihor Radchenko [this message]
2022-12-23  3:33           ` Sterling Hooten
2023-01-16 14:16             ` Ihor Radchenko
2022-12-16  9:38 ` Jean Louis
2022-12-16 11:46   ` Ihor Radchenko
2022-12-16 14:44     ` Jean Louis
2022-12-16 15:18       ` Ihor Radchenko
2022-12-17 23:54         ` Jean Louis
2022-12-18 13:26           ` [Feature] Store heading properties remotely, outside the Org file (was: Completely hide properties drawer in 9.6) Ihor Radchenko

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=87tu1xx20u.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=hooten@gmail.com \
    /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).