From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [PATCH 5/9] rename `org-duration-string-to-minutes' to `org-clocksum-string-to-minutes' everywhere Date: Wed, 04 Nov 2015 11:21:29 +0000 Message-ID: <87lhaevwli.fsf@gmail.com> References: <1446581747-1960-1-git-send-email-oxij@oxij.org> <1446581747-1960-6-git-send-email-oxij@oxij.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztw8I-0000xn-DB for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 06:21:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ztw8C-00023R-0h for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 06:21:38 -0500 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:38449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztw8B-00023I-O7 for emacs-orgmode@gnu.org; Wed, 04 Nov 2015 06:21:31 -0500 Received: by wicll6 with SMTP id ll6so29827728wic.1 for ; Wed, 04 Nov 2015 03:21:31 -0800 (PST) In-Reply-To: <1446581747-1960-6-git-send-email-oxij@oxij.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Jan Malakhovski Hi Jan, 2015ko azaroak 3an, Jan Malakhovski-ek idatzi zuen: >=20 > * 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 | 14 +++++++------- > lisp/org-colview.el | 2 +- > lisp/org.el | 14 +++++++++----- > 6 files changed, 20 insertions(+), 16 deletions(-) >=20 > 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 6313f52..ab4595b 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -7665,7 +7665,7 @@ E looks like \"+<2:25\"." > ((equal op ??) op) > (t '=3D))) > (list 'org-agenda-compare-effort (list 'quote op) > - (org-duration-string-to-minutes e)))) > + (org-clocksum-string-to-minutes e)))) >=20=20 > (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 4563a8a..ab65d3b 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -668,7 +668,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) > @@ -749,10 +749,10 @@ clocked item, and the value displayed in the mode l= ine." > ;; 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))))) > @@ -770,7 +770,7 @@ clocked item, and the value displayed in the mode lin= e." > "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-e= ffort)) > + (let ((effort-in-minutes (org-clocksum-string-to-minutes org-clock-e= ffort)) > (clocked-time (org-clock-get-clocked-time))) > (if (setq org-clock-task-overrun > (if (or (null effort-in-minutes) (zerop effort-in-minutes)) > @@ -1193,7 +1193,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-idle= ness) > (org-clocking-p))) > @@ -2869,13 +2869,13 @@ TIME: The sum of all time spend in this tree= , in minutes. This time > "Compute a time fraction in percent. > TOTAL s a total time string. > STRINGS is a list of strings that should be checked for a time. > -Strings are parsed using `org-duration-string-to-minutes`. > +Strings are parsed using `org-clocksum-string-to-minutes`. > The first string that does have a time will be used. This > function is made for clock tables." > (save-match-data > (let (tot s cur) > (catch 'exit > - (setq tot (org-duration-string-to-minutes total)) > + (setq tot (org-clocksum-string-to-minutes total)) > (if (=3D tot 0.) (throw 'exit 0.)) > (while (setq s (pop strings)) > (setq cur (org-clocksum-string-to-minutes s)) > diff --git a/lisp/org-colview.el b/lisp/org-colview.el > index d27abc3..bbbeea9 100644 > --- a/lisp/org-colview.el > +++ b/lisp/org-colview.el > @@ -1119,7 +1119,7 @@ display, or in the #+COLUMNS line of the current bu= ffer." > ((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 a0fe644..c466870 100755 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -3699,7 +3699,7 @@ and the clock summary: >=20=20 > ((\"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 > @@ -9612,7 +9612,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)))) >=20=20 > ;;;; Link Stuff >=20=20 > @@ -15673,7 +15673,7 @@ When INCREMENT is non-nil, set the property to th= e 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=3D heading org-clock-current-task) > (setq org-clock-effort (get-text-property (point-at-bol) 'effort)) > @@ -16534,7 +16534,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=3D org-clock-current-task heading) > (setq org-clock-effort nval) > @@ -18328,7 +18328,7 @@ If no number is found, the return value is 0." > (string-to-number (match-string 1 s))) > (t 0))) >=20=20 > -(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. >=20=20 > A bare number is interpreted as minutes, modifiers can be set by > @@ -18348,6 +18348,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))) >=20=20 > +(defalias 'org-duration-string-to-minutes 'org-clocksum-string-to-minute= s) > +(make-obsolete 'org-duration-string-to-minutes 'org-clocksum-string-to-m= inutes > + "Org mode version 8.3") > + You can use =E2=80=98define-obsolete-function-alias=E2=80=99. --=20 Aaron Ecay