;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\207" [require cl-lib org-macs] 2) #@70 Canonical time duration units. See `org-duration-units' for details. (defconst org-duration-canonical-units (byte-code "\300\301\302\303BE\207" [("min" . 1) ("h" . 60) "d" 1440] 4) (#$ . 477)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315\316\317\320\321&\210\300\322\302\303\323DD\324\306\325\306\326\310\311\312\327\320\330& \207" [custom-declare-variable org-duration-units funcall function #[0 "\300\301\302\303B\304\305B\306\307B\310\303\311_B\257\207" [("min" . 1) ("h" . 60) "d" 1440 "w" 10080 "m" 43200 "y" 365.25] 8] "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 #[514 "\300\"\210\301 \207" [set-default org-duration-set-regexps] 5 "\n\n(fn VAR VAL)"] :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 #[0 "\300\207" [(("d") (special . h:mm))] 1] "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\nEventually, the list can contain one of the following special\nentries:\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\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)))))] 16) #@161 Regexp matching a duration expressed with H:MM or H:MM:SS format. See `org-duration--h:mm:ss-re' to only match the latter. Hours can use any number of digits. (defconst org-duration--h:mm-re "\\`[ ]*[0-9]+\\(?::[0-9]\\{2\\}\\)\\{1,2\\}[ ]*\\'" (#$ . 4717)) #@148 Regexp matching a duration expressed H:MM:SS format. See `org-duration--h:mm-re' to also support H:MM format. Hours can use any number of digits. (defconst org-duration--h:mm:ss-re "\\`[ ]*[0-9]+\\(?::[0-9]\\{2\\}\\)\\{2\\}[ ]*\\'" (#$ . 4984)) #@168 Regexp matching a duration with an unit. Allowed units are defined in `org-duration-units'. Match group 1 contains the bare number. Match group 2 contains the unit. (defvar org-duration--unit-re nil (#$ . 5239)) #@101 Regexp matching a duration expressed with units. Allowed units are defined in `org-duration-units'. (defvar org-duration--full-re nil (#$ . 5460)) #@210 Regexp matching a duration expressed with units and H:MM or H:MM:SS format. Allowed units are defined in `org-duration-units'. Match group 1 contains units part. Match group 2 contains H:MM or H:MM:SS part. (defvar org-duration--mixed-re nil (#$ . 5614)) #@193 Return modifier associated to string UNIT. When optional argument CANONICAL is non-nil, refer to `org-duration-canonical-units' instead of `org-duration-units'. (fn UNIT &optional CANONICAL) (defalias 'org-duration--modifier #[513 "\302\203\n\202 \"A\206\303\304\"\207" [org-duration-canonical-units org-duration-units assoc error "Unknown unit: %S"] 5 (#$ . 5878)]) #@31 Set duration related regexps. (defalias 'org-duration-set-regexps #[0 "\305\306\307\310\311 \"\"\312\"P\313\314\n\211#\313\315\n\211#\211\207" [org-duration-canonical-units org-duration-units org-duration--unit-re org-duration--full-re org-duration--mixed-re "\\([0-9]+\\(?:\\.[0-9]*\\)?\\)[ ]*" regexp-opt mapcar car append t format "\\`[ ]*%s\\(?:[ ]+%s\\)*[ ]*\\'" "\\`[ ]*\\(?1:%s\\(?:[ ]+%s\\)*\\)[ ]+\\(?2:[0-9]+\\(?::[0-9][0-9]\\)\\{1,2\\}\\)[ ]*\\'"] 7 (#$ . 6261) nil]) #@51 Non-nil when string S is a time duration. (fn S) (defalias 'org-duration-p #[257 "\211;\2052\304\305\306#)\266\203\2062\n\304\305\306#)\266\203\2062 \304\305\306#)\266\203\207" [org-duration--full-re inhibit-changing-match-data org-duration--mixed-re org-duration--h:mm-re nil t string-match] 8 (#$ . 6758)]) #@355 Return number of minutes of DURATION string. When optional argument CANONICAL is non-nil, ignore `org-duration-units' and use standard time units value. A bare number is translated into minutes. The empty string is translated into 0.0. Return value as a float. Raise an error if duration format is not recognized. (fn DURATION &optional CANONICAL) (defalias 'org-duration-to-minutes #[513 "\305\232\203\306\207\247\203\307!\207\310\311\312#)\266\203\203H\313\314\315\316\"\"\211@A\211@A\211@A\317\206>\320\321\245\322_#\266\203\207\n\310\311\312#)\266\203\203\206\320\211\312 #\203\202\320\225\262\314\323\324\"!\323\325\"\326\"_\\\262\266\202Z\307!\207\312\f\"\203\235\323\324\"\323\325\"\327!\327!\\\207\330\310\311\312#)\266\203\203\263\307\314!!\207\331\332\"\207" [org-duration--h:mm-re inhibit-changing-match-data org-duration--full-re org-duration--unit-re org-duration--mixed-re "" 0.0 float nil t string-match mapcar string-to-number split-string ":" + 0 60.0 60 match-string 1 2 org-duration--modifier org-duration-to-minutes "\\`[0-9]+\\(\\.[0-9]*\\)?\\'" error "Invalid duration format: %S"] 17 (#$ . 7094)]) #@323 Return duration string for a given number of MINUTES. Format duration according to `org-duration-format' or FMT, when non-nil. When optional argument CANONICAL is non-nil, ignore `org-duration-units' and use standard time units value. Raise an error if expected format is unknown. (fn MINUTES &optional FMT CANONICAL) (defalias 'org-duration-from-minutes #[769 "C\206\301\302\267\2026\303\304\242\305\245\306\242\305\"#\202\343\307\242!\306\305\242_\305\"\303\310\311\312\"#\266\202\202\343:\204C\313\314\"\202\343\315\236\262\211:\203\333\211@\211\315=\203\317A\211\316>\203\302\211\317\320\321\322\323\324!\325\"\326\327%\"\211\205\207\330\331\332\320\321\333\323\324!\334\"\335\336%\"\"\211\203\223 \242W\203\236\311\n\242 #\202\273\211\307 \242!\245_\n\242Z\311#\337\311 \"Q\266\202\266\202\266\202\202\312#\262\202\326#\262\202\341#\262\266\202\207" [org-duration-format #[771 "\300\236A\211\205\301!\204\302\303\"\205\304\305\"\262\306\307\310\"\311\312\313\314\315 !\316\"\317\320%\"\203e\321\311\322\323\314\315\n\n\"\324\"\325\326%\"\206N\211\327!@\262@\330\"\304\331 \242!\245\"P\266\202\202\243\332\333\311\322\334\314\315  \"\335\"\336\337%\340#\341\342\203\203\343\202\204\344\340\342\345\340##\266\202!\206\243\327!\211@\211@A\346P\262\266\204\207" [special wholenump error "Unknown formatting directive: %S" format "%%.%df" sort cl-remove-if #[257 "\211:\205\211@\211\300=\205\301\262\207" [special t] 4 "\n\n(fn PAIR)"] make-byte-code 514 "\301@\300\"\301@\300\"V\207" vconcat vector [org-duration--modifier] 6 "\n\n(fn A B)" cl-find-if 257 "\211:\205\211@A\211\206\302\301\"\300\242X\266\202\266\202\207" [org-duration--modifier] 8 "\n\n(fn PAIR)" last org-duration--modifier float org-string-nw-p mapconcat "\211@A\211\302\301\"\211\300\242X\203)\303\300\242\"\300\211\242_Z\240\210\304\305#\262\2024\2033\306P\2024\307\262\266\202\207" [org-duration--modifier floor format " %d%s" " 0" #1=""] 11 "\n\n(fn UNITS)" #1# nil replace-regexp-in-string "\\`\\([ ]*\n\\)+" "\\`[ \n ]+" "[ \n ]+\\'" "0"] 15 "\n\n(fn MINUTES CANONICAL DURATION-FORMAT)"] #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (h:mm 14 h:mm:ss 30)) format "%d:%02d" 60 mod floor "%s:%02d" org-duration-from-minutes h:mm error "Invalid duration format specification: %S" special (h:mm h:mm:ss) cl-remove-if-not make-byte-code 257 "\211:\205\211@\211;\205\211\301\300\"\302V\262\262\207" vconcat vector [org-duration--modifier 60] 6 "\n\n(fn PAIR)" apply min mapcar "\301@\300\"\207" [org-duration--modifier] 4 "\n\n(fn P)" " "] 21 (#$ . 8291)]) #@318 Non-nil when every duration in TIMES has "H:MM" or "H:MM:SS" format. TIMES is a list of duration strings. Return nil if any duration is expressed with units, as defined in `org-duration-units'. Otherwise, if any duration is expressed with "H:MM:SS" format, return `h:mm:ss'. Otherwise, return `h:mm'. (fn TIMES) (defalias 'org-duration-h:mm-only-p #[257 "\304\3052a\211\203Z\211@\304\306\307#)\266\203\203$\310\305\304\"\210\202S\n\304\306\307#)\266\203\203<\310\305\304\"\210\202S\204S \304\306\307#)\266\203\203S\311\262A\266\202\202\210\211\206`\3120\207" [org-duration--full-re inhibit-changing-match-data org-duration--mixed-re org-duration--h:mm:ss-re nil :exit t string-match throw h:mm:ss h:mm] 11 (#$ . 11031)]) (byte-code "\300 \210\301\302!\207" [org-duration-set-regexps provide org-duration] 2)