Fix compiler issues related to the timer.

Also, one function had a wrong name, my-hms-to-secs....
This commit is contained in:
Carsten Dominik 2008-11-25 20:42:06 +01:00
parent 7e3aa26628
commit fee7fdaa80
4 changed files with 14 additions and 11 deletions

View File

@ -89,6 +89,7 @@ LISPF = org.el \
org-remember.el \
org-rmail.el \
org-table.el \
org-timer.el \
org-vm.el \
org-wl.el
@ -326,5 +327,6 @@ lisp/org-publish.elc:
lisp/org-remember.elc: lisp/org.elc
lisp/org-rmail.elc: lisp/org.elc
lisp/org-table.elc: lisp/org.elc
lisp/org-timer.el: lisp/org.elc
lisp/org-vm.elc: lisp/org.elc
lisp/org-wl.elc: lisp/org.elc

View File

@ -45,6 +45,7 @@
(declare-function org-skip-whitespace "org" ())
(declare-function org-trim "org" (s))
(declare-function org-get-indentation "org" (&optional line))
(declare-function org-timer-item "org-timer" (&optional arg))
(defgroup org-plain-lists nil
"Options concerning plain lists in Org-mode."

View File

@ -27,6 +27,8 @@
;; This file contains the relative timer code for Org-mode
(require 'org)
(defvar org-timer-start-time nil
"t=0 for the running timer.")
@ -54,7 +56,7 @@ the region 0:00:00."
(interactive "P")
(if (equal offset '(16))
(call-interactively 'org-timer-change-times-in-region)
(let (delta des s)
(let (delta def s)
(if (not offset)
(setq org-timer-start-time (current-time))
(cond
@ -109,7 +111,7 @@ that was not started at the correct moment."
(if (equal (string-to-char delta) ?-)
(setq delta (substring delta 1))
(setq delta (concat "-" delta))))))
(setq delta (my-hms-to-secs (org-timer-fix-incomplete delta)))
(setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete delta)))
(when (= delta 0) (error "No change"))
(save-excursion
(goto-char end)
@ -144,9 +146,9 @@ that was not started at the correct moment."
(if (string-match "\\(?:\\([0-9]+:\\)?\\([0-9]+:\\)\\)?\\([0-9]+\\)" hms)
(replace-match
(format "%d:%02d:%02d"
(if (match-end 1) (string-to-int (match-string 1 hms)) 0)
(if (match-end 2) (string-to-int (match-string 2 hms)) 0)
(string-to-int (match-string 3 hms)))
(if (match-end 1) (string-to-number (match-string 1 hms)) 0)
(if (match-end 2) (string-to-number (match-string 2 hms)) 0)
(string-to-number (match-string 3 hms)))
t t hms)
(error "Canot parse HMS string \"%s\"" hms)))
@ -157,9 +159,9 @@ If the string starts with a minus sign, the integer will be negative."
"\\([-+]?[0-9]+\\):\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
hms))
0
(let* ((h (string-to-int (match-string 1 hms)))
(m (string-to-int (match-string 2 hms)))
(s (string-to-int (match-string 3 hms)))
(let* ((h (string-to-number (match-string 1 hms)))
(m (string-to-number (match-string 2 hms)))
(s (string-to-number (match-string 3 hms)))
(sign (equal (substring (match-string 1 hms) 0 1) "-")))
(setq h (abs h))
(* (if sign -1 1) (+ s (* 60 (+ m (* 60 h))))))))

View File

@ -2642,9 +2642,7 @@ If yes, offer to stop it and to save the buffer with the changes."
;; Autoload org-timer.el
(declare-function org-clock-save-markers-for-cut-and-paste "org-clock"
(beg end))
(declare-function org-update-mode-line "org-clock" ())
;(declare-function org-timer "org-timer")
(eval-and-compile
(org-autoload