emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tor Kringeland <tor.kringeland@ntnu.no>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Re: Change in `org-cycle-hook' breaks behavior
Date: Sat, 28 May 2022 14:14:00 +0000	[thread overview]
Message-ID: <m21qwdycbd.fsf@ntnu.no> (raw)
In-Reply-To: <875ylpvnhi.fsf@localhost>

Ihor Radchenko <yantar92@gmail.com> writes:

> If you want all the drawers in all the children to be opened, you can
> instead do the following:
>
> (let* ((headline (save-excursion (org-back-to-heading) (org-element-at-point))))
>   (when headline
>     (org-fold-region
>      (org-element-property :begin headline)
>      (org-element-property :end headline)
>      nil 'drawer)))

Thanks, this does exactly what I want when I add it as a hook to
`org-cycle' :)

> I am not sure. Can you elaborate what exactly you want to achieve?

For me in Org 9.5 `org-cycle' without `org-cycle-hide-drawers' would do
the following (on each tab press)

#+begin_example
* first...

--> TAB

* first
  :PROPERTIES:...

** second
** third

--> TAB

* first
  :PROPERTIES
  :ID: abc
  :END:

** second
  :PROPERTIES
  :ID: cba
  :END:

** third
  :PROPERTIES
  :ID: 123
  :END:

--> TAB

* first...
#+end_example

So adding the code you sent as a hook to `org-cycle' (and ignoring the
STATE argument) the same behavior is replicated, except that on the
first TAB press, the properties of the =first= headline is shown.  I'm
indifferent to whether its properties are shown on the first TAB press
or not, though (the most important thing was just to get all the
properties of the secondary headlines on the second TAB press), so your
code solves my issue.  Thanks again.

Maybe a function like that could be added to Org, that the user could
add to `org-cycle-hooks' to produce the "opposite" of
`org-cycle-hide-drawers'/does what `org-cycle' used to do without
`org-cycle-hide-drawers' in the hook in Org 9.5?

  reply	other threads:[~2022-05-28 14:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 16:33 Change in `org-cycle-hook' breaks behavior Tor Kringeland
2022-05-27  7:10 ` [PATCH] " Ihor Radchenko
2022-05-27 12:41   ` Tor Kringeland
2022-05-28  3:31     ` Ihor Radchenko
2022-05-28 12:06       ` Tor Kringeland
2022-05-28 12:10         ` Tor Kringeland
2022-05-28 12:40         ` Ihor Radchenko
2022-05-28 14:14           ` Tor Kringeland [this message]
2022-05-29 12:19             ` Ihor Radchenko
2022-06-25  5:18   ` 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=m21qwdycbd.fsf@ntnu.no \
    --to=tor.kringeland@ntnu.no \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@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).