|
@@ -4878,39 +4878,41 @@ keywords. Possible classes are: `todo', `done', `any'.
|
|
|
If any of these conditions is met, this function returns the end point of
|
|
|
the entity, causing the search to continue from there. This is a function
|
|
|
that can be put into `org-agenda-skip-function' for the duration of a command."
|
|
|
- (let (beg end m)
|
|
|
- (org-back-to-heading t)
|
|
|
- (setq beg (point)
|
|
|
- end (if subtree
|
|
|
- (progn (org-end-of-subtree t) (point))
|
|
|
- (progn (outline-next-heading) (1- (point)))))
|
|
|
- (goto-char beg)
|
|
|
+ (org-back-to-heading t)
|
|
|
+ (let* ((beg (point))
|
|
|
+ (end (if subtree (save-excursion (org-end-of-subtree t) (point))
|
|
|
+ (org-entry-end-position)))
|
|
|
+ (planning-end (if subtree end (line-end-position 2)))
|
|
|
+ m)
|
|
|
(and
|
|
|
- (or
|
|
|
- (and (memq 'scheduled conditions)
|
|
|
- (re-search-forward org-scheduled-time-regexp end t))
|
|
|
- (and (memq 'notscheduled conditions)
|
|
|
- (not (re-search-forward org-scheduled-time-regexp end t)))
|
|
|
- (and (memq 'deadline conditions)
|
|
|
- (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))
|
|
|
- (and (setq m (memq 'notregexp conditions))
|
|
|
- (stringp (nth 1 m))
|
|
|
- (not (re-search-forward (nth 1 m) end t)))
|
|
|
- (and (or
|
|
|
- (setq m (memq 'nottodo conditions))
|
|
|
- (setq m (memq 'todo-unblocked conditions))
|
|
|
- (setq m (memq 'nottodo-unblocked conditions))
|
|
|
- (setq m (memq 'todo conditions)))
|
|
|
- (org-agenda-skip-if-todo m end)))
|
|
|
+ (or (and (memq 'scheduled conditions)
|
|
|
+ (re-search-forward org-scheduled-time-regexp planning-end t))
|
|
|
+ (and (memq 'notscheduled conditions)
|
|
|
+ (not
|
|
|
+ (save-excursion
|
|
|
+ (re-search-forward org-scheduled-time-regexp planning-end t))))
|
|
|
+ (and (memq 'deadline conditions)
|
|
|
+ (re-search-forward org-deadline-time-regexp planning-end t))
|
|
|
+ (and (memq 'notdeadline conditions)
|
|
|
+ (not
|
|
|
+ (save-excursion
|
|
|
+ (re-search-forward org-deadline-time-regexp planning-end t))))
|
|
|
+ (and (memq 'timestamp conditions)
|
|
|
+ (re-search-forward org-ts-regexp end t))
|
|
|
+ (and (memq 'nottimestamp conditions)
|
|
|
+ (not (save-excursion (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))
|
|
|
+ (and (setq m (memq 'notregexp conditions))
|
|
|
+ (stringp (nth 1 m))
|
|
|
+ (not (save-excursion (re-search-forward (nth 1 m) end t))))
|
|
|
+ (and (or
|
|
|
+ (setq m (memq 'nottodo conditions))
|
|
|
+ (setq m (memq 'todo-unblocked conditions))
|
|
|
+ (setq m (memq 'nottodo-unblocked conditions))
|
|
|
+ (setq m (memq 'todo conditions)))
|
|
|
+ (org-agenda-skip-if-todo m end)))
|
|
|
end)))
|
|
|
|
|
|
(defun org-agenda-skip-if-todo (args end)
|