From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: agenda bulk refile error Date: Tue, 4 Aug 2009 21:12:56 +0200 Message-ID: References: <878whztq6x.fsf@gollum.intra.norang.ca> 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 1MYPRi-0000m8-2j for emacs-orgmode@gnu.org; Tue, 04 Aug 2009 15:13:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYPRd-0000gp-4c for emacs-orgmode@gnu.org; Tue, 04 Aug 2009 15:13:13 -0400 Received: from [199.232.76.173] (port=51623 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYPRd-0000gg-1H for emacs-orgmode@gnu.org; Tue, 04 Aug 2009 15:13:09 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:65434) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MYPRc-000216-JR for emacs-orgmode@gnu.org; Tue, 04 Aug 2009 15:13:08 -0400 Received: by ewy7 with SMTP id 7so934804ewy.42 for ; Tue, 04 Aug 2009 12:13:08 -0700 (PDT) In-Reply-To: <878whztq6x.fsf@gollum.intra.norang.ca> 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: Bernt Hansen Cc: emacs-orgmode@gnu.org Hi Bernt, what would be the *wanted* result of marking both a parent and its child, and then refiling both? I guess the problem happens when you first refile the parent, and then the child. The reason for this is that, when an entry is refiled from the agenda, all entries in the agenda that stem from the subtree of this item will be removed from the agenda. This is the right ting to do, but of course it causes problems if you have marked both a parent and one of it's children. Would it be acceptable that first the child gets refiled, and then the parent? If yes, a simple solution would be to sort the task markers by buffer position before doing te bulk command. However, it seems to me that the right course of action would be to move the parent with its subtree, and to ignore the mark on the child. We could, instead of throwing an error, prompt the user about how to proceed. Of set a variable that such errors should simply be ignored. - Carsten On Aug 4, 2009, at 8:00 PM, Bernt Hansen wrote: > Every so often I run into a situation where bulk refiling doesn't work > anymore. > > I currently have 15 items in my refile.org file that I want to > refile to > other locations. I marked a few of them and bulk refiled them just > fine. Then I marked a few more and B r fails with "Cannot find entry > for marker #" > > I think this happens when I mark multiple tasks in the same subtree > (i.e. the parent and a sibling) and refile both to the same location. > After that it gets confused. > > If I have a task like this in refile.org > > #+FILETAGS: REFILE > * Test > ** Test 2 > > and run a tags match on REFILE I see both tasks. Mark both with m in > the agenda and B r to some other location. It refiles the first (and > this moves the sibling too) and then it's broken after that. > > I get the following backtrace > > Debugger entered--Lisp error: (error "Cannot find entry for marker > #") > signal(error ("Cannot find entry for marker # norang.org>")) > error("Cannot find entry for marker %s" # norang.org>) > (or (text-property-any (point-min) (point-max) (quote org-hd- > marker) e) (error "Cannot find entry for marker %s" e)) > (goto-char (or (text-property-any ... ... ... e) (error "Cannot > find entry for marker %s" e))) > (while (setq e (pop entries)) (goto-char (or ... ...)) (eval cmd) > (setq org-agenda-bulk-marked-entries (delete e org-agenda-bulk- > marked-entries)) (setq cnt (1+ cnt))) > (let* ((action ...) (entries ...) cmd rfloc state e tag (cnt 0)) > (cond (... ...) (... ...) (... ... ... ...) (... ... ...) > (... ... ...) (... ...) (t ...)) (while (setq e ...) (goto-char ...) > (eval cmd) (setq org-agenda-bulk-marked-entries ...) (setq cnt ...)) > (setq org-agenda-bulk-marked-entries nil) (org-agenda-bulk-remove- > all-marks) (message "Acted on %d entries" cnt)) > org-agenda-bulk-action() > call-interactively(org-agenda-bulk-action) > > I've since changed my refile custom view to only show level 1 tasks to > avoid this problem. > > -Bernt > > > _______________________________________________ > 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