diff options
author | Bastien <bzg@gnu.org> | 2018-11-18 09:32:41 +0100 |
---|---|---|
committer | Bastien <bzg@gnu.org> | 2018-11-18 09:32:41 +0100 |
commit | 9a4a3293763e0b3e76cb34a2968839ffe6a9eb46 (patch) | |
tree | f4f5ed7b34920570a43b89d82de904585adcd9da | |
parent | 7be6760599e6df0798c95fa81f5889a54cd17e26 (diff) | |
parent | fc9cf62bf3932ef9d8b6e8cb5371dafaffd7ec24 (diff) | |
download | org-mode-9a4a3293763e0b3e76cb34a2968839ffe6a9eb46.tar.gz |
Merge branch 'master' of code.orgmode.org:bzg/org-mode
-rw-r--r-- | lisp/org-clock.el | 6 | ||||
-rw-r--r-- | lisp/org.el | 29 |
2 files changed, 16 insertions, 19 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 672523f..60dccc2 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2710,15 +2710,13 @@ The TS argument has the same type as the return values of ;; org-agenda. (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute ts))) (setq ts (float-time (encode-time 0 0 0 day month year))))) - (ts - (setq ts (float-time (apply #'encode-time (org-parse-time-string ts)))))) + (ts (setq ts (org-matcher-time ts)))) (cond ((numberp te) ;; Likewise for te. (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute te))) (setq te (float-time (encode-time 0 0 0 day month year))))) - (te - (setq te (float-time (apply #'encode-time (org-parse-time-string te)))))) + (te (setq te (org-matcher-time te)))) (setq tsb (if (eq step0 'week) (let ((dow (nth 6 (decode-time (seconds-to-time ts))))) diff --git a/lisp/org.el b/lisp/org.el index eb1affb..b78243c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12766,20 +12766,25 @@ This function is run automatically after each state change to a DONE state." (or done-word (car org-done-keywords)) org-last-state org-log-repeat))) + ;; Time-stamps without a repeater are usually skipped. However, + ;; a SCHEDULED time-stamp without one is removed, as they are no + ;; longer relevant. + (save-excursion + (let ((scheduled (org-entry-get (point) "SCHEDULED"))) + (when (and scheduled (not (string-match-p org-repeat-re scheduled))) + (org-remove-timestamp-with-keyword org-scheduled-string)))) + ;; Update every time-stamp with a repeater in the entry. (let ((planning-re (regexp-opt (list org-scheduled-string org-deadline-string)))) - (while (re-search-forward org-ts-regexp-both end t) + (while (re-search-forward org-repeat-re end t) (let* ((ts (match-string 0)) - (planning? (org-at-planning-p)) - (type (if (not planning?) "Plain:" + (type (if (not (org-at-planning-p)) "Plain:" (save-excursion (re-search-backward planning-re (line-beginning-position) t) (match-string 0))))) - (cond - ;; Ignore fake time-stamps (e.g., within comments). - ((not (org-at-timestamp-p 'agenda))) - ((string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" ts) + (when (and (org-at-timestamp-p 'agenda) + (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" ts)) (let ((n (string-to-number (match-string 2 ts))) (what (match-string 3 ts))) (when (equal what "w") (setq n (* n 7) what "d")) @@ -12826,15 +12831,9 @@ enough to shift date past today. Continue? " (save-excursion (org-timestamp-change n (cdr (assoc what whata)) nil t)) (setq msg - (concat msg type " " org-last-changed-timestamp " ")))) - (t - ;; Time-stamps without a repeater are usually skipped. - ;; However, a SCHEDULED time-stamp without one is - ;; removed, as they are no longer relevant. - (when (equal type org-scheduled-string) - (org-remove-timestamp-with-keyword type))))))) + (concat msg type " " org-last-changed-timestamp " "))))))) (setq org-log-post-message msg) - (message "%s" msg)))) + (message msg)))) (defun org-show-todo-tree (arg) "Make a compact tree which shows all headlines marked with TODO. |