Revert "Move three functions and add appropriate require/declarations."
This reverts commit 8c3ecbe39a
.
This commit is contained in:
parent
ec18abdddd
commit
cdbf7ed876
|
@ -78,9 +78,6 @@
|
||||||
(declare-function org-habit-get-priority "org-habit" (habit &optional moment))
|
(declare-function org-habit-get-priority "org-habit" (habit &optional moment))
|
||||||
(declare-function org-pop-to-buffer-same-window "org-compat"
|
(declare-function org-pop-to-buffer-same-window "org-compat"
|
||||||
(&optional buffer-or-name norecord label))
|
(&optional buffer-or-name norecord label))
|
||||||
(declare-function org-duration-string-to-minutes "org-clock" (s))
|
|
||||||
(declare-function org-hh:mm-string-to-minutes "org-clock" (s))
|
|
||||||
(declare-function org-minutes-to-hh:mm-string "org-clock" (m))
|
|
||||||
|
|
||||||
(defvar calendar-mode-map)
|
(defvar calendar-mode-map)
|
||||||
(defvar org-clock-current-task) ; defined in org-clock.el
|
(defvar org-clock-current-task) ; defined in org-clock.el
|
||||||
|
|
|
@ -494,46 +494,6 @@ pointing to it."
|
||||||
(defvar org-clock-update-period 60
|
(defvar org-clock-update-period 60
|
||||||
"Number of seconds between mode line clock string updates.")
|
"Number of seconds between mode line clock string updates.")
|
||||||
|
|
||||||
(defun org-duration-string-to-minutes (s)
|
|
||||||
"Convert a duration string S to minutes.
|
|
||||||
|
|
||||||
A bare number is interpreted as minutes, modifiers can be set by
|
|
||||||
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)
|
|
||||||
(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)))
|
|
||||||
(incf result (org-hh:mm-string-to-minutes s))
|
|
||||||
result))
|
|
||||||
|
|
||||||
(defun org-minutes-to-hh:mm-string (m)
|
|
||||||
"Compute H:MM from a number of minutes."
|
|
||||||
(let ((h (/ m 60)))
|
|
||||||
(setq m (- m (* 60 h)))
|
|
||||||
(format org-time-clocksum-format h m)))
|
|
||||||
|
|
||||||
(defun org-hh:mm-string-to-minutes (s)
|
|
||||||
"Convert a string H:MM to a number of minutes.
|
|
||||||
If the string is just a number, interpret it as minutes.
|
|
||||||
In fact, the first hh:mm or number in the string will be taken,
|
|
||||||
there can be extra stuff in the string.
|
|
||||||
If no number is found, the return value is 0."
|
|
||||||
(cond
|
|
||||||
((integerp s) s)
|
|
||||||
((string-match "\\([0-9]+\\):\\([0-9]+\\)" s)
|
|
||||||
(+ (* (string-to-number (match-string 1 s)) 60)
|
|
||||||
(string-to-number (match-string 2 s))))
|
|
||||||
((string-match "\\([0-9]+\\)" s)
|
|
||||||
(string-to-number (match-string 1 s)))
|
|
||||||
(t 0)))
|
|
||||||
|
|
||||||
(defun org-clock-get-clock-string ()
|
(defun org-clock-get-clock-string ()
|
||||||
"Form a clock-string, that will be shown in the mode line.
|
"Form a clock-string, that will be shown in the mode line.
|
||||||
If an effort estimate was defined for the current item, use
|
If an effort estimate was defined for the current item, use
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
|
|
||||||
(eval-when-compile (require 'cl))
|
(eval-when-compile (require 'cl))
|
||||||
(require 'org)
|
(require 'org)
|
||||||
(require 'org-clock)
|
|
||||||
|
|
||||||
(declare-function org-agenda-redo "org-agenda" ())
|
(declare-function org-agenda-redo "org-agenda" ())
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
(eval-when-compile (require 'cl))
|
(eval-when-compile (require 'cl))
|
||||||
(require 'org)
|
(require 'org)
|
||||||
(require 'org-clock)
|
|
||||||
|
|
||||||
(declare-function org-agenda-redo "org-agenda" ())
|
(declare-function org-agenda-redo "org-agenda" ())
|
||||||
(declare-function org-agenda-do-context-action "org-agenda" ())
|
(declare-function org-agenda-do-context-action "org-agenda" ())
|
||||||
|
|
|
@ -155,7 +155,6 @@
|
||||||
|
|
||||||
(require 'org)
|
(require 'org)
|
||||||
(require 'org-exp)
|
(require 'org-exp)
|
||||||
(require 'org-clock)
|
|
||||||
|
|
||||||
;;; User variables:
|
;;; User variables:
|
||||||
|
|
||||||
|
|
40
lisp/org.el
40
lisp/org.el
|
@ -15880,6 +15880,27 @@ If there is already a time stamp at the cursor position, update it."
|
||||||
(org-insert-time-stamp
|
(org-insert-time-stamp
|
||||||
(encode-time 0 0 0 (nth 1 cal-date) (car cal-date) (nth 2 cal-date))))))
|
(encode-time 0 0 0 (nth 1 cal-date) (car cal-date) (nth 2 cal-date))))))
|
||||||
|
|
||||||
|
(defun org-minutes-to-hh:mm-string (m)
|
||||||
|
"Compute H:MM from a number of minutes."
|
||||||
|
(let ((h (/ m 60)))
|
||||||
|
(setq m (- m (* 60 h)))
|
||||||
|
(format org-time-clocksum-format h m)))
|
||||||
|
|
||||||
|
(defun org-hh:mm-string-to-minutes (s)
|
||||||
|
"Convert a string H:MM to a number of minutes.
|
||||||
|
If the string is just a number, interpret it as minutes.
|
||||||
|
In fact, the first hh:mm or number in the string will be taken,
|
||||||
|
there can be extra stuff in the string.
|
||||||
|
If no number is found, the return value is 0."
|
||||||
|
(cond
|
||||||
|
((integerp s) s)
|
||||||
|
((string-match "\\([0-9]+\\):\\([0-9]+\\)" s)
|
||||||
|
(+ (* (string-to-number (match-string 1 s)) 60)
|
||||||
|
(string-to-number (match-string 2 s))))
|
||||||
|
((string-match "\\([0-9]+\\)" s)
|
||||||
|
(string-to-number (match-string 1 s)))
|
||||||
|
(t 0)))
|
||||||
|
|
||||||
(defcustom org-effort-durations
|
(defcustom org-effort-durations
|
||||||
`(("h" . 60)
|
`(("h" . 60)
|
||||||
("d" . ,(* 60 8))
|
("d" . ,(* 60 8))
|
||||||
|
@ -15900,6 +15921,25 @@ effort string \"2hours\" is equivalent to 120 minutes."
|
||||||
:type '(alist :key-type (string :tag "Modifier")
|
:type '(alist :key-type (string :tag "Modifier")
|
||||||
:value-type (number :tag "Minutes")))
|
:value-type (number :tag "Minutes")))
|
||||||
|
|
||||||
|
(defun org-duration-string-to-minutes (s)
|
||||||
|
"Convert a duration string S to minutes.
|
||||||
|
|
||||||
|
A bare number is interpreted as minutes, modifiers can be set by
|
||||||
|
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)
|
||||||
|
(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)))
|
||||||
|
(incf result (org-hh:mm-string-to-minutes s))
|
||||||
|
result))
|
||||||
|
|
||||||
;;;; Files
|
;;;; Files
|
||||||
|
|
||||||
(defun org-save-all-org-buffers ()
|
(defun org-save-all-org-buffers ()
|
||||||
|
|
Loading…
Reference in New Issue