From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Don't create marker if target is entire file. Date: Tue, 6 Jul 2010 09:01:16 +0200 Message-ID: <247582F3-920B-46B9-8459-5DA39890CBCF@gmail.com> References: <8739vzpqx1.wl%dmaus@ictsoc.de> <1278358114-1212-1-git-send-email-dmaus@ictsoc.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=51461 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW29k-0006UO-0f for emacs-orgmode@gnu.org; Tue, 06 Jul 2010 03:01:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OW29i-0006wW-Ox for emacs-orgmode@gnu.org; Tue, 06 Jul 2010 03:01:23 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:46092) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OW29i-0006wM-EO for emacs-orgmode@gnu.org; Tue, 06 Jul 2010 03:01:22 -0400 Received: by bwz9 with SMTP id 9so4121540bwz.0 for ; Tue, 06 Jul 2010 00:01:20 -0700 (PDT) In-Reply-To: <1278358114-1212-1-git-send-email-dmaus@ictsoc.de> 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: David Maus Cc: emacs-orgmode@gnu.org Applied, thanks. I am really enjoying how things get resolved now without me interacting, and all I need to do is to apply a patch. Thanks to all who contributed in this thread and in others! - Carsten On Jul 5, 2010, at 9:28 PM, David Maus wrote: > * org-agenda.el (org-agenda-bulk-action): Don't create marker for > position if target is entire file. > > If the target of a bulk refile operation is the entire file, > `org-refile-get-location' returns nil for the refile position. > Creating a marker for the target file's buffer at position nil returns > a marker that points nowhere (Cf. GNU Emacs Lisp Reference Manual, > 31.6). `org-refile' adds headings to level 1 if the target position > for the target file is nil -- and hence a marker that points nowhere > is not nil, tries to jump to nowhere. > --- > lisp/org-agenda.el | 11 ++++++----- > 1 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index 4345f06..1fe4639 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -7489,11 +7489,12 @@ The prefix arg is passed through to the > command if possible." > "Refile to: " > (marker-buffer (car org-agenda-bulk-marked-entries)) > org-refile-allow-creating-parent-nodes)) > - (setcar (nthcdr 3 rfloc) > - (move-marker (make-marker) (nth 3 rfloc) > - (or (get-file-buffer (nth 1 rfloc)) > - (find-buffer-visiting (nth 1 rfloc)) > - (error "This should not happen")))) > + (if (nth 3 rfloc) > + (setcar (nthcdr 3 rfloc) > + (move-marker (make-marker) (nth 3 rfloc) > + (or (get-file-buffer (nth 1 rfloc)) > + (find-buffer-visiting (nth 1 rfloc)) > + (error "This should not happen"))))) > > (setq cmd (list 'org-agenda-refile nil (list 'quote rfloc) t) > redo-at-end t)) > -- > 1.7.1 > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten