diff options
author | Don March <don@ohspite.net> | 2016-06-03 02:49:55 -0400 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2016-06-04 20:39:15 +0200 |
commit | 42620c1efa34e4d1a4bc1688f21de19c8c48e5f6 (patch) | |
tree | ac6c37a1902a83584d146f04aecca9424cd54b54 | |
parent | 43b5ca1626ead092e3262442c90bfb419f0f5d5d (diff) | |
download | org-mode-42620c1efa34e4d1a4bc1688f21de19c8c48e5f6.tar.gz |
Rename org-deadline-is-close to have -p suffix
* lisp/org-agenda.el
(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
* lisp/org.el (org-deadline-close): Rename to...
(org-deadline-close-p): ...this.
* testing/lisp/test-org.el (test-org/deadline-close): Rename to...
(test-org/deadline-close-p): ...this.
-rw-r--r-- | lisp/org-agenda.el | 4 | ||||
-rw-r--r-- | lisp/org.el | 4 | ||||
-rw-r--r-- | testing/lisp/test-org.el | 30 |
3 files changed, 19 insertions, 19 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 50f520c..7994187 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -5550,7 +5550,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', (cond ((memq org-agenda-todo-ignore-deadlines '(t all)) t) ((eq org-agenda-todo-ignore-deadlines 'far) - (not (org-deadline-close (match-string 1)))) + (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)) @@ -5560,7 +5560,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', ((numberp org-agenda-todo-ignore-deadlines) (org-agenda-todo-custom-ignore-p (match-string 1) org-agenda-todo-ignore-deadlines)) - (t (org-deadline-close (match-string 1))))) + (t (org-deadline-close-p (match-string 1))))) (and org-agenda-todo-ignore-timestamp (let ((buffer (current-buffer)) (regexp diff --git a/lisp/org.el b/lisp/org.el index 13883c5..fc3e0c0 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17477,7 +17477,7 @@ If SECONDS is non-nil, return the difference in seconds." (- (funcall fdiff (org-time-string-to-time timestamp-string)) (funcall fdiff (current-time))))) -(defun org-deadline-close (timestamp-string &optional ndays) +(defun org-deadline-close-p (timestamp-string &optional ndays) "Is the time in TIMESTAMP-STRING close to the current date?" (setq ndays (or ndays (org-get-wdays timestamp-string))) (and (<= (org-time-stamp-to-now timestamp-string) ndays) @@ -17533,7 +17533,7 @@ days. If the prefix is a raw \\[universal-argument] prefix, all deadlines are s (case-fold-search nil) (regexp (concat "\\<" org-deadline-string " *<\\([^>]+\\)>")) (callback - (lambda () (org-deadline-close (match-string 1) org-warn-days)))) + (lambda () (org-deadline-close-p (match-string 1) org-warn-days)))) (message "%d deadlines past-due or due within %d days" (org-occur regexp nil callback) org-warn-days))) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index eb634db..928f2e3 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -364,33 +364,33 @@ (calendar-gregorian-from-absolute (org-closest-date "<2012-03-29 +2y>" "<2014-03-04>" 'future))))) -(ert-deftest test-org/deadline-close () - "Test `org-deadline-close' specifications." +(ert-deftest test-org/deadline-close-p () + "Test `org-deadline-close-p' specifications." ;; Pretend that the current time is 2016-06-03 Fri 01:43 (flet ((current-time () '(22353 6425 905205 644000))) ;; Timestamps are close if they are within `ndays' of lead time. (org-test-with-temp-text "* Heading" - (should (org-deadline-close "2016-06-03 Fri" 0)) - (should (org-deadline-close "2016-06-02 Thu" 0)) - (should-not (org-deadline-close "2016-06-04 Sat" 0)) - (should (org-deadline-close "2016-06-04 Sat" 1)) - (should (org-deadline-close "2016-06-03 Fri 12:00" 0))) + (should (org-deadline-close-p "2016-06-03 Fri" 0)) + (should (org-deadline-close-p "2016-06-02 Thu" 0)) + (should-not (org-deadline-close-p "2016-06-04 Sat" 0)) + (should (org-deadline-close-p "2016-06-04 Sat" 1)) + (should (org-deadline-close-p "2016-06-03 Fri 12:00" 0))) ;; Read `ndays' from timestamp if argument not given. (org-test-with-temp-text "* H" - (should (org-deadline-close "2016-06-04 Sat -1d")) - (should-not (org-deadline-close "2016-06-04 Sat -0d")) - (should (org-deadline-close "2016-06-10 Fri -1w")) - (should-not (org-deadline-close "2016-06-11 Sat -1w"))) + (should (org-deadline-close-p "2016-06-04 Sat -1d")) + (should-not (org-deadline-close-p "2016-06-04 Sat -0d")) + (should (org-deadline-close-p "2016-06-10 Fri -1w")) + (should-not (org-deadline-close-p "2016-06-11 Sat -1w"))) ;; Prefer `ndays' argument over lead time in timestamp. (org-test-with-temp-text "* H" - (should (org-deadline-close "2016-06-04 Sat -0d" 1)) - (should-not (org-deadline-close "2016-06-04 Sat -0d" 0))) + (should (org-deadline-close-p "2016-06-04 Sat -0d" 1)) + (should-not (org-deadline-close-p "2016-06-04 Sat -0d" 0))) ;; Completed tasks are never close. (let ((org-todo-keywords '(("TODO" "|" "DONE")))) (org-test-with-temp-text "* TODO Heading" - (should (org-deadline-close "2016-06-03"))) + (should (org-deadline-close-p "2016-06-03"))) (org-test-with-temp-text "* DONE Heading" - (should-not (org-deadline-close "2016-06-03")))))) + (should-not (org-deadline-close-p "2016-06-03")))))) ;;; Drawers |