From: Jan Malakhovski <oxij@oxij.org>
To: emacs-orgmode@gnu.org
Cc: Jan Malakhovski <oxij@oxij.org>
Subject: [PATCH 2/4] rename `org-duration-string-to-minutes' to `org-clocksum-string-to-minutes' everywhere
Date: Sun, 27 Dec 2015 15:13:47 +0000 [thread overview]
Message-ID: <1451229229-18973-3-git-send-email-oxij@oxij.org> (raw)
In-Reply-To: <1451229229-18973-1-git-send-email-oxij@oxij.org>
* lisp/org-agenda.el:
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org.el:
* contrib/lisp/org-depend.el:
* contrib/lisp/ox-taskjuggler.el: Rename (org-duration-string-to-minutes)
to (org-clocksum-string-to-minutes).
---
contrib/lisp/org-depend.el | 2 +-
contrib/lisp/ox-taskjuggler.el | 2 +-
lisp/org-agenda.el | 2 +-
lisp/org-clock.el | 10 +++++-----
lisp/org-colview.el | 2 +-
lisp/org.el | 14 +++++++++-----
6 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/contrib/lisp/org-depend.el b/contrib/lisp/org-depend.el
index 1cd4130..7b263bc 100644
--- a/contrib/lisp/org-depend.el
+++ b/contrib/lisp/org-depend.el
@@ -270,7 +270,7 @@ This does two different kinds of triggers:
(effort (when (or effort-up effort-down)
(let ((effort (get-text-property (point) 'org-effort)))
(when effort
- (org-duration-string-to-minutes effort))))))
+ (org-clocksum-string-to-minutes effort))))))
(push (list (point) todo-kwd priority tags effort)
items))
(unless (org-goto-sibling)
diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el
index 2bd47e6..b425b1b 100644
--- a/contrib/lisp/ox-taskjuggler.el
+++ b/contrib/lisp/ox-taskjuggler.el
@@ -861,7 +861,7 @@ a unique id will be associated to it."
(and complete (format " complete %s\n" complete))
(and effort
(format " effort %s\n"
- (let* ((minutes (org-duration-string-to-minutes effort))
+ (let* ((minutes (org-clocksum-string-to-minutes effort))
(hours (/ minutes 60.0)))
(format "%.1fh" hours))))
(and priority (format " priority %s\n" priority))
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index d91b64d..99ccedd 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7661,7 +7661,7 @@ E looks like \"+<2:25\"."
((equal op ??) op)
(t '=)))
(list 'org-agenda-compare-effort (list 'quote op)
- (org-duration-string-to-minutes e))))
+ (org-clocksum-string-to-minutes e))))
(defun org-agenda-compare-effort (op value)
"Compare the effort of the current line with VALUE, using OP.
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 823a386..b7a70dc 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -663,7 +663,7 @@ If not, show simply the clocked time like 01:50."
(let ((clocked-time (org-clock-get-clocked-time)))
(if org-clock-effort
(let* ((effort-in-minutes
- (org-duration-string-to-minutes org-clock-effort))
+ (org-clocksum-string-to-minutes org-clock-effort))
(work-done-str
(org-propertize
(org-minutes-to-clocksum-string clocked-time)
@@ -744,10 +744,10 @@ clocked item, and the value displayed in the mode line."
;; A string. See if it is a delta
(setq sign (string-to-char value))
(if (member sign '(?- ?+))
- (setq current (org-duration-string-to-minutes current)
+ (setq current (org-clocksum-string-to-minutes current)
value (substring value 1))
(setq current 0))
- (setq value (org-duration-string-to-minutes value))
+ (setq value (org-clocksum-string-to-minutes value))
(if (equal ?- sign)
(setq value (- current value))
(if (equal ?+ sign) (setq value (+ current value)))))
@@ -765,7 +765,7 @@ clocked item, and the value displayed in the mode line."
"Show notification if we spent more time than we estimated before.
Notification is shown only once."
(when (org-clocking-p)
- (let ((effort-in-minutes (org-duration-string-to-minutes org-clock-effort))
+ (let ((effort-in-minutes (org-clocksum-string-to-minutes org-clock-effort))
(clocked-time (org-clock-get-clocked-time)))
(if (setq org-clock-task-overrun
(if (or (null effort-in-minutes) (zerop effort-in-minutes))
@@ -1187,7 +1187,7 @@ make this the default behavior.)"
(setq org-clock-notification-was-shown nil)
(org-refresh-properties
org-effort-property '((effort . identity)
- (effort-minutes . org-duration-string-to-minutes)))
+ (effort-minutes . org-clocksum-string-to-minutes)))
(catch 'abort
(let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness)
(org-clocking-p)))
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index e157031..a3ce406 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1110,7 +1110,7 @@ display, or in the #+COLUMNS line of the current buffer."
((string-match (concat "\\([0-9.]+\\) *\\("
(regexp-opt (mapcar 'car org-effort-durations))
"\\)") s)
- (setq s (concat "0:" (org-duration-string-to-minutes s t)))
+ (setq s (concat "0:" (org-clocksum-string-to-minutes s t)))
(let ((l (nreverse (org-split-string s ":"))) (sum 0.0))
(while l
(setq sum (+ (string-to-number (pop l)) (/ sum 60))))
diff --git a/lisp/org.el b/lisp/org.el
index f6c513e..24f81e4 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3677,7 +3677,7 @@ and the clock summary:
((\"Remaining\" (lambda(value)
(let ((clocksum (org-clock-sum-current-item))
- (effort (org-duration-string-to-minutes
+ (effort (org-clocksum-string-to-minutes
(org-entry-get (point) \"Effort\"))))
(org-minutes-to-clocksum-string (- effort clocksum))))))"
:group 'org-properties
@@ -9574,7 +9574,7 @@ The refresh happens only for the current tree (not subtree)."
(org-refresh-properties
org-effort-property
'((effort . identity)
- (effort-minutes . org-duration-string-to-minutes))))
+ (effort-minutes . org-clocksum-string-to-minutes))))
;;;; Link Stuff
@@ -15645,7 +15645,7 @@ When INCREMENT is non-nil, set the property to the next allowed value."
(org-entry-put nil prop val))
(org-refresh-property
'((effort . identity)
- (effort-minutes . org-duration-string-to-minutes))
+ (effort-minutes . org-clocksum-string-to-minutes))
val)
(when (string= heading org-clock-current-task)
(setq org-clock-effort (get-text-property (point-at-bol) 'effort))
@@ -16506,7 +16506,7 @@ completion."
(when (equal prop org-effort-property)
(org-refresh-property
'((effort . identity)
- (effort-minutes . org-duration-string-to-minutes))
+ (effort-minutes . org-clocksum-string-to-minutes))
nval)
(when (string= org-clock-current-task heading)
(setq org-clock-effort nval)
@@ -18303,7 +18303,7 @@ If no number is found, the return value is 0."
(string-to-number (match-string 1 s)))
(t 0)))
-(defun org-duration-string-to-minutes (s &optional output-to-string)
+(defun org-clocksum-string-to-minutes (s &optional output-to-string)
"Convert a duration string S to minutes.
A bare number is interpreted as minutes, modifiers can be set by
@@ -18323,6 +18323,10 @@ Entries containing a colon are interpreted as H:MM by
(incf result (org-hh:mm-string-to-minutes s))
(if output-to-string (number-to-string result) result)))
+(define-obsolete-function-alias
+ 'org-duration-string-to-minutes
+ 'org-clocksum-string-to-minutes "Org mode version 8.3")
+
(defcustom org-image-actual-width t
"Should we use the actual width of images when inlining them?
--
2.6.4
next prev parent reply other threads:[~2015-12-27 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-27 15:13 [PATCH v3 part3 0/4] fixing org-clock-time% Jan Malakhovski
2015-12-27 15:13 ` [PATCH 1/4] org: move `org-duration-string-to-minutes' to a better place Jan Malakhovski
2015-12-27 15:13 ` Jan Malakhovski [this message]
2015-12-27 15:13 ` [PATCH 3/4] simplify and document `org-effort-durations'-related code Jan Malakhovski
2015-12-27 15:13 ` [PATCH 4/4] org-clock: make clock table respect `org-effort-durations' Jan Malakhovski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1451229229-18973-3-git-send-email-oxij@oxij.org \
--to=oxij@oxij.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.