summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-03-06 18:45:03 +0100
committerBastien Guerry <bzg@altern.org>2011-03-06 18:45:03 +0100
commit6a0de0dc7befede91fa244ac4fba1fe73f8a4f2f (patch)
treed7ea6824ec9a8de64b47a208b9e81af50763f621
parent75a1b98cfb78eede65083b7f87921fd79e86ce69 (diff)
downloadorg-mode-6a0de0dc7befede91fa244ac4fba1fe73f8a4f2f.tar.gz
* org.el (org-duration-string-to-minutes): Don't use `rx-to-string'.
-rw-r--r--lisp/org.el10
1 files changed, 4 insertions, 6 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 270a36e..dbc2945 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15553,12 +15553,10 @@ customizing `org-effort-durations' (which see).
Entries containing a colon are interpreted as H:MM by
`org-hh:mm-string-to-minutes'."
(let ((result 0)
- (regex (rx-to-string (group (1+ (any "0-9")))
- (0+ (syntax whitespace))
- (group
- (eval (cons 'or
- (mapcar 'car org-effort-durations)))))))
- (while (string-match regex s)
+ (re (concat "\\([0-9]+\\) *\\("
+ (regexp-opt (mapcar 'car org-effort-durations))
+ "\\)")))
+ (while (string-match re s)
(incf result (* (cdr (assoc (match-string 2 s) org-effort-durations))
(string-to-number (match-string 1 s))))
(setq s (replace-match "" nil t s)))