summaryrefslogtreecommitdiff
path: root/lisp/org/org-clock.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/org-clock.el')
-rw-r--r--lisp/org/org-clock.el40
1 files changed, 19 insertions, 21 deletions
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 2073b33380b..1283970bc2b 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -539,8 +539,8 @@ of a different task.")
"Marker pointing to the task that has been interrupted by the current clock.")
(defvar org-clock-mode-line-map (make-sparse-keymap))
-(define-key org-clock-mode-line-map [mode-line mouse-2] 'org-clock-goto)
-(define-key org-clock-mode-line-map [mode-line mouse-1] 'org-clock-menu)
+(define-key org-clock-mode-line-map [mode-line mouse-2] #'org-clock-goto)
+(define-key org-clock-mode-line-map [mode-line mouse-1] #'org-clock-menu)
(defun org-clock--translate (s language)
"Translate string S into using string LANGUAGE.
@@ -911,17 +911,17 @@ If CLOCK-SOUND is non-nil, it overrides `org-clock-sound'."
(defmacro org-with-clock-position (clock &rest forms)
"Evaluate FORMS with CLOCK as the current active clock."
+ (declare (indent 1) (debug t))
`(with-current-buffer (marker-buffer (car ,clock))
(org-with-wide-buffer
(goto-char (car ,clock))
(beginning-of-line)
,@forms)))
-(def-edebug-spec org-with-clock-position (form body))
-(put 'org-with-clock-position 'lisp-indent-function 1)
(defmacro org-with-clock (clock &rest forms)
"Evaluate FORMS with CLOCK as the current active clock.
This macro also protects the current active clock from being altered."
+ (declare (indent 1) (debug t))
`(org-with-clock-position ,clock
(let ((org-clock-start-time (cdr ,clock))
(org-clock-total-time)
@@ -932,8 +932,6 @@ This macro also protects the current active clock from being altered."
(org-back-to-heading t)
(point-marker))))
,@forms)))
-(def-edebug-spec org-with-clock (form body))
-(put 'org-with-clock 'lisp-indent-function 1)
(defsubst org-clock-clock-in (clock &optional resume start-time)
"Clock in to the clock located by CLOCK.
@@ -1416,12 +1414,12 @@ the default behavior."
(setq org-clock-mode-line-timer
(run-with-timer org-clock-update-period
org-clock-update-period
- 'org-clock-update-mode-line)))
+ #'org-clock-update-mode-line)))
(when org-clock-idle-timer
(cancel-timer org-clock-idle-timer)
(setq org-clock-idle-timer nil))
(setq org-clock-idle-timer
- (run-with-timer 60 60 'org-resolve-clocks-if-idle))
+ (run-with-timer 60 60 #'org-resolve-clocks-if-idle))
(message "Clock starts at %s - %s" ts org--msg-extra)
(run-hooks 'org-clock-in-hook))))))
@@ -1718,7 +1716,7 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
(unless (org-clocking-p)
(setq org-clock-current-task nil)))))))
-(add-hook 'org-clock-out-hook 'org-clock-remove-empty-clock-drawer)
+(add-hook 'org-clock-out-hook #'org-clock-remove-empty-clock-drawer)
(defun org-clock-remove-empty-clock-drawer ()
"Remove empty clock drawers in current subtree."
@@ -2014,7 +2012,7 @@ Use `\\[org-clock-remove-overlays]' to remove the subtree times."
(when time (org-clock-put-overlay time)))))
;; Arrange to remove the overlays upon next change.
(when org-remove-highlights-with-change
- (add-hook 'before-change-functions 'org-clock-remove-overlays
+ (add-hook 'before-change-functions #'org-clock-remove-overlays
nil 'local))))
(let* ((h (/ org-clock-file-total-minutes 60))
(m (- org-clock-file-total-minutes (* 60 h))))
@@ -2065,7 +2063,7 @@ If NOREMOVE is nil, remove this function from the
(setq org-clock-overlays nil)
(unless noremove
(remove-hook 'before-change-functions
- 'org-clock-remove-overlays 'local))))
+ #'org-clock-remove-overlays 'local))))
;;;###autoload
(defun org-clock-out-if-current ()
@@ -2241,7 +2239,7 @@ have priority."
((>= month 7) 3)
((>= month 4) 2)
(t 1)))
- m1 h1 d1 month1 y1 shiftedy shiftedm shiftedq)
+ h1 d1 month1 y1 shiftedy shiftedm shiftedq) ;; m1
(cond
((string-match "\\`[0-9]+\\'" skey)
(setq y (string-to-number skey) month 1 d 1 key 'year))
@@ -2344,7 +2342,7 @@ have priority."
(`interactive (org-read-date nil t nil "Range end? "))
(`untilnow (current-time))
(_ (encode-time 0
- (or m1 m)
+ m ;; (or m1 m)
(or h1 h)
(or d1 d)
(or month1 month)
@@ -2391,7 +2389,7 @@ the currently selected interval size."
(user-error "Line needs a :block definition before this command works")
(let* ((b (match-beginning 1)) (e (match-end 1))
(s (match-string 1))
- block shift ins y mw d date wp m)
+ block shift ins y mw d date wp) ;; m
(cond
((equal s "yesterday") (setq s "today-1"))
((equal s "lastweek") (setq s "thisweek-1"))
@@ -2416,7 +2414,7 @@ the currently selected interval size."
(cond
(d (setq ins (format-time-string
"%Y-%m-%d"
- (encode-time 0 0 0 (+ d n) m y))))
+ (encode-time 0 0 0 (+ d n) nil y)))) ;; m
((and wp (string-match "w\\|W" wp) mw (> (length wp) 0))
(require 'cal-iso)
(setq date (calendar-gregorian-from-absolute
@@ -2934,12 +2932,12 @@ PROPERTIES: The list properties specified in the `:properties' parameter
(save-excursion
(org-clock-sum ts te
(when matcher
- `(lambda ()
- (let* ((todo (org-get-todo-state))
- (tags-list (org-get-tags))
- (org-scanner-tags tags-list)
- (org-trust-scanner-tags t))
- (funcall ,matcher todo tags-list nil)))))
+ (lambda ()
+ (let* ((todo (org-get-todo-state))
+ (tags-list (org-get-tags))
+ (org-scanner-tags tags-list)
+ (org-trust-scanner-tags t))
+ (funcall matcher todo tags-list nil)))))
(goto-char (point-min))
(setq st t)
(while (or (and (bobp) (prog1 st (setq st nil))