emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Child's visibility property is overridden by parent's [9.5.2 (9.5.2-gbc8c3e @ /home/john/.emacs.d/straight/build/org/)
@ 2022-02-15 15:23 John Mathena
  2022-02-19 15:07 ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: John Mathena @ 2022-02-15 15:23 UTC (permalink / raw)
  To: emacs-orgmode

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...

i.e., behavior like if Foo and Bar both "had their visibility" set to
"content" (I'm aware that's not how the internals work but I'm not
sure how else to articulate what I mean). Is there a way to prevent
this and get the behavior I'd expect?

This behavior was reproduced with straight.el on Org mode version
9.5.2 (9.5.2-gbc8c3e @ /home/john/.emacs.d/straight/build/org/, GNU
Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo
version 1.17.4) of 2021-03-26, with org-startup-folded set to nil
(without which the visibility properties don't take effect).

Best,

John


^ permalink raw reply	[flat|nested] 3+ messages in thread

* 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/)
  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
  2024-01-30 13:48   ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2022-02-19 15:07 UTC (permalink / raw)
  To: John Mathena; +Cc: emacs-orgmode

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* 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/)
  2022-02-19 15:07 ` Ihor Radchenko
@ 2024-01-30 13:48   ` Ihor Radchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Ihor Radchenko @ 2024-01-30 13:48 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: John Mathena, emacs-orgmode

Ihor Radchenko <yantar92@gmail.com> writes:

> 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?

My conclusion is that Bar should be visible. This will be consistent
with how VISIBILITY overrides document-wide STARTUP settings.

Also, the comment in one of Org tests I was concerned about was
inaccurate - it tested for a slightly different bug.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a5c977b43

-- 
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>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-30 13:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-01-30 13:48   ` Ihor Radchenko

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).