[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org dcb6013 02/41: agenda: Fix org-duration-to-minutes
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org dcb6013 02/41: agenda: Fix org-duration-to-minutes error (take 2) |
Date: |
Sun, 16 May 2021 04:57:14 -0400 (EDT) |
branch: externals/org
commit dcb6013fb6a2c4eecdc8fb13cd7bae8a71ef25cd
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Bastien <bzg@gnu.org>
agenda: Fix org-duration-to-minutes error (take 2)
* lisp/org.el (org-stamp-time-of-day-regexp): Limit match group 2 to
first time.
* lisp/org-agenda.el (org-agenda-format-item): Compute duration before
formatting time with `org-get-time-of-day'.
---
lisp/org-agenda.el | 11 ++++-------
lisp/org.el | 2 +-
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 85e2010..cbae3c0 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6739,10 +6739,6 @@ Any match of REMOVE-RE will be removed from TXT."
(= (match-beginning 0) 0)
t))
(setq txt (replace-match "" nil nil txt))))
- ;; Normalize the time(s) to 24 hour
- (when s1 (setq s1 (org-get-time-of-day s1 'string t)))
- (when s2 (setq s2 (org-get-time-of-day s2 'string t)))
-
;; Try to set s2 if s1 and
;; `org-agenda-default-appointment-duration' are set
(when (and s1 (not s2) org-agenda-default-appointment-duration)
@@ -6751,12 +6747,13 @@ Any match of REMOVE-RE will be removed from TXT."
(+ (org-duration-to-minutes s1 t)
org-agenda-default-appointment-duration)
nil t)))
-
;; Compute the duration
(when s2
(setq duration (- (org-duration-to-minutes s2)
- (org-duration-to-minutes s1)))))
-
+ (org-duration-to-minutes s1))))
+ ;; Normalize the time(s) to 24 hour
+ (when s1 (setq s1 (org-get-time-of-day s1 'string t)))
+ (when s2 (setq s2 (org-get-time-of-day s2 'string t))))
(when (string-match org-tag-group-re txt)
;; Tags are in the string
(if (or (eq org-agenda-remove-tags t)
diff --git a/lisp/org.el b/lisp/org.el
index 8940106..b388bca 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4117,7 +4117,7 @@ groups carry important information:
(defconst org-stamp-time-of-day-regexp
(concat
"<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +\\sw+ +\\)"
- "\\([012][0-9]:[0-5][0-9]\\(-\\([012][0-9]:[0-5][0-9]\\)\\)?[^\n\r>]*?\\)>"
+ "\\([012][0-9]:[0-5][0-9]\\)\\(-\\([012][0-9]:[0-5][0-9]\\)\\)?[^\n\r>]*?>"
"\\(--?"
"<\\1\\([012][0-9]:[0-5][0-9]\\)>\\)?")
"Regular expression to match a timestamp time or time range.
- [elpa] externals/org updated (e444181 -> 70d98b5), ELPA Syncer, 2021/05/16
- [elpa] externals/org dcb6013 02/41: agenda: Fix org-duration-to-minutes error (take 2),
ELPA Syncer <=
- [elpa] externals/org 0e39bf8 03/41: Throw user errors when trying to drag inline tasks, ELPA Syncer, 2021/05/16
- [elpa] externals/org 3581f37 04/41: CONTRIBUTE: Small enhancements, ELPA Syncer, 2021/05/16
- [elpa] externals/org fa3c9c8 05/41: lisp/org-id.el: Small enhancements, ELPA Syncer, 2021/05/16
- [elpa] externals/org 90a9ee1 08/41: lisp/org-agenda.el: Fix bug in `org-agenda-highlight-todo', ELPA Syncer, 2021/05/16
- [elpa] externals/org f318cd6 14/41: Fix test-org-element/cache "Preserve local structures when re-parenting.", ELPA Syncer, 2021/05/16
- [elpa] externals/org f00ad09 10/41: org-refile.el: Fix the case of emtpy buffer name, ELPA Syncer, 2021/05/16
- [elpa] externals/org 7dcb1af 11/41: Improve org-link-plain-re, ELPA Syncer, 2021/05/16
- [elpa] externals/org bfda3cc 13/41: lisp/org.el: Don't let RET indent in source code blocks, ELPA Syncer, 2021/05/16
- [elpa] externals/org 24473b5 15/41: lisp/org.el: Use "[BUG]" instead of "Bug:" for bug reports, ELPA Syncer, 2021/05/16
- [elpa] externals/org 8531bb6 09/41: lisp/org.el: Minor aesthetic clean-up, ELPA Syncer, 2021/05/16