emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Behavior of `org-show-entry'
@ 2017-02-05 20:11 Eric Abrahamsen
  2017-02-05 22:03 ` Kyle Meyer
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Abrahamsen @ 2017-02-05 20:11 UTC (permalink / raw)
  To: emacs-orgmode

I do a lot of my Org navigation with `helm-org-in-buffer-headings' and
`helm-org-agenda-files-headings', which prompt you for an org heading,
then take you there.

I'm always annoyed that, once you're at the heading, it leaves it in
a half-open state where you can see the immediate text of the target
entry, but all of its child entries are replaced by an ellipses.

* Target Heading
  Drawers and text
  ... # ellipses instead of child headings
* Next Heading

You then have to hit <tab> twice to see the children.

The helm commands end by calling `org-show-entry', which first does
this:

(outline-flag-region
 (max (point-min) (1- (point)))
 (save-excursion
   (if (re-search-forward
	(concat "[\r\n]\\(" org-outline-regexp "\\)") nil t)
       (match-beginning 1)
     (point-max)))
  nil)

Which leaves the heading in the state described above, and then does
this:

(org-cycle-hide-drawers 'children)

Which has no effect.

I'm not really sure what the purpose of `outline-flag-region' is, but
I'm pretty sure this isn't the desired effect. The call to
`org-cycle-hide-drawers' should reveal children, isn't that right?

Which part of this should be tweaked to achieve the desired effect?

Thanks!
Eric

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

* Re: Behavior of `org-show-entry'
  2017-02-05 20:11 Behavior of `org-show-entry' Eric Abrahamsen
@ 2017-02-05 22:03 ` Kyle Meyer
  2017-02-05 23:16   ` Eric Abrahamsen
  0 siblings, 1 reply; 7+ messages in thread
From: Kyle Meyer @ 2017-02-05 22:03 UTC (permalink / raw)
  To: Eric Abrahamsen, emacs-orgmode

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I do a lot of my Org navigation with `helm-org-in-buffer-headings' and
> `helm-org-agenda-files-headings', which prompt you for an org heading,
> then take you there.
>
> I'm always annoyed that, once you're at the heading, it leaves it in
> a half-open state where you can see the immediate text of the target
> entry, but all of its child entries are replaced by an ellipses.
>
> * Target Heading
>   Drawers and text
>   ... # ellipses instead of child headings
> * Next Heading
>
> You then have to hit <tab> twice to see the children.
>
> The helm commands end by calling `org-show-entry', which first does
> this:
>
> (outline-flag-region
>  (max (point-min) (1- (point)))
>  (save-excursion
>    (if (re-search-forward
> 	(concat "[\r\n]\\(" org-outline-regexp "\\)") nil t)
>        (match-beginning 1)
>      (point-max)))
>   nil)
>
> Which leaves the heading in the state described above, and then does
> this:
>
> (org-cycle-hide-drawers 'children)
>
> Which has no effect.
>
> I'm not really sure what the purpose of `outline-flag-region' is, but
> I'm pretty sure this isn't the desired effect.

Based on how org-show-entry calls it, outline-flag-region shows the text
from the current heading to the next.  So it seems to behave as
documented: "[s]how the body directly following this heading".

> The call to `org-cycle-hide-drawers' should reveal children, isn't
> that right?

The purpose isn't to reveal the child headings (I don't understand why
the argument is called "children"), but to hide the drawers.

Without the org-cycle-hide-drawers call, org-show-entry would expand

    * TODO blah...

to

    * TODO blah
    SCHEDULED: <2017-02-12 Sun .+1w>
    :PROPERTIES:
    :LAST_REPEAT: [2017-02-05 Sun 16:31]
    :END:
    :LOGBOOK:
    - State "DONE"       from "TODO"       [2017-02-05 Sun 16:31]
    :END:

instead of

    * TODO blah
    SCHEDULED: <2017-02-12 Sun .+1w>
    :PROPERTIES:...
    :LOGBOOK:...

> Which part of this should be tweaked to achieve the desired effect?

Perhaps helm could call org-show-children after it calls org-show-entry.

-- 
Kyle

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

* Re: Behavior of `org-show-entry'
  2017-02-05 22:03 ` Kyle Meyer
@ 2017-02-05 23:16   ` Eric Abrahamsen
  2017-02-06  0:31     ` Kyle Meyer
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Abrahamsen @ 2017-02-05 23:16 UTC (permalink / raw)
  To: emacs-orgmode

Kyle Meyer <kyle@kyleam.com> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> I do a lot of my Org navigation with `helm-org-in-buffer-headings' and
>> `helm-org-agenda-files-headings', which prompt you for an org heading,
>> then take you there.
>>
>> I'm always annoyed that, once you're at the heading, it leaves it in
>> a half-open state where you can see the immediate text of the target
>> entry, but all of its child entries are replaced by an ellipses.
>>
>> * Target Heading
>>   Drawers and text
>>   ... # ellipses instead of child headings
>> * Next Heading
>>
>> You then have to hit <tab> twice to see the children.
>>
>> The helm commands end by calling `org-show-entry', which first does
>> this:
>>
>> (outline-flag-region
>>  (max (point-min) (1- (point)))
>>  (save-excursion
>>    (if (re-search-forward
>> 	(concat "[\r\n]\\(" org-outline-regexp "\\)") nil t)
>>        (match-beginning 1)
>>      (point-max)))
>>   nil)
>>
>> Which leaves the heading in the state described above, and then does
>> this:
>>
>> (org-cycle-hide-drawers 'children)
>>
>> Which has no effect.
>>
>> I'm not really sure what the purpose of `outline-flag-region' is, but
>> I'm pretty sure this isn't the desired effect.
>
> Based on how org-show-entry calls it, outline-flag-region shows the text
> from the current heading to the next.  So it seems to behave as
> documented: "[s]how the body directly following this heading".

Okay, but I still don't see how this would ever be the desired result.
You can't get to *any* next visibility state without first wasting a
<tab>.

>> The call to `org-cycle-hide-drawers' should reveal children, isn't
>> that right?
>
> The purpose isn't to reveal the child headings (I don't understand why
> the argument is called "children"), but to hide the drawers.

Weird! But thank you for doing the thinking I was apparently too lazy to
do :)

[...]

>> Which part of this should be tweaked to achieve the desired effect?
>
> Perhaps helm could call org-show-children after it calls org-show-entry.

Okay, cool. I guess my main question was: should this be fixed in helm,
or in org? I'll try clobbering the helm functions for a while and see
how that goes, then raise this on the helm list.

Thanks for your help,
Eric

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

* Re: Behavior of `org-show-entry'
  2017-02-05 23:16   ` Eric Abrahamsen
@ 2017-02-06  0:31     ` Kyle Meyer
  2017-02-06 13:11       ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Kyle Meyer @ 2017-02-06  0:31 UTC (permalink / raw)
  To: emacs-orgmode

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Kyle Meyer <kyle@kyleam.com> writes:

[...]

>> Based on how org-show-entry calls it, outline-flag-region shows the text
>> from the current heading to the next.  So it seems to behave as
>> documented: "[s]how the body directly following this heading".
>
> Okay, but I still don't see how this would ever be the desired result.
> You can't get to *any* next visibility state without first wasting a
> <tab>.

Yeah, fair enough.  I can't think of a situation where I would desire
that result either.  But I think org-show-entry probably should behave
this way to be consistent with outline-show-entry.

>>> Which part of this should be tweaked to achieve the desired effect?
>>
>> Perhaps helm could call org-show-children after it calls org-show-entry.
>
> Okay, cool. I guess my main question was: should this be fixed in helm,
> or in org? I'll try clobbering the helm functions for a while and see
> how that goes, then raise this on the helm list.

Hmm, for the reason I gave above, I don't think org-show-entry should
change, but perhaps there should be a separate function that does

    (org-show-entry)
    (org-with-limited-levels (org-show-children))

which is what org-cycle does for the second state listed in its
docstring.  Or maybe there is a better way to accomplish this that I
don't know about.

-- 
Kyle

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

* Re: Behavior of `org-show-entry'
  2017-02-06  0:31     ` Kyle Meyer
@ 2017-02-06 13:11       ` Nicolas Goaziou
  2017-02-06 17:18         ` Kyle Meyer
  2017-02-06 17:29         ` Eric Abrahamsen
  0 siblings, 2 replies; 7+ messages in thread
From: Nicolas Goaziou @ 2017-02-06 13:11 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

Hello,

Kyle Meyer <kyle@kyleam.com> writes:

> Hmm, for the reason I gave above, I don't think org-show-entry should
> change, but perhaps there should be a separate function that does
>
>     (org-show-entry)
>     (org-with-limited-levels (org-show-children))
>
> which is what org-cycle does for the second state listed in its
> docstring.  Or maybe there is a better way to accomplish this that I
> don't know about.

See `org-show-context' and `org-reveal'.

Regards,

-- 
Nicolas Goaziou

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

* Re: Behavior of `org-show-entry'
  2017-02-06 13:11       ` Nicolas Goaziou
@ 2017-02-06 17:18         ` Kyle Meyer
  2017-02-06 17:29         ` Eric Abrahamsen
  1 sibling, 0 replies; 7+ messages in thread
From: Kyle Meyer @ 2017-02-06 17:18 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Kyle Meyer <kyle@kyleam.com> writes:
>
>> Hmm, for the reason I gave above, I don't think org-show-entry should
>> change, but perhaps there should be a separate function that does
>>
>>     (org-show-entry)
>>     (org-with-limited-levels (org-show-children))
>>
>> which is what org-cycle does for the second state listed in its
>> docstring.  Or maybe there is a better way to accomplish this that I
>> don't know about.
>
> See `org-show-context' and `org-reveal'.

Sadly, I had already seen these, and I still answered what I did :)

It seems like, with the default value of org-show-context-detail,
(org-show-context 'agenda) will show the desired view of

    * a
    
    
    a body
    
    ** aa...
    * b

So, do you recommend that, assuming helm wants this view after jumping
to a heading, it calls (org-show-set-visibility 'local)?  Or should it
use its own key, something like (org-show-context 'helm), so that users
can customize the key in org-show-context-detail?  Or something else?

Thanks.

-- 
Kyle

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

* Re: Behavior of `org-show-entry'
  2017-02-06 13:11       ` Nicolas Goaziou
  2017-02-06 17:18         ` Kyle Meyer
@ 2017-02-06 17:29         ` Eric Abrahamsen
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Abrahamsen @ 2017-02-06 17:29 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Kyle Meyer <kyle@kyleam.com> writes:
>
>> Hmm, for the reason I gave above, I don't think org-show-entry should
>> change, but perhaps there should be a separate function that does
>>
>>     (org-show-entry)
>>     (org-with-limited-levels (org-show-children))
>>
>> which is what org-cycle does for the second state listed in its
>> docstring.  Or maybe there is a better way to accomplish this that I
>> don't know about.
>
> See `org-show-context' and `org-reveal'.

Thanks to you both -- I'll bring this up with the Helm people.

Eric

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

end of thread, other threads:[~2017-02-06 17:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-05 20:11 Behavior of `org-show-entry' Eric Abrahamsen
2017-02-05 22:03 ` Kyle Meyer
2017-02-05 23:16   ` Eric Abrahamsen
2017-02-06  0:31     ` Kyle Meyer
2017-02-06 13:11       ` Nicolas Goaziou
2017-02-06 17:18         ` Kyle Meyer
2017-02-06 17:29         ` Eric Abrahamsen

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