org-timer-set-timer: Fix when called from agenda buffer
* lisp/org-timer.el (org-timer-set-timer): Get effort minutes from agenda entry line when in agenda buffer. Reported-by: Bhavin Gandhi <bhavin7392@gmail.com> Link: https://orgmode.org/list/CAOn=hbez7-4wFG2M1-MSHqAwvV0mysvLAUYP9_GK6mrSbtz3CQ@mail.gmail.com
This commit is contained in:
parent
85389da8cf
commit
129a18abf3
|
@ -424,9 +424,14 @@ using three \\[universal-argument] prefix arguments."
|
||||||
(if (numberp org-timer-default-timer)
|
(if (numberp org-timer-default-timer)
|
||||||
(number-to-string org-timer-default-timer)
|
(number-to-string org-timer-default-timer)
|
||||||
org-timer-default-timer))
|
org-timer-default-timer))
|
||||||
(effort-minutes (let ((effort (org-entry-get nil org-effort-property)))
|
(effort-minutes
|
||||||
|
(cond ((derived-mode-p 'org-agenda-mode)
|
||||||
|
(org-get-at-bol 'effort-minutes))
|
||||||
|
((derived-mode-p 'org-mode)
|
||||||
|
(let ((effort (org-entry-get nil org-effort-property)))
|
||||||
(when (org-string-nw-p effort)
|
(when (org-string-nw-p effort)
|
||||||
(floor (org-duration-to-minutes effort)))))
|
(floor (org-duration-to-minutes effort)))))
|
||||||
|
(t nil)))
|
||||||
(minutes (or (and (numberp opt) (number-to-string opt))
|
(minutes (or (and (numberp opt) (number-to-string opt))
|
||||||
(and (not (equal opt '(64)))
|
(and (not (equal opt '(64)))
|
||||||
effort-minutes
|
effort-minutes
|
||||||
|
|
Loading…
Reference in New Issue