emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: postponing todos


From: Bastien
Subject: Re: [Orgmode] Re: postponing todos
Date: Tue, 21 Aug 2007 13:33:13 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux)

Carsten Dominik <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]