From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Swartz Subject: Question about cycle mode and sorting/refiling Date: Thu, 04 Jun 2009 11:20:21 -0700 Message-ID: <4A281065.90700@oneroad.com> Reply-To: Keith Swartz Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2038620374==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MCNVD-00041g-L2 for emacs-orgmode@gnu.org; Thu, 04 Jun 2009 20:41:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MCNV8-0003uu-80 for emacs-orgmode@gnu.org; Thu, 04 Jun 2009 20:41:46 -0400 Received: from [199.232.76.173] (port=48124 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MCMRq-0007sV-K1 for emacs-orgmode@gnu.org; Thu, 04 Jun 2009 19:34:14 -0400 Received: from smtpauth02.csee.onr.siteprotect.com ([64.26.60.136]:54464) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MCHZx-0008KE-4K for emacs-orgmode@gnu.org; Thu, 04 Jun 2009 14:22:17 -0400 Received: from [192.168.1.120] (unknown [98.203.142.243]) (Authenticated sender: kswartz2@oneroad.com) by smtpauth02.csee.onr.siteprotect.com (Postfix) with ESMTP id 296A8E38039 for ; Thu, 4 Jun 2009 13:22:15 -0500 (CDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "[orgmode]" This is a multi-part message in MIME format. --===============2038620374== Content-Type: multipart/related; boundary="------------060107010107010100020407" This is a multi-part message in MIME format. --------------060107010107010100020407 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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
--------------060107010107010100020407 Content-Type: image/gif; name="oracle_sig_logo.gif" Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: inline; filename="oracle_sig_logo.gif" R0lGODlhcgAaAMQAAP8QEP/w8P/Q0P/g4P8wMP9gYP8gIP+goP9QUP+QkP+wsP9wcP+AgP9A QP/AwP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ACH5BAAAAAAALAAAAAByABoAAAX/ICSOZGmeaKqubOu+cCzPdC0GCqPvvBKUDp5wp1gFdIPV IDfcOQa6A8yRaO4gweQoUHh4v2Bw4SdihM9egyBF8ALIpkEXDR44vA2XwkD/IgYGAAZbbX1n BGRmhl8AWiUJYicCAIsPDFh4LXOGjQ4NAAhrEIUPBQcOqKmoB5sEZV4JqqoHhQVxlGAOJQG4 AAunsqg/dw95KwdfBgzBqKIEBMaQDwCiKpOwEIq6KANuJg14igZwEHPULMTGKbxetjF8D1It xK7aKl8lCl8DAfALW1+2rUi3QtqgGN2mwYCXzYvAON624LoEQZ9DEfRcEFSBIE2DjyBDfnyI qRgMcA8a/z5AZQWXOxEdHxwUgfIgsX/zMqlAWclVCQFefLpAqdJBAFJn3owgtpJEQkslEWjU mYLnomokcDlS4s0eFzQNqvXDEyzmAwFPyaXYmGJBuxlzELWIacueiE0AFGyF4HbaNTquUEpF RxUFUC9YXQzARYAkEJSNipKQ9kDu0i9SKKNZ9iXswMIoYgI4oJYFskpgzkkmcdrviELqmPVt 1HpRAaaLqCE1lBgjvEpqRtgl8Tevygd7TcCuiKvPm8OVEkAIYLYPThSsRIpEQJr1x94QBIT0 9FH6QJC6AiRAoB1kEb7tRb4MvyB+AwSlbejfz7+///8ABijggAQWaOCBCCao4A+CDDbo4IMQ RijhhBQKGAIAOw== --------------060107010107010100020407-- --===============2038620374== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============2038620374==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Question about cycle mode and sorting/refiling Date: Tue, 9 Jun 2009 12:10:46 +0200 Message-ID: References: <4A281065.90700@oneroad.com> Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDyIB-0004bx-F5 for emacs-orgmode@gnu.org; Tue, 09 Jun 2009 06:10:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDyI6-0004SE-LT for emacs-orgmode@gnu.org; Tue, 09 Jun 2009 06:10:54 -0400 Received: from [199.232.76.173] (port=44842 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDyI6-0004Rj-EG for emacs-orgmode@gnu.org; Tue, 09 Jun 2009 06:10:50 -0400 Received: from mail-ew0-f225.google.com ([209.85.219.225]:51139) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDyI5-0000xz-Vn for emacs-orgmode@gnu.org; Tue, 09 Jun 2009 06:10:50 -0400 Received: by ewy25 with SMTP id 25so205610ewy.42 for ; Tue, 09 Jun 2009 03:10:49 -0700 (PDT) In-Reply-To: <4A281065.90700@oneroad.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Keith Swartz Cc: "[orgmode]" On Jun 4, 2009, at 8:20 PM, Keith Swartz wrote: > 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)) There seem to be parenthesis missing from these definitions, but I am assuming that you do have them in your real setup. > > 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), I believe this problem is now solved, I needed to deactive the region before calling this hook. Please upgrade to the latest git release and try again. > 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. I am not sure if I understand correctly. Do you mean the outline node where the refiled items *originate* changes visibility? I cannot reproduce this. Maybe you can try with the latest version and then, if the problem persists, come up with a test case. HTH - Carsten From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Swartz Subject: Re: Question about cycle mode and sorting/refiling Date: Tue, 09 Jun 2009 23:59:03 -0700 Message-ID: <4A2F59B7.6050107@oneroad.com> References: <4A281065.90700@oneroad.com> Reply-To: Keith Swartz Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEHnp-0002Yt-Bi for emacs-orgmode@gnu.org; Wed, 10 Jun 2009 03:00:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MEHnk-0002Wq-MB for emacs-orgmode@gnu.org; Wed, 10 Jun 2009 03:00:52 -0400 Received: from [199.232.76.173] (port=51607 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEHnk-0002Wk-9m for emacs-orgmode@gnu.org; Wed, 10 Jun 2009 03:00:48 -0400 Received: from smtpauth03.csee.onr.siteprotect.com ([64.26.60.137]:44111) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MEHnj-0005Ad-Ou for emacs-orgmode@gnu.org; Wed, 10 Jun 2009 03:00:48 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: "[orgmode]" Hi Carsten, The changes in the latest git version appear to have fixed these problems. Thanks. However, I've discovered a new problem, which is probably not related. If you refile one or more items to the same subtree, it wreaks havoc. In some cases, the item or entire subtree is apparently lost. It's late, but I'll try to submit a small test case soon. Thanks, Keith Carsten Dominik wrote: > > On Jun 4, 2009, at 8:20 PM, Keith Swartz wrote: > >> 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)) > > There seem to be parenthesis missing from these definitions, but I > am assuming that you do have them in your real setup. > >> >> 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), > > I believe this problem is now solved, I needed to deactive the region > before calling this hook. Please upgrade to the latest git release > and try again. > >> 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. > > I am not sure if I understand correctly. Do you mean the outline node > where the refiled items *originate* changes visibility? I cannot > reproduce this. Maybe you can try with the latest version and then, > if the problem persists, come up with a test case. > > HTH > > - Carsten > >