emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Question about cycle mode and sorting/refiling


From: Keith Swartz
Subject: [Orgmode] Question about cycle mode and sorting/refiling
Date: Thu, 04 Jun 2009 11:20:21 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666

A few weeks back, I asked about hooks when refiling and/or sorting, and am happy to report that these are working great for me ... /if/ I refile one item at a time. I'm unable to figure out why if I try to refile multiple items in a /region/, it doesn't have the same behavior.

Here are my hook definitions:

(setq org-after-refile-insert-hook
    '(lambda() (org-up-heading-safe) (org-sort-entries-or-items nil ?p))
(setq org-after-sorting-entries-or-items-hook
    '(lambda() (org-cycle) (org-cycle))

If I position the cursor on an item and refile it, it: a) resorts the destination tree by priority, and b) restores the visibility to folded, the way I like it.

HOWEVER, if I select multiple items in a folded subtree (with transient-mark-mode on; I'm using emacs 22.3), and reflie those, it does not always work. I can't figure out the rules for when it does, and when it doesn't, but when it does work, that appears to be an abnormality.

What happens in this scenario is that it will refile the items, but it will neither resort the destination folder (even though the hook is being called), and the visibility of the refiled nodes is not reset. Plus, the visibility of all items below the current point in the /originating/ folder is also changed to children.

What's causing the discrepancy? Hopefully knowing this will be enough to tell me how I can adjust the hooks accordingly.

Thanks,
Keith
--


Keith M. Swartz | Senior Software Architect | 206.545.4324
Oracle Applications Technology Integration
Seattle, WA | AIM/Y!: kswartz26
Please see Contact Info in aria for dates of HQ Visits

reply via email to

[Prev in Thread] Current Thread [Next in Thread]