Browse Source

Do not use `org-refresh-effort-properties' when initializing Org

* lisp/org.el (org-mode): Do not call `org-refresh-effort-properties'.
(org-set-effort): Avoid using `effort' text property.
* lisp/org-timer.el (org-timer-set-timer): Avoid using
  `effort-minutes' text property.

Limit use of `effort' and `effort-minutes' properties to "org-agenda".
Nicolas Goaziou 1 year ago
parent
commit
0266c36645
2 changed files with 5 additions and 4 deletions
  1. 3 1
      lisp/org-timer.el
  2. 2 3
      lisp/org.el

+ 3 - 1
lisp/org-timer.el

@@ -438,7 +438,9 @@ using three `C-u' prefix arguments."
 	   (if (numberp org-timer-default-timer)
 	       (number-to-string org-timer-default-timer)
 	     org-timer-default-timer))
-	 (effort-minutes (ignore-errors (floor (org-get-at-eol 'effort-minutes 1))))
+	 (effort-minutes (let ((effort (org-entry-get nil org-effort-property)))
+			   (when (org-string-nw-p effort)
+			     (floor (org-duration-to-minutes effort)))))
 	 (minutes (or (and (numberp opt) (number-to-string opt))
 		      (and (not (equal opt '(64)))
 			   effort-minutes

+ 2 - 3
lisp/org.el

@@ -5573,8 +5573,7 @@ The following commands are available:
      (when org-startup-with-latex-preview (org-toggle-latex-fragment '(16)))
      (unless org-inhibit-startup-visibility-stuff (org-set-startup-visibility))
      (when org-startup-truncated (setq truncate-lines t))
-     (when org-startup-indented (require 'org-indent) (org-indent-mode 1))
-     (org-refresh-effort-properties)))
+     (when org-startup-indented (require 'org-indent) (org-indent-mode 1))))
   ;; Try to set `org-hide' face correctly.
   (let ((foreground (org-find-invisible-foreground)))
     (when foreground
@@ -15007,7 +15006,7 @@ variables is set."
 			  value)
     (when (equal (org-get-heading t t t t)
 		 (bound-and-true-p org-clock-current-task))
-      (setq org-clock-effort (org-get-at-bol 'effort))
+      (setq org-clock-effort value)
       (org-clock-update-mode-line))
     (message "%s is now %s" org-effort-property value)))