emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: John Mathena <jmmathena@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Child's visibility property is overridden by parent's [9.5.2 (9.5.2-gbc8c3e @ /home/john/.emacs.d/straight/build/org/)
Date: Sat, 19 Feb 2022 23:07:46 +0800	[thread overview]
Message-ID: <87tucu99od.fsf@localhost> (raw)
In-Reply-To: <CADywB5+P_42Xc27GQWfwMomdkCr9_+Q1N21C9AOfkc6X61R3ug@mail.gmail.com>

John Mathena <jmmathena@gmail.com> writes:

Confirmed.

> It seems like the visibility property on a parent heading overrides
> the visibility property on a child heading - is this expected? e.g.
> when I have the raw text:
>
> * Foo
> :PROPERTIES:
> :VISIBILITY: content
> :END:
> ** Bar
> :PROPERTIES:
> :VISIBILITY: folded
> :END:
> *** Baz
>
> ... I would expect (and would like) to see
>
> * Foo...
>  * Bar...
>
> that is, where Foo shows only the content below it, and Bar has all of
> its children folded. Instead, I get
>
> * Foo...
>  * Bar...
>   * Baz...

The behaviour you observe is because
org-cycle-set-visibility-according-to-property explicitly ignores all
the VISIBILITY properties in all the descendent headings of a heading
with VISIBILITY property. i.e. VISIBILITY property of Bar is ignored
when its ancestor Foo has VISIBILITY property.

This behaviour is not documented in the manual:

>>    Furthermore, any entries with a ‘VISIBILITY’ property (see *note
>> Properties and Columns::) get their visibility adapted accordingly.
>> Allowed values for this property are ‘folded’, ‘children’, ‘content’,
>> and ‘all’.

I would say that the existing behaviour is a confusing and might be
considered as a bug. However, it may not always be straightforward how
to deal with different combinations of VISIBILITY setting for
ancestor/descendent headings. Consider the following example:

* Foo
:PROPERTIES:
:VISIBILITY: folded
:END:
** Bar
:PROPERTIES:
:VISIBILITY: content
:END:
*** Baz

Foo is supposed to be folded, but it is unclear how to process Bar.
Should Bar's contents be visible? Should it be folded?

Best,
Ihor



  reply	other threads:[~2022-02-19 15:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 15:23 [BUG] Child's visibility property is overridden by parent's [9.5.2 (9.5.2-gbc8c3e @ /home/john/.emacs.d/straight/build/org/) John Mathena
2022-02-19 15:07 ` Ihor Radchenko [this message]
2024-01-30 13:48   ` 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=87tucu99od.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jmmathena@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).