emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sterling Hooten <hooten@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Completely hide properties drawer in 9.6
Date: Wed, 14 Dec 2022 02:37:14 -0300	[thread overview]
Message-ID: <4CC6A1F4-0B08-44E0-AE4D-60CA11636663@gmail.com> (raw)

First of all, thanks to everyone for working on 9.6!

I'm trying to clone Lotus notes in Org mode. This requires certain
properties to be generated for every heading (e.g., ID, creation time,
modification time, etc.). But these are mainly used for searching and
sorting, and rarely of interest to me during editing. For this reason
I would like to /completely/ hide the properties box (not just the
individual properties).

This has been discussed multiple times before in this list. The
general sentiment has been to reject adding it to Org as hiding things
ompletely from the user might be confusing, but it's also been
brought up enough times independently to demonstrate a latent demand
for this behavior, and a working example would be very useful for
those of us who wish to have a cleaner interface and editing
experience.

Alternative suggestions have been to change the face to make the
properties box appear smaller, but this interferes with movement from
the heading to the body, and the ability to toggle the visibility of a
property box would make this is redundant.

In <https://list.orgmode.org/87zh9ecfgc.fsf@localhost/> Ihor suggested
adding `org-custom-properties-hide-emptied-drawers', this was
rejected, but is pretty close to the desired behavior, except it's
still global. I was unable to get this working in release 9.6.

Prior to 9.6 I overwrote org-cycle-heading to hide the properties box
using overlays. This worked alright but had slowdowns on larger files
and affected typing cadence noticeably. Org 9.6 is now relying on text
properties instead of overlays, and I would like help replicating (and
improving) that behavior.

Part of the complication comes from updating modified timestamps in
the properties of each heading. This drives the need for hiding to be
fast so as not to bog down the editing experience when triggered by
`after-change-functions'.

The constant updating of a modification timestamp system puts some
constraints on the property hiding system. From working in 9.5 I
believe the relevant requirements are:

• Ability to add or modify properties with `org-entry-put' and
  maintain the state of being hidden or visible
  • E.g., Updating the ":MODIFIED:" property to a hidden property
    drawer should keep the drawer hidden.
• Toggle on and off hiding globally (perhaps in a minor mode)
• Moving headings around with `org-metaup' etc preserves the
  visibility state
  • A hidden property drawer should stay hidden when the outline is
    rearranged
• Resistant to changes with undo etc
  • Undoing a change should cause the contet to revert to the same
    visibility state it had at time of change.
• Don't overwrite when editing normally
  • With the point at the end of a heading and immediately before an
    ellipsis, typing "j" should result in the character being inserted
    with the face of the heading, and not overwrite or otherwise
    disturb the invisible text. `org-fold-catch-invisible-edits' might
    be relevant here.
• Reveal or hide just the property drawer of the heading at point and
  not the whole buffer
  • This is partially for speed reasons (to handle modified timestamp
    updates), but also because revealing all property drawers is
    extremely annoying when the surrounding headings in the buffer
    have headings with >10 properties.
• Fast enough to use with `after-change-functions'
  • The modification timestamp setup I'm using is triggered by buffer
    changes, and thus when typing runs after every keystroke. To keep
    this smooth and not be a bottleneck it would need `(benchmark 100
    'org-hide-properties)' to be less than .1s on an Org file with
    >20,000 lines and >1,000 headings.
• Ability to reveal just a subset of property lines
  • e.g., `org-bibtex' creates many properties to store bibliographic
    data. It would be useful to have enough control over hiding of
    properties such that if only ":BIB_FIELD:" properties of.
• Hide ellipsis unless body text is present
  • If all the headings have properties then the default folding
    behavior will place ellipses at the end of each heading, thus
    destroying the informational value of the ellipsis as an
    indication of folded but displayable content. It would be useful
    if instead the ellipsis would only be present when there's body
    text.

Any help would be greatly appreciated as things have changed in 9.6
and I'm not sure where the opportunities are to leverage the
improvements (e.g., are text properties now the way? Or should I still
implement it with faces?).

Thanks!



             reply	other threads:[~2022-12-14  5:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14  5:37 Sterling Hooten [this message]
2022-12-14  9:15 ` Completely hide properties drawer in 9.6 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
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=4CC6A1F4-0B08-44E0-AE4D-60CA11636663@gmail.com \
    --to=hooten@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).