Function: org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item

org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item is an autoloaded and byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item &optional END)

Documentation

Do we have a reason to ignore this TODO entry because it has a time stamp?

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
;;;###autoload
(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
    (&optional end)
  "Do we have a reason to ignore this TODO entry because it has a time stamp?"
  (when (or org-agenda-todo-ignore-with-date
	    org-agenda-todo-ignore-scheduled
	    org-agenda-todo-ignore-deadlines
	    org-agenda-todo-ignore-timestamp)
    (setq end (or end (save-excursion (outline-next-heading) (point))))
    (save-excursion
      (or (and org-agenda-todo-ignore-with-date
	       (re-search-forward org-ts-regexp end t))
	  (and org-agenda-todo-ignore-scheduled
	       (re-search-forward org-scheduled-time-regexp end t)
	       (cond
		((eq org-agenda-todo-ignore-scheduled 'future)
		 (> (org-time-stamp-to-now
		     (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
		    0))
		((eq org-agenda-todo-ignore-scheduled 'past)
		 (<= (org-time-stamp-to-now
		      (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
		     0))
		((numberp org-agenda-todo-ignore-scheduled)
		 (org-agenda-todo-custom-ignore-p
		  (match-string 1) org-agenda-todo-ignore-scheduled))
		(t)))
	  (and org-agenda-todo-ignore-deadlines
	       (re-search-forward org-deadline-time-regexp end t)
	       (cond
		((eq org-agenda-todo-ignore-deadlines 'all) t)
		((eq org-agenda-todo-ignore-deadlines 'far)
		 (not (org-deadline-close-p (match-string 1))))
		((eq org-agenda-todo-ignore-deadlines 'future)
		 (> (org-time-stamp-to-now
		     (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
		    0))
		((eq org-agenda-todo-ignore-deadlines 'past)
		 (<= (org-time-stamp-to-now
		      (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
		     0))
		((numberp org-agenda-todo-ignore-deadlines)
		 (org-agenda-todo-custom-ignore-p
		  (match-string 1) org-agenda-todo-ignore-deadlines))
		(t (org-deadline-close-p (match-string 1)))))
	  (and org-agenda-todo-ignore-timestamp
	       (let ((buffer (current-buffer))
		     (regexp
		      (concat
		       org-scheduled-time-regexp "\\|" org-deadline-time-regexp))
		     (start (point)))
		 ;; Copy current buffer into a temporary one
		 (with-temp-buffer
		   (insert-buffer-substring buffer start end)
		   (goto-char (point-min))
		   ;; Delete SCHEDULED and DEADLINE items
		   (while (re-search-forward regexp end t)
		     (delete-region (match-beginning 0) (match-end 0)))
		   (goto-char (point-min))
		   ;; No search for timestamp left
		   (when (re-search-forward org-ts-regexp nil t)
		     (cond
		      ((eq org-agenda-todo-ignore-timestamp 'future)
		       (> (org-time-stamp-to-now
			   (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
			  0))
		      ((eq org-agenda-todo-ignore-timestamp 'past)
		       (<= (org-time-stamp-to-now
			    (match-string 1) org-agenda-todo-ignore-time-comparison-use-seconds)
			   0))
		      ((numberp org-agenda-todo-ignore-timestamp)
		       (org-agenda-todo-custom-ignore-p
			(match-string 1) org-agenda-todo-ignore-timestamp))
		      (t))))))))))