emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Noah Slater <nslater@tumbolia.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Sorting nodes by clocked time
Date: Thu, 17 Apr 2014 13:55:21 +0200	[thread overview]
Message-ID: <87mwfkb26u.fsf@bzg.ath.cx> (raw)
In-Reply-To: <CA+Y+4471eHC7=kLUxRGTT8LGO0aLKmf7TZU=MwwwZ2N4rNUFQA@mail.gmail.com> (Noah Slater's message of "Thu, 17 Apr 2014 13:33:45 +0200")

Noah Slater <nslater@tumbolia.org> writes:

> Okay, that seem to work.
>
> But I'm not able to get this work:
>
> (add-hook 'org-after-sorting-entries-or-items-hook
>           (lambda() (org-cycle-hide-drawers 'children)))
>
> After running the sort, all the LOGBOOK draws are still open.

Try this:

(defun my-hide-all-drawers-in-current-subtree ()
  "Hide all drawers in the current subtree."
  (save-restriction
    (org-narrow-to-subtree)
    (org-cycle-hide-drawers 'all)
    (org-cycle-internal-local)))

(add-hook 'org-after-sorting-entries-or-items-hook
	  'my-hide-all-drawers-in-current-subtree)

> I'm also thinking: even if this closes the logbook draws, all the
> nodes will be unfolded. But my node tree is quite large. Is it be
> possible to refold all the nodes after n-levels?
>
> So let's say I have:
>
> * Level 1
> ** Level 2
> *** Level 3
>
> If I move the point to Level 1 and sort, I'd like it fold all Level 2
> items, but leave Level 1 unfolded.

You can fix the cycling through the hook above.

HTH,

-- 
 Bastien

  reply	other threads:[~2014-04-17 11:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07 16:44 Sorting nodes by clocked time Noah Slater
2014-04-17  8:33 ` Bastien
2014-04-17 10:39   ` Noah Slater
2014-04-17 10:41     ` Noah Slater
2014-04-17 11:00       ` Bastien
2014-04-17 10:55     ` Bastien
2014-04-17 10:57       ` Noah Slater
2014-04-17 11:00         ` Bastien
2014-04-17 11:02           ` Noah Slater
2014-04-17 11:20             ` Bastien
2014-04-17 11:33               ` Noah Slater
2014-04-17 11:55                 ` Bastien [this message]
2014-04-17 12:02                   ` Noah Slater
2014-04-17 12:20                     ` Noah Slater
2014-04-17 12:25                       ` Bastien
2014-04-17 12:26                     ` Bastien
2014-04-17 12:34                       ` Noah Slater
2014-04-17 12:45                         ` Noah Slater
2014-04-17 14:42                           ` Noah Slater
2014-04-17 15:05                             ` Bastien
2014-04-18  0:09                             ` Sacha Chua
2014-04-20  9:48                               ` Noah Slater
2014-04-17 14:45                         ` Bastien

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=87mwfkb26u.fsf@bzg.ath.cx \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=nslater@tumbolia.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).