From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Level specification in refiling target Date: Sun, 09 Dec 2007 21:32:09 +0000 Message-ID: <873aubimg6.fsf@bzg.ath.cx> References: <4756C8B4.40805@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1Soz-0004o0-PC for emacs-orgmode@gnu.org; Sun, 09 Dec 2007 15:32:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1Soy-0004mR-48 for emacs-orgmode@gnu.org; Sun, 09 Dec 2007 15:32:17 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1Soy-0004mJ-1C for emacs-orgmode@gnu.org; Sun, 09 Dec 2007 15:32:16 -0500 Received: from nf-out-0910.google.com ([64.233.182.184]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J1Sox-0005y9-MY for emacs-orgmode@gnu.org; Sun, 09 Dec 2007 15:32:15 -0500 Received: by nf-out-0910.google.com with SMTP id f5so946894nfh for ; Sun, 09 Dec 2007 12:32:14 -0800 (PST) In-Reply-To: <4756C8B4.40805@gmail.com> (Wanrong Lin's message of "Wed, 05 Dec 2007 10:50:12 -0500") 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: Wanrong Lin Cc: emacs-orgmode@gnu.org Wanrong Lin writes: > I have a line like this (copied from the org release notes) > > (setq org-refile-targets '((org-agenda-files . (:level . 2)))) > > My intention was to have all headings in level 2 AND level 1 in the > target list. But it seems only level 2 headings are in the list. Is > there a way to do it? If not, can we consider adding that? Thanks a > lot. This makes sense. Here is a dumb patch against Org 5.16b that should implement the expected behavior. diff -u /home/guerry/elisp/testing/org-5.16b/ /home/guerry/elisp/testing/tmp/org.el --- /home/guerry/elisp/testing/org-5.16b/org.el 2007-12-04 08:40:13.000000000 +0000 +++ /home/guerry/elisp/testing/tmp/org.el 2007-12-09 21:23:48.000000000 +0000 @@ -13486,7 +13486,7 @@ ((eq (car desc) :regexp) (setq descre (cdr desc))) ((eq (car desc) :level) - (setq descre (concat "^\\*\\{" (number-to-string + (setq descre (concat "^\\*\\{1," (number-to-string (if org-odd-levels-only (1- (* 2 (cdr desc))) (cdr desc))) Diff finished. Sun Dec 9 21:23:55 2007 I'm not sure it's the right thing to do, though. Maybe it's better to let the user define the level as a string of the form "1,2" (for levels one to two, or "2,5" (for levels 2 to 5) or "5," etc. -- Bastien