浏览代码

Agenda: New skipping conditions timestamp and nottimestamp.

The org-agenda-skip-xxx-if functions can now also handle a `timestamp'
and a `nottimestamp' condition.
Carsten Dominik 16 年之前
父节点
当前提交
4e973c6b82
共有 3 个文件被更改,包括 13 次插入0 次删除
  1. 2 0
      doc/org.texi
  2. 5 0
      lisp/ChangeLog
  3. 6 0
      lisp/org-agenda.el

+ 2 - 0
doc/org.texi

@@ -10096,6 +10096,8 @@ Skip current entry if it has not been scheduled.
 Skip current entry if it has a deadline.
 @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
 Skip current entry if it has a deadline, or if it is scheduled.
+@item '(org-agenda-skip-entry-if 'timestamp)
+Skip current entry if it has any timestamp, may also be deadline or scheduled.
 @item '(org-agenda-skip-entry 'regexp "regular expression")
 Skip current entry if the regular expression matches in the entry.
 @item '(org-agenda-skip-entry 'notregexp "regular expression")

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2009-02-04  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-agenda.el (org-agenda-skip-if): New conditions timestamp and
+	nottimestamp.
+
 2009-02-02  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-mode): Make dependence stuff work more reliably.

+ 6 - 0
lisp/org-agenda.el

@@ -2978,6 +2978,8 @@ scheduled     Check if there is a scheduled cookie
 notscheduled  Check if there is no scheduled cookie
 deadline      Check if there is a deadline
 notdeadline   Check if there is no deadline
+timestamp     Check if there is a timestamp (also deadline or scheduled)
+nottimestamp  Check if there is no timestamp (also deadline or scheduled)
 regexp        Check if regexp matches
 notregexp     Check if regexp does not match.
 
@@ -3004,6 +3006,10 @@ that can be put into `org-agenda-skip-function' for the duration of a command."
 	   (re-search-forward org-deadline-time-regexp end t))
       (and (memq 'notdeadline conditions)
 	   (not (re-search-forward org-deadline-time-regexp end t)))
+      (and (memq 'timestamp conditions)
+	   (re-search-forward org-ts-regexp end t))
+      (and (memq 'nottimestamp conditions)
+	   (not (re-search-forward org-ts-regexp end t)))
       (and (setq m (memq 'regexp conditions))
 	   (stringp (nth 1 m))
 	   (re-search-forward (nth 1 m) end t))