emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* recursive load org-duration Error
@ 2020-12-21 16:06 Mario Bourgoin
  2021-01-04  5:38 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Mario Bourgoin @ 2020-12-21 16:06 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 28311 bytes --]

Dear Sir or Madam,

I recently started to use org mode efforts encoded as durations. I began
getting the error "recursive load org-duration" after I customized
"org-duration-units" by using "m" for the minutes units and "mon" for the
months units, restarted Emacs, and asked for the agenda with "C-c a a".

I found that a workaround to this problem is to put "(require
'org-duration)" in my .emacs before the customizations are loaded:

;; -*- emacs-lisp -*-
(package-initialize)
(require 'org-duration)
(setq custom-file "~/.emacs-custom.el")
(load custom-file)


I have appended the text generated by "org-submit-bug-report" followed by
the error stack trace.

Would you please let me know when this bug is fixed? I would also
appreciate finding out how the bug was fixed.

Best Regards,
Mario

Emacs  : GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
 of 2019-04-13
Package: Org mode version 9.4.3 (9.4.3-elpa @
c:/Users/Mario/.emacs.d/elpa/org-20201216/)

current state:
==============
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-agenda-skip-scheduled-if-deadline-is-shown t
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-log-note-clock-out t
 org-latex-default-packages-alist '(("AUTO" "inputenc" t) ("" "fontenc" t)
("" "fixltx2e" nil) ("" "graphicx" t)
   ("" "longtable" nil) ("" "float" nil) ("" "wrapfig" nil) ("" "rotating"
nil)
   ("normalem" "ulem" t) ("" "amsmath" t) ("" "textcomp" t) ("" "marvosym"
t)
   ("" "wasysym" t) ("" "amssymb" t) ("" "hyperref" nil) "\\tolerance=1000")
 org-agenda-files '("~/OneDrive/Documents/usr/org/Diary.org")
 org-blocker-hook '(org-edna-blocker-function
org-block-todo-from-checkboxes)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook
change-major-mode-hook org-show-all append local] 5]
#[0 "\300\301\302\303\304$\207"
  [add-hook change-major-mode-hook org-babel-show-result-all append local]
5]
org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-clock-persist 'history
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-startup-with-inline-images t
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-file-apps '((auto-mode . emacs) ("\\.mm\\'" . default)
("\\.x?html?\\'" . default)
("\\.pdf\\'" . "SumatraPDF %s"))
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-log-done 'note
 org-agenda-skip-deadline-prewarning-if-scheduled t
 org-trigger-hook '(org-edna-trigger-function)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-enforce-todo-checkbox-dependencies t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
org-cycle-show-empty-lines
 org-optimize-window-after-visibility-change)
 org-todo-keywords '((sequence "TODO(t)" "NEXT(n)" "WAITING(w)" "|"
"DONE(d)" "CANCELED(c)"))
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-confirm-shell-link-function 'yes-or-no-p
 org-duration-units '(("m" . 1) ("h" . 60) ("d" . 1440) ("w" . 10080)
("mon" . 43200) ("y" . 525960.0))
 org-link-parameters '(("attachment" :follow org-attach-follow :complete
org-attach-complete-link)
      ("id" :follow org-id-open) ("eww" :follow org-eww-open :store
org-eww-store-link)
      ("rmail" :follow org-rmail-open :store org-rmail-store-link)
      ("mhe" :follow org-mhe-open :store org-mhe-store-link)
      ("irc" :follow org-irc-visit :store org-irc-store-link :export
org-irc-export)
      ("info" :follow org-info-open :export org-info-export :store
org-info-store-link)
      ("gnus" :follow org-gnus-open :store org-gnus-store-link)
      ("docview" :follow org-docview-open :export org-docview-export :store
org-docview-store-link)
      ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
      ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
org-bbdb-complete-link
:store org-bbdb-store-link)
      ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs")
      ("shell" :follow org-link--open-shell)
      ("news" :follow
#[514 "\301\300\302 Q \"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"])
      ("mailto" :follow
#[514 "\301\300\302 Q \"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL
ARG)"])
      ("https" :follow
#[514 "\301\300\302 Q \"\207" ["https" browse-url ":"] 6 "\n\n(fn URL
ARG)"])
      ("http" :follow
#[514 "\301\300\302 Q \"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"])
      ("ftp" :follow
#[514 "\301\300\302 Q \"\207" ["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"])
      ("help" :follow org-link--open-help) ("file" :complete
org-link-complete-file)
      ("elisp" :follow org-link--open-elisp) ("doi" :follow
org-link--open-doi))
 org-agenda-skip-scheduled-if-done t
 org-link-elisp-confirm-function 'yes-or-no-p
 org-edna-mode t
 org-directory "~/OneDrive/Documents/usr/org/"
 org-agenda-skip-deadline-if-done t
 org-agenda-start-on-weekday 7
 org-default-notes-file "notes.org"
 )

backtrace:
==============

Debugger entered--Lisp error: (error "Recursive load"
"c:/Users/Mario/.emacs.d/elpa/org-20201216/org-duration.elc"
"c:/Users/Mario/.emacs.d/elpa/org-20201216/org-duration.elc"
"c:/Users/Mario/.emacs.d/elpa/org-20201216/org-duration.elc"
"c:/Users/Mario/.emacs.d/elpa/org-20201216/org-duration.elc"
"c:/Users/Mario/.emacs.d/elpa/org-20201216/org-duration.elc")
  org-duration-set-regexps()
  #f(compiled-function (var val) #<bytecode 0x21a37a9>)(org-duration-units
(("m" . 1) ("h" . 60) ("d" . 1440) ("w" . 10080) ("mon" . 43200) ("y" .
525960.0)))
  custom-initialize-changed(org-duration-units (funcall (function
#f(compiled-function () #<bytecode 0x21a3795>))))
  custom-declare-variable(org-duration-units (funcall (function
#f(compiled-function () #<bytecode 0x21a3795>))) "Conversion factor to
minutes for a duration.\n\nEach entry has the form (UNIT . MODIFIER).\n\nIn
a duration string, a number followed by UNIT is multiplied by\nthe
specified number of MODIFIER to obtain a duration in minutes.\n\nFor
example, the following value\n\n  \\=`((\"min\" . 1)\n    (\"h\" . 60)\n
 (\"d\" . ,(* 60 8))\n    (\"w\" . ,(* 60 8 5))\n    (\"m\" . ,(* 60 8 5
4))\n    (\"y\" . ,(* 60 8 5 4 10)))\n\nis meaningful if you work an
average of 8 hours per day, 5 days\na week, 4 weeks a month and 10 months a
year.\n\nWhen setting this variable outside the Customize interface,
make\nsure to call the following command:\n\n
 \\[org-duration-set-regexps]" :group org-agenda :version "26.1"
:package-version (Org . "9.1") :set #f(compiled-function (var val)
#<bytecode 0x21a37a9>) :initialize custom-initialize-changed :type (choice
(const :tag "H:MM" h:mm) (const :tag "H:MM:SS" h:mm:ss) (alist :key-type
(string :tag "Unit") :value-type (number :tag "Modifier"))))

byte-code("\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315\316\317\320\321&\017\210\300\322\302\303\323DD\324\306\325\306\326\312\327\320\330&\013\207"
[custom-declare-variable org-duration-units funcall function
#f(compiled-function () #<bytecode 0x21a3795>) "Conversion factor to
minutes for a duration.\n\nEach entry has the form (UNIT . MODIFIER).\n\nIn
a duration string, a number followed by UNIT is multiplied by\nthe
specified number of MODIFIER to obtain a duration in minutes.\n\nFor
example, the following value\n\n  \\=`((\"min\" . 1)\n    (\"h\" . 60)\n
 (\"d\" . ,(* 60 8))\n    (\"w\" . ,(* 60 8 5))\n    (\"m\" . ,(* 60 8 5
4))\n    (\"y\" . ,(* 60 8 5 4 10)))\n\nis meaningful if you work an
average of 8 hours per day, 5 days\na week, 4 weeks a month and 10 months a
year.\n\nWhen setting this variable outside the Customize interface,
make\nsure to call the following command:\n\n
 \\[org-duration-set-regexps]" :group org-agenda :version "26.1"
:package-version (Org . "9.1") :set #f(compiled-function (var val)
#<bytecode 0x21a37a9>) :initialize custom-initialize-changed :type (choice
(const :tag "H:MM" h:mm) (const :tag "H:MM:SS" h:mm:ss) (alist :key-type
(string :tag "Unit") :value-type (number :tag "Modifier")))
org-duration-format #f(compiled-function () #<bytecode 0x21a37b5>) "Format
definition for a duration.\n\nThe value can be set to, respectively, the
symbols `h:mm:ss' or\n`h:mm', which means a duration is expressed as,
respectively,\na \"H:MM:SS\" or \"H:MM\" string.\n\nAlternatively, the
value can be a list of entries following the\npattern:\n\n  (UNIT .
REQUIRED?)\n\nUNIT is a unit string, as defined in `org-duration-units'.
The\ntime duration is formatted using only the time components that\nare
specified here.\n\nUnits with a zero value are skipped, unless REQUIRED? is
non-nil.\nIn that case, the unit is always used.\n\nThe list can also
contain one of the following special entries:\n\n  (special . h:mm)\n
 (special . h:mm:ss)\n\n    Units shorter than an hour are ignored.  The
hours and\n    minutes part of the duration is expressed unconditionally\n
   with H:MM, or H:MM:SS, pattern.\n\n  (special . PRECISION)\n\n    A
duration is expressed with a single unit, PRECISION being\n    the number
of decimal places to show.  The unit chosen is the\n    first one required
or with a non-zero integer part.  If there\n    is no such unit, the
smallest one is used.\n\nEventually, if the list contains the symbol
`compact', the\nduration is expressed in a compact form, without any white
space\nbetween units.\n\nFor example,\n\n   ((\"d\" . nil) (\"h\" . t)
(\"min\" . t))\n\nmeans a duration longer than a day is expressed in days,
hours\nand minutes, whereas a duration shorter than a day is
always\nexpressed in hours and minutes, even when shorter than an
hour.\n\nOn the other hand, the value\n\n  ((\"d\" . nil) (\"min\" .
nil))\n\nmeans a duration longer than a day is expressed in days
and\nminutes, whereas a duration shorter than a day is expressed\nentirely
in minutes, even when longer than an hour.\n\nThe following format\n\n
 ((\"d\" . nil) (special . h:mm))\n\nmeans that any duration longer than a
day is expressed with both\na \"d\" unit and a \"H:MM\" part, whereas a
duration shorter than\na day is expressed only as a \"H:MM\"
string.\n\nEventually,\n\n  ((\"d\" . nil) (\"h\" . nil) (special .
2))\n\nexpresses a duration longer than a day as a decimal number, with\na
2-digits fractional part, of \"d\" unit.  A duration shorter\nthan a day
uses \"h\" unit instead." org-time org-clock (Org . "9.1") (choice (const
:tag "Use H:MM" h:mm) (const :tag "Use H:MM:SS" h:mm:ss) (repeat :tag "Use
units" (choice (cons :tag "Use units" (string :tag "Unit") (choice (const
:tag "Skip when zero" nil) (const :tag "Always used" t))) (cons :tag "Use a
single decimal unit" (const special) (integer :tag "Number of decimals"))
(cons :tag "Use both units and H:MM" (const special) (const h:mm)) (cons
:tag "Use both units and H:MM:SS" (const special) (const h:mm:ss)) (const
:tag "Use compact form" compact))))] 16)
  org-duration-set-regexps()
  #f(compiled-function (var val) #<bytecode 0x21a371d>)(org-duration-units
(("m" . 1) ("h" . 60) ("d" . 1440) ("w" . 10080) ("mon" . 43200) ("y" .
525960.0)))
  custom-initialize-changed(org-duration-units (funcall (function
#f(compiled-function () #<bytecode 0x2103d5d>))))
  custom-declare-variable(org-duration-units (funcall (function
#f(compiled-function () #<bytecode 0x2103d5d>))) "Conversion factor to
minutes for a duration.\n\nEach entry has the form (UNIT . MODIFIER).\n\nIn
a duration string, a number followed by UNIT is multiplied by\nthe
specified number of MODIFIER to obtain a duration in minutes.\n\nFor
example, the following value\n\n  \\=`((\"min\" . 1)\n    (\"h\" . 60)\n
 (\"d\" . ,(* 60 8))\n    (\"w\" . ,(* 60 8 5))\n    (\"m\" . ,(* 60 8 5
4))\n    (\"y\" . ,(* 60 8 5 4 10)))\n\nis meaningful if you work an
average of 8 hours per day, 5 days\na week, 4 weeks a month and 10 months a
year.\n\nWhen setting this variable outside the Customize interface,
make\nsure to call the following command:\n\n
 \\[org-duration-set-regexps]" :group org-agenda :version "26.1"
:package-version (Org . "9.1") :set #f(compiled-function (var val)
#<bytecode 0x2103d71>) :initialize custom-initialize-changed :type (choice
(const :tag "H:MM" h:mm) (const :tag "H:MM:SS" h:mm:ss) (alist :key-type
(string :tag "Unit") :value-type (number :tag "Modifier"))))

byte-code("\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315\316\317\320\321&\017\210\300\322\302\303\323DD\324\306\325\306\326\312\327\320\330&\013\207"
[custom-declare-variable org-duration-units funcall function
#f(compiled-function () #<bytecode 0x2103d5d>) "Conversion factor to
minutes for a duration.\n\nEach entry has the form (UNIT . MODIFIER).\n\nIn
a duration string, a number followed by UNIT is multiplied by\nthe
specified number of MODIFIER to obtain a duration in minutes.\n\nFor
example, the following value\n\n  \\=`((\"min\" . 1)\n    (\"h\" . 60)\n
 (\"d\" . ,(* 60 8))\n    (\"w\" . ,(* 60 8 5))\n    (\"m\" . ,(* 60 8 5
4))\n    (\"y\" . ,(* 60 8 5 4 10)))\n\nis meaningful if you work an
average of 8 hours per day, 5 days\na week, 4 weeks a month and 10 months a
year.\n\nWhen setting this variable outside the Customize interface,
make\nsure to call the following command:\n\n
 \\[org-duration-set-regexps]" :group org-agenda :version "26.1"
:package-version (Org . "9.1") :set #f(compiled-function (var val)
#<bytecode 0x2103d71>) :initialize custom-initialize-changed :type (choice
(const :tag "H:MM" h:mm) (const :tag "H:MM:SS" h:mm:ss) (alist :key-type
(string :tag "Unit") :value-type (number :tag "Modifier")))
org-duration-format #f(compiled-function () #<bytecode 0x2103d7d>) "Format
definition for a duration.\n\nThe value can be set to, respectively, the
symbols `h:mm:ss' or\n`h:mm', which means a duration is expressed as,
respectively,\na \"H:MM:SS\" or \"H:MM\" string.\n\nAlternatively, the
value can be a list of entries following the\npattern:\n\n  (UNIT .
REQUIRED?)\n\nUNIT is a unit string, as defined in `org-duration-units'.
The\ntime duration is formatted using only the time components that\nare
specified here.\n\nUnits with a zero value are skipped, unless REQUIRED? is
non-nil.\nIn that case, the unit is always used.\n\nThe list can also
contain one of the following special entries:\n\n  (special . h:mm)\n
 (special . h:mm:ss)\n\n    Units shorter than an hour are ignored.  The
hours and\n    minutes part of the duration is expressed unconditionally\n
   with H:MM, or H:MM:SS, pattern.\n\n  (special . PRECISION)\n\n    A
duration is expressed with a single unit, PRECISION being\n    the number
of decimal places to show.  The unit chosen is the\n    first one required
or with a non-zero integer part.  If there\n    is no such unit, the
smallest one is used.\n\nEventually, if the list contains the symbol
`compact', the\nduration is expressed in a compact form, without any white
space\nbetween units.\n\nFor example,\n\n   ((\"d\" . nil) (\"h\" . t)
(\"min\" . t))\n\nmeans a duration longer than a day is expressed in days,
hours\nand minutes, whereas a duration shorter than a day is
always\nexpressed in hours and minutes, even when shorter than an
hour.\n\nOn the other hand, the value\n\n  ((\"d\" . nil) (\"min\" .
nil))\n\nmeans a duration longer than a day is expressed in days
and\nminutes, whereas a duration shorter than a day is expressed\nentirely
in minutes, even when longer than an hour.\n\nThe following format\n\n
 ((\"d\" . nil) (special . h:mm))\n\nmeans that any duration longer than a
day is expressed with both\na \"d\" unit and a \"H:MM\" part, whereas a
duration shorter than\na day is expressed only as a \"H:MM\"
string.\n\nEventually,\n\n  ((\"d\" . nil) (\"h\" . nil) (special .
2))\n\nexpresses a duration longer than a day as a decimal number, with\na
2-digits fractional part, of \"d\" unit.  A duration shorter\nthan a day
uses \"h\" unit instead." org-time org-clock (Org . "9.1") (choice (const
:tag "Use H:MM" h:mm) (const :tag "Use H:MM:SS" h:mm:ss) (repeat :tag "Use
units" (choice (cons :tag "Use units" (string :tag "Unit") (choice (const
:tag "Skip when zero" nil) (const :tag "Always used" t))) (cons :tag "Use a
single decimal unit" (const special) (integer :tag "Number of decimals"))
(cons :tag "Use both units and H:MM" (const special) (const h:mm)) (cons
:tag "Use both units and H:MM:SS" (const special) (const h:mm:ss)) (const
:tag "Use compact form" compact))))] 16)
  org-duration-set-regexps()
  #f(compiled-function (var val) #<bytecode 0x2103ce5>)(org-duration-units
(("m" . 1) ("h" . 60) ("d" . 1440) ("w" . 10080) ("mon" . 43200) ("y" .
525960.0)))
  custom-initialize-changed(org-duration-units (funcall (function
#f(compiled-function () #<bytecode 0x2097659>))))
  custom-declare-variable(org-duration-units (funcall (function
#f(compiled-function () #<bytecode 0x2097659>))) "Conversion factor to
minutes for a duration.\n\nEach entry has the form (UNIT . MODIFIER).\n\nIn
a duration string, a number followed by UNIT is multiplied by\nthe
specified number of MODIFIER to obtain a duration in minutes.\n\nFor
example, the following value\n\n  \\=`((\"min\" . 1)\n    (\"h\" . 60)\n
 (\"d\" . ,(* 60 8))\n    (\"w\" . ,(* 60 8 5))\n    (\"m\" . ,(* 60 8 5
4))\n    (\"y\" . ,(* 60 8 5 4 10)))\n\nis meaningful if you work an
average of 8 hours per day, 5 days\na week, 4 weeks a month and 10 months a
year.\n\nWhen setting this variable outside the Customize interface,
make\nsure to call the following command:\n\n
 \\[org-duration-set-regexps]" :group org-agenda :version "26.1"
:package-version (Org . "9.1") :set #f(compiled-function (var val)
#<bytecode 0x209766d>) :initialize custom-initialize-changed :type (choice
(const :tag "H:MM" h:mm) (const :tag "H:MM:SS" h:mm:ss) (alist :key-type
(string :tag "Unit") :value-type (number :tag "Modifier"))))

byte-code("\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315\316\317\320\321&\017\210\300\322\302\303\323DD\324\306\325\306\326\312\327\320\330&\013\207"
[custom-declare-variable org-duration-units funcall function
#f(compiled-function () #<bytecode 0x2097659>) "Conversion factor to
minutes for a duration.\n\nEach entry has the form (UNIT . MODIFIER).\n\nIn
a duration string, a number followed by UNIT is multiplied by\nthe
specified number of MODIFIER to obtain a duration in minutes.\n\nFor
example, the following value\n\n  \\=`((\"min\" . 1)\n    (\"h\" . 60)\n
 (\"d\" . ,(* 60 8))\n    (\"w\" . ,(* 60 8 5))\n    (\"m\" . ,(* 60 8 5
4))\n    (\"y\" . ,(* 60 8 5 4 10)))\n\nis meaningful if you work an
average of 8 hours per day, 5 days\na week, 4 weeks a month and 10 months a
year.\n\nWhen setting this variable outside the Customize interface,
make\nsure to call the following command:\n\n
 \\[org-duration-set-regexps]" :group org-agenda :version "26.1"
:package-version (Org . "9.1") :set #f(compiled-function (var val)
#<bytecode 0x209766d>) :initialize custom-initialize-changed :type (choice
(const :tag "H:MM" h:mm) (const :tag "H:MM:SS" h:mm:ss) (alist :key-type
(string :tag "Unit") :value-type (number :tag "Modifier")))
org-duration-format #f(compiled-function () #<bytecode 0x2097679>) "Format
definition for a duration.\n\nThe value can be set to, respectively, the
symbols `h:mm:ss' or\n`h:mm', which means a duration is expressed as,
respectively,\na \"H:MM:SS\" or \"H:MM\" string.\n\nAlternatively, the
value can be a list of entries following the\npattern:\n\n  (UNIT .
REQUIRED?)\n\nUNIT is a unit string, as defined in `org-duration-units'.
The\ntime duration is formatted using only the time components that\nare
specified here.\n\nUnits with a zero value are skipped, unless REQUIRED? is
non-nil.\nIn that case, the unit is always used.\n\nThe list can also
contain one of the following special entries:\n\n  (special . h:mm)\n
 (special . h:mm:ss)\n\n    Units shorter than an hour are ignored.  The
hours and\n    minutes part of the duration is expressed unconditionally\n
   with H:MM, or H:MM:SS, pattern.\n\n  (special . PRECISION)\n\n    A
duration is expressed with a single unit, PRECISION being\n    the number
of decimal places to show.  The unit chosen is the\n    first one required
or with a non-zero integer part.  If there\n    is no such unit, the
smallest one is used.\n\nEventually, if the list contains the symbol
`compact', the\nduration is expressed in a compact form, without any white
space\nbetween units.\n\nFor example,\n\n   ((\"d\" . nil) (\"h\" . t)
(\"min\" . t))\n\nmeans a duration longer than a day is expressed in days,
hours\nand minutes, whereas a duration shorter than a day is
always\nexpressed in hours and minutes, even when shorter than an
hour.\n\nOn the other hand, the value\n\n  ((\"d\" . nil) (\"min\" .
nil))\n\nmeans a duration longer than a day is expressed in days
and\nminutes, whereas a duration shorter than a day is expressed\nentirely
in minutes, even when longer than an hour.\n\nThe following format\n\n
 ((\"d\" . nil) (special . h:mm))\n\nmeans that any duration longer than a
day is expressed with both\na \"d\" unit and a \"H:MM\" part, whereas a
duration shorter than\na day is expressed only as a \"H:MM\"
string.\n\nEventually,\n\n  ((\"d\" . nil) (\"h\" . nil) (special .
2))\n\nexpresses a duration longer than a day as a decimal number, with\na
2-digits fractional part, of \"d\" unit.  A duration shorter\nthan a day
uses \"h\" unit instead." org-time org-clock (Org . "9.1") (choice (const
:tag "Use H:MM" h:mm) (const :tag "Use H:MM:SS" h:mm:ss) (repeat :tag "Use
units" (choice (cons :tag "Use units" (string :tag "Unit") (choice (const
:tag "Skip when zero" nil) (const :tag "Always used" t))) (cons :tag "Use a
single decimal unit" (const special) (integer :tag "Number of decimals"))
(cons :tag "Use both units and H:MM" (const special) (const h:mm)) (cons
:tag "Use both units and H:MM:SS" (const special) (const h:mm:ss)) (const
:tag "Use compact form" compact))))] 16)
  org-duration-set-regexps()
  #f(compiled-function (var val) #<bytecode 0x2243219>)(org-duration-units
(("m" . 1) ("h" . 60) ("d" . 1440) ("w" . 10080) ("mon" . 43200) ("y" .
525960.0)))
  custom-initialize-changed(org-duration-units (funcall (function
#f(compiled-function () #<bytecode 0x2243205>))))
  custom-declare-variable(org-duration-units (funcall (function
#f(compiled-function () #<bytecode 0x2243205>))) "Conversion factor to
minutes for a duration.\n\nEach entry has the form (UNIT . MODIFIER).\n\nIn
a duration string, a number followed by UNIT is multiplied by\nthe
specified number of MODIFIER to obtain a duration in minutes.\n\nFor
example, the following value\n\n  \\=`((\"min\" . 1)\n    (\"h\" . 60)\n
 (\"d\" . ,(* 60 8))\n    (\"w\" . ,(* 60 8 5))\n    (\"m\" . ,(* 60 8 5
4))\n    (\"y\" . ,(* 60 8 5 4 10)))\n\nis meaningful if you work an
average of 8 hours per day, 5 days\na week, 4 weeks a month and 10 months a
year.\n\nWhen setting this variable outside the Customize interface,
make\nsure to call the following command:\n\n
 \\[org-duration-set-regexps]" :group org-agenda :version "26.1"
:package-version (Org . "9.1") :set #f(compiled-function (var val)
#<bytecode 0x2243219>) :initialize custom-initialize-changed :type (choice
(const :tag "H:MM" h:mm) (const :tag "H:MM:SS" h:mm:ss) (alist :key-type
(string :tag "Unit") :value-type (number :tag "Modifier"))))

byte-code("\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315\316\317\320\321&\017\210\300\322\302\303\323DD\324\306\325\306\326\312\327\320\330&\013\207"
[custom-declare-variable org-duration-units funcall function
#f(compiled-function () #<bytecode 0x2243205>) "Conversion factor to
minutes for a duration.\n\nEach entry has the form (UNIT . MODIFIER).\n\nIn
a duration string, a number followed by UNIT is multiplied by\nthe
specified number of MODIFIER to obtain a duration in minutes.\n\nFor
example, the following value\n\n  \\=`((\"min\" . 1)\n    (\"h\" . 60)\n
 (\"d\" . ,(* 60 8))\n    (\"w\" . ,(* 60 8 5))\n    (\"m\" . ,(* 60 8 5
4))\n    (\"y\" . ,(* 60 8 5 4 10)))\n\nis meaningful if you work an
average of 8 hours per day, 5 days\na week, 4 weeks a month and 10 months a
year.\n\nWhen setting this variable outside the Customize interface,
make\nsure to call the following command:\n\n
 \\[org-duration-set-regexps]" :group org-agenda :version "26.1"
:package-version (Org . "9.1") :set #f(compiled-function (var val)
#<bytecode 0x2243219>) :initialize custom-initialize-changed :type (choice
(const :tag "H:MM" h:mm) (const :tag "H:MM:SS" h:mm:ss) (alist :key-type
(string :tag "Unit") :value-type (number :tag "Modifier")))
org-duration-format #f(compiled-function () #<bytecode 0x20975ed>) "Format
definition for a duration.\n\nThe value can be set to, respectively, the
symbols `h:mm:ss' or\n`h:mm', which means a duration is expressed as,
respectively,\na \"H:MM:SS\" or \"H:MM\" string.\n\nAlternatively, the
value can be a list of entries following the\npattern:\n\n  (UNIT .
REQUIRED?)\n\nUNIT is a unit string, as defined in `org-duration-units'.
The\ntime duration is formatted using only the time components that\nare
specified here.\n\nUnits with a zero value are skipped, unless REQUIRED? is
non-nil.\nIn that case, the unit is always used.\n\nThe list can also
contain one of the following special entries:\n\n  (special . h:mm)\n
 (special . h:mm:ss)\n\n    Units shorter than an hour are ignored.  The
hours and\n    minutes part of the duration is expressed unconditionally\n
   with H:MM, or H:MM:SS, pattern.\n\n  (special . PRECISION)\n\n    A
duration is expressed with a single unit, PRECISION being\n    the number
of decimal places to show.  The unit chosen is the\n    first one required
or with a non-zero integer part.  If there\n    is no such unit, the
smallest one is used.\n\nEventually, if the list contains the symbol
`compact', the\nduration is expressed in a compact form, without any white
space\nbetween units.\n\nFor example,\n\n   ((\"d\" . nil) (\"h\" . t)
(\"min\" . t))\n\nmeans a duration longer than a day is expressed in days,
hours\nand minutes, whereas a duration shorter than a day is
always\nexpressed in hours and minutes, even when shorter than an
hour.\n\nOn the other hand, the value\n\n  ((\"d\" . nil) (\"min\" .
nil))\n\nmeans a duration longer than a day is expressed in days
and\nminutes, whereas a duration shorter than a day is expressed\nentirely
in minutes, even when longer than an hour.\n\nThe following format\n\n
 ((\"d\" . nil) (special . h:mm))\n\nmeans that any duration longer than a
day is expressed with both\na \"d\" unit and a \"H:MM\" part, whereas a
duration shorter than\na day is expressed only as a \"H:MM\"
string.\n\nEventually,\n\n  ((\"d\" . nil) (\"h\" . nil) (special .
2))\n\nexpresses a duration longer than a day as a decimal number, with\na
2-digits fractional part, of \"d\" unit.  A duration shorter\nthan a day
uses \"h\" unit instead." org-time org-clock (Org . "9.1") (choice (const
:tag "Use H:MM" h:mm) (const :tag "Use H:MM:SS" h:mm:ss) (repeat :tag "Use
units" (choice (cons :tag "Use units" (string :tag "Unit") (choice (const
:tag "Skip when zero" nil) (const :tag "Always used" t))) (cons :tag "Use a
single decimal unit" (const special) (integer :tag "Number of decimals"))
(cons :tag "Use both units and H:MM" (const special) (const h:mm)) (cons
:tag "Use both units and H:MM:SS" (const special) (const h:mm:ss)) (const
:tag "Use compact form" compact))))] 16)
  org-duration-to-minutes("5h")
  org-refresh-property(((effort . identity) (effort-minutes .
org-duration-to-minutes)) "5h" nil)
  org-refresh-properties("Effort" ((effort . identity) (effort-minutes .
org-duration-to-minutes)))
  org-refresh-effort-properties()
  org-agenda-prepare-buffers(("~/OneDrive/Documents/usr/org/Diary.org"))
  org-agenda-prepare("Day/Week")
  org-agenda-list(nil)
  funcall-interactively(org-agenda-list nil)
  call-interactively(org-agenda-list)
  org-agenda(nil)
  funcall-interactively(org-agenda nil)
  call-interactively(org-agenda nil nil)
  command-execute(org-agenda)

[-- Attachment #2: Type: text/html, Size: 33866 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: recursive load org-duration Error
  2020-12-21 16:06 recursive load org-duration Error Mario Bourgoin
@ 2021-01-04  5:38 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2021-01-04  5:38 UTC (permalink / raw)
  To: Mario Bourgoin; +Cc: emacs-orgmode

Mario Bourgoin writes:

> I recently started to use org mode efforts encoded as durations. I began
> getting the error "recursive load org-duration" after I customized
> "org-duration-units" by using "m" for the minutes units and "mon" for the
> months units, restarted Emacs, and asked for the agenda with "C-c a a".
>
> I found that a workaround to this problem is to put "(require
> 'org-duration)" in my .emacs before the customizations are loaded:
[...]

Thanks for the detailed report.  I can trigger the issue with

  (custom-set-variables
   '(org-duration-units
     '(("min" . 1)
       ("h" . 60)
       ("d" . 1440)
       ("w" . 10080)
       ("m" . 43200)
       ("y" . 525960.0))))

  ;; This...
  (require 'org-duration)
  ;; or anything else the triggers a load of org-duration, e.g.
  ;; (org-duration-to-minutes "3m")

> Would you please let me know when this bug is fixed? I would also
> appreciate finding out how the bug was fixed.

It's fixed on the maint branch.  See
https://code.orgmode.org/bzg/org-mode/commit/273391c978d2e9759a9a389bf5d5eb9b03b8fe98


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-04  5:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21 16:06 recursive load org-duration Error Mario Bourgoin
2021-01-04  5:38 ` Kyle Meyer

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).