emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: emacs-orgmode@gnu.org
Subject: Re: Re: postponing todos
Date: Tue, 21 Aug 2007 13:33:13 +0200	[thread overview]
Message-ID: <87643986me.fsf@bzg.ath.cx> (raw)
In-Reply-To: <fdfd0bf367bf3f35cc14c9679a447853@science.uva.nl> (Carsten Dominik's message of "Tue\, 21 Aug 2007 12\:19\:39 +0200")

Carsten Dominik <dominik@science.uva.nl> writes:

> Another option, maybe simpler, is to use the local options in agenda
> custom commands to insert a function into `org-agenda-skip-function'.

That's great!

Playing with this i wrote a custom agenda view that skips TODOs below
levels 1 and 2. This is something i've been looking for, since the
hierarchy of my Org file somehow reflects the importance of a task.

(setq org-agenda-custom-commands
      ;; Put your own custom key
      '(("c" todo "TODO"
	 ((org-agenda-skip-function 
            'org-agenda-skip-if-below-level)))))

(defun org-agenda-skip-if-below-level ()
  "Function that can be used in `org-agenda-skip-function',
to skip entries that are below a level 1 and 2."
  (let (beg end)
    (org-back-to-heading t)
    (setq beg (point))         ; beginning of headline
    (outline-next-heading)
    (setq end (point))         ; end of entry below heading
    (goto-char beg)
    (while (eq (get-text-property (point) 'face) 'org-hide)
      (forward-char))
    (if (not (member (get-text-property (point) 'face)
		     '(org-level-1 org-level-2)))
        (1- end)   ; skip, and continue search after END
      nil     ; Don't skip, use this entry.
      )))

-- 
Bastien

  parent reply	other threads:[~2007-08-21 11:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-06 15:42 postponing todos ignotus
2007-08-06 23:18 ` Bastien
2007-08-07  0:56   ` Bastien
2007-08-07  8:41   ` ignotus
2007-08-07  1:47 ` Eddward DeVilla
2007-08-07  8:25   ` ignotus
2007-08-07 17:13     ` Bastien
2007-08-07 20:03     ` Christian Egli
2007-08-07 20:14 ` Christian Egli
2007-08-09  5:05 ` Carsten Dominik
2007-08-11 14:29   ` ignotus
2007-08-21 10:19     ` Carsten Dominik
2007-08-21 10:43       ` Carsten Dominik
2007-08-21 11:33       ` Bastien [this message]
2007-08-11 15:31   ` ignotus
2007-08-11 16:34     ` Bastien

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=87643986me.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    /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).