From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Re: postponing todos Date: Tue, 21 Aug 2007 13:33:13 +0200 Message-ID: <87643986me.fsf@bzg.ath.cx> References: <878x8osm96.fsf@freemail.hu> <2151c7f8a47e69a374e5edbed368e83d@science.uva.nl> <87absyw3dt.fsf_-_@freemail.hu> 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 1INRzF-0001nF-AW for emacs-orgmode@gnu.org; Tue, 21 Aug 2007 07:33:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1INRzD-0001mZ-2A for emacs-orgmode@gnu.org; Tue, 21 Aug 2007 07:33:28 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INRzC-0001mV-V4 for emacs-orgmode@gnu.org; Tue, 21 Aug 2007 07:33:27 -0400 Received: from hu-out-0506.google.com ([72.14.214.238]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1INRzB-0005No-QY for emacs-orgmode@gnu.org; Tue, 21 Aug 2007 07:33:26 -0400 Received: by hu-out-0506.google.com with SMTP id 23so2235928huc for ; Tue, 21 Aug 2007 04:33:19 -0700 (PDT) In-Reply-To: (Carsten Dominik's message of "Tue\, 21 Aug 2007 12\:19\:39 +0200") 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: emacs-orgmode@gnu.org Carsten Dominik 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