emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: Wanrong Lin <wanrong.lin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Level specification in refiling target
Date: Sun, 09 Dec 2007 21:32:09 +0000	[thread overview]
Message-ID: <873aubimg6.fsf@bzg.ath.cx> (raw)
In-Reply-To: <4756C8B4.40805@gmail.com> (Wanrong Lin's message of "Wed, 05 Dec 2007 10:50:12 -0500")

Wanrong Lin <wanrong.lin@gmail.com> 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

  reply	other threads:[~2007-12-09 20:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-05 15:50 Level specification in refiling target Wanrong Lin
2007-12-09 21:32 ` Bastien [this message]
2007-12-17 16:11 ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873aubimg6.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=wanrong.lin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).