emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Re: how to do this org-agenda command?


From: Richard KLINDA
Subject: Re: [Orgmode] Re: how to do this org-agenda command?
Date: Sat, 07 Feb 2009 15:31:07 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) XEmacs/21.4 (Educational Television, linux)

>>>>> Regarding 'Re: [Orgmode] Re: how to do this org-agenda command?'; Manish 
>>>>> adds:


  > How about switching the TODO state when you clock in to a task and
  > adding a block to the custom agenda to inlude tasks with that state?

  > --8<---------------cut here---------------start------------->8---
  > (setq org-clock-in-switch-to-state "STARTED")
  > --8<---------------cut here---------------end--------------->8---

Thanks, in the end I wrote a hackish org-agenda-skip-function for my
needs.  Thank you for your input.

,----
| (defun rk-org-agenda-skip-not-interesting ()
|   "Skip not interesting TODO entries, only keep:
|   - [#A] priority entries,
|   - scheduled for today entries,
|   - entries that are clocked in.
| Ripped from org-agenda-skip-if function."
|   (let (beg end m)
|     (org-back-to-heading t)
|     (setq beg (point)
|         end (progn (outline-next-heading) (1- (point))))
|     (goto-char beg)
|     (and (and
|           ;; CLOCKED IN entries
|           (not (save-excursion
|                  (when (re-search-forward "^ +CLOCK: \\[.*?\\]$" end t)
|                    (beginning-of-line)
|                    (not (re-search-forward "--" (line-end-position) t))
|                    )))
|           ;; PRIORITY [#A] entries
|           (not (save-excursion
|                  (re-search-forward "\\[#A\\]" end t)))
|           ;; SCHEDULED FOR (TO)DAY entries
|           (not (save-excursion
|                  (when (re-search-forward org-ts-regexp
|                                           end t)
|                    (calendar-date-equal (org-date-to-gregorian
|                                          (time-to-days
|                                           (org-time-string-to-time 
(match-string 0))))
|                                         date
|                                         )))))
|          end)))
`----

Usage example:

,----
|           ...
|           (alltodo "" ((org-agenda-skip-function
|                         'rk-org-agenda-skip-not-interesting)))
|           ...
`----

-- 
Richard




reply via email to

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