;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\210\300\312\302\303\313DD\314\306\307\310\311&\210\300\315\302\303\316DD\317\306\320\310\311&\210\300\321\302\303\322DD\323\306\307\310\311&\210\300\324\302\303\325DD\326\306\320\310\311&\210\300\327\302\303\330DD\331\306\332\310\311&\207" [custom-declare-variable utimeclock-time-prefix funcall function #[0 "\300\207" [#1="time:"] 1 #1#] "The prefix of a line used to store time.\n\nNote that space before this line is ignored." :type string :group utimeclock utimeclock-time-pair #[0 "\300\207" [#2="-"] 1 #2#] "The string used to pair up time ranges (must not contain spaces)." utimeclock-split-at-fill-column #[0 "\300\207" [t] 1] "Split lines at `utimeclock-line-separator' when it exceeds `fill-column'." boolean utimeclock-line-separator #[0 "\300\207" [#3="\\"] 1 #3#] "The character used for line continuations." utimeclock-12-hour-clock #[0 "\300\207" [nil] 1] "Use 12 hour clock instead of a 24 hour clock.\n\nThis controls the values entered as well as behavior wrapping time values." utimeclock-time-precision #[0 "\300\207" [minutes] 1] "The precision of report time in." (choice (const :tag "Hours" hours) (const :tag "Minutes" minutes) (const :tag "Seconds" seconds))] 8) #@83 Convert STR in the format '4:30:59' to the number of seconds as an int. (fn STR) (defalias 'utimeclock-as-sec-total #[257 "\300\301\"\302\303\211A\262\242!_\203\304\303\211A\262\242!_\202 \305\\\2030\303\211A\262\242!\2021\305\\\207" [split-string ":" 3600 string-to-number 60 0] 7 (#$ . 1338)]) #@61 Convert SEC-TOTAL to time format '4:30:59'. (fn SEC-TOTAL) (defalias 'utimeclock-from-sec-total #[257 "\211\301\245\302\245\302_Z\302_\301_\\Z\303\267\202&\304\305$\207\304\306#\207\304\307\"\207" [utimeclock-time-precision 3600 60 #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (seconds 25 minutes 32)) format "%d:%02d:%02d" "%d:%02d" "%d"] 9 (#$ . 1655)]) #@38 Return the current time as a string. (defalias 'utimeclock-current-time-as-string #[0 "\302\303\304\267\202 \203\305\202)\306\202) \203\307\202)\310\202) \203(\311\202)\312!!\207" [utimeclock-time-precision utimeclock-12-hour-clock string-trim-left format-time-string #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (seconds 8 minutes 20)) "%l:%M:%S" "%k:%M:%S" "%l:%M" "%k:%M" "%l" "%k"] 4 (#$ . 2071)]) #@240 Accumulate time ranges in LINE into '(time-as-seconds . time-was-incomplete). When ALLOW-INCOMPLETE is not nil, allow a start time without a matching end. In this case the current time is used as the end time. (fn LINE ALLOW-INCOMPLETE) (defalias 'utimeclock-accumulate-line #[514 "\302!\303\304\305!\211\203o\211@\203\306\307\"\210\305\"\211\242\243\211\242\243\303\262 \211\2034\211\310\230\203F\f\204?\306\311\"\210\312 \262\313\262 \314!\314!Z\211\304W\203`\211 \203\\\315\202]\316\\\262\n\\\262 \266A\266\202\202\210\211B\207" [utimeclock-time-pair utimeclock-12-hour-clock regexp-quote nil 0 split-string message "Incomplete time string '%s'" "" "Incomplete time not allowed '%s'" utimeclock-current-time-as-string t utimeclock-as-sec-total 43200 86400] 17 (#$ . 2533)]) #@63 Return the starting point of `utimeclock-time-prefix' or nil. (defalias 'utimeclock-time-point-previous-no-eol #[0 "\212\301\302\303\304$\205 `)\207" [utimeclock-time-prefix search-backward nil t 1] 5 (#$ . 3353)]) #@94 Return the starting point of `utimeclock-time-prefix' or nil (first moving to the line end). (defalias 'utimeclock-time-point-previous #[0 "\212\301\210\302\301\303\304$\205`)\207" [utimeclock-time-prefix nil search-backward t 1] 5 (#$ . 3576)]) #@228 Return text at the line beginning, before `utimeclock-time-prefix'. This could be a comment for example, or a blank string if nothing is found. TIME-POS should be the result of `utimeclock-time-point-previous'. (fn TIME-POS) (defalias 'utimeclock-time-point-previous-prefix #[257 "\212\211b\210\301\302 \"\303\211G\\\"P)\207" [utimeclock-time-prefix buffer-substring-no-properties line-beginning-position utimeclock-buffer-range-to-spaces] 6 (#$ . 3833)]) #@55 Return the line end position (excluding white-space). (defalias 'utimeclock-line-end-position-nonblank #[0 "\212\300 b\210\301\302x\210`)\207" [line-end-position "[:blank:]" nil] 2 (#$ . 4300)]) #@42 Return t when the current line is empty. (defalias 'utimeclock-current-line-empty-p #[0 "\212\301 \210\302\303\304!)\262)\207" [inhibit-changing-match-data beginning-of-line "[[:blank:]]*$" t looking-at] 3 (#$ . 4501)]) #@57 Return t when the current line ends with STR. (fn STR) (defalias 'utimeclock-current-line-ends-with #[257 "\300 \301 \302GZ]\"\230\207" [line-beginning-position line-end-position buffer-substring-no-properties] 7 (#$ . 4730)]) #@196 Return a string of spaces the length of two ranges in the buffer. Note that this is often simply BEG subtracted from END, however when tabs are used the results will be different. (fn BEG END) (defalias 'utimeclock-buffer-range-to-spaces #[514 "\212b\210ib\210i\300Z\301\"\266\202)\207" [make-string 32] 7 (#$ . 4971)]) #@284 Extract the line at POS until the line end. Lines that end with `utimeclock-line-separator' are considered part of the line, therefore we can extract multiple lines into a single logical line of text. Strip PREFIX from each line (when not nil or an empty string). (fn POS PREFIX) (defalias 'utimeclock-extract-line-multi #[514 "\212b\210\301\302\303 \"!\203/G\304U\204/\305\306\"\203*\211G\307O\266\202\202,\262!\262\310\"\203c\301\310\"\203M\211\304GGZO\266\202\202O\262!\262\311y\304U\203c\211\312\313\314 \"Q\262\211\262)\207" [utimeclock-line-separator string-trim-right buffer-substring-no-properties line-end-position 0 string-trim-left string-prefix-p nil string-suffix-p 1 " " utimeclock-extract-line-multi line-beginning-position] 10 (#$ . 5304)]) #@104 Return the end of line position of POS, taking `utimeclock-extract-line-multi' into account. (fn POS) (defalias 'utimeclock-end-of-line-multi #[257 "\212\211b\210\301 \302\303\"!\304\"\203 \305y\306U\203 \307\310 !\262\210\211\262)\207" [utimeclock-line-separator utimeclock-line-end-position-nonblank string-trim-right buffer-substring-no-properties string-suffix-p 1 0 utimeclock-end-of-line-multi line-beginning-position] 6 (#$ . 6103)]) #@148 Split the last time-range onto the next line if it exceeds the `fill-column'. PREFIX will be added to the beginning of the new line. (fn PREFIX) (defalias 'utimeclock-split-at-point #[257 "\212\302!\210\303 \304\305\"\216\306\307\310 \311\312$)\262\205\"\312u\210 \313\307\261)\207" [fill-column utimeclock-line-separator move-to-column match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] search-backward " " line-beginning-position t 1 "\n"] 7 (#$ . 6560)]) #@99 Time spent (working) immediately after clocking off for time starting at TIME-POS. (fn TIME-POS) (defalias 'utimeclock-last-clock-off-duration #[257 "\3011\"\302!G\\\303\"\304\305!!@\306\307\310\"@!\266\2040\202*\311\312\"\210\310\262\206.\313\207" [utimeclock-time-prefix (debug error) utimeclock-time-point-previous-prefix utimeclock-extract-line-multi last split-string utimeclock-from-sec-total utimeclock-accumulate-line nil message "Error: %S" "unknown"] 9 (#$ . 7063)]) #@105 Time spent (having a break) immediately after clocking on for time starting at TIME-POS. (fn TIME-POS) (defalias 'utimeclock-last-clock-on-duration #[257 "\3021H\303!G\\\304\"\305\306!\307\"\211G\307=\203A\211\242\243\211\242\243\305\306 \"!@\211 Q\310\311\312\"@!\262\262\266\212\202D\266\3130\202P\314\315\"\210\312\262\206T\316\207" [utimeclock-time-prefix utimeclock-time-pair (debug error) utimeclock-time-point-previous-prefix utimeclock-extract-line-multi last split-string 2 utimeclock-from-sec-total utimeclock-accumulate-line nil "started" message "Error: %S" "unknown"] 17 (#$ . 7560)]) #@193 Search for STR, accumulate all times after it, return the accumulated time. Argument COMBINE-ALL-TIMES keeps searching backwards, accumulating all times in the buffer. (fn COMBINE-ALL-TIMES) (defalias 'utimeclock-from-context #[257 "\212\301\210\302 \303\304\"\216\301\305\306\301\204\203N\307 \211\262\203N\301\262\310!G\\\311\"\312?\"\211\242\243\211\203@\306\262\f\n\\\262 \266\211b\210\202\305U?\205b\313!\203`\314\202a\315P\266\204)\262)\207" [utimeclock-time-prefix nil match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data evaporate] 3] 0 t utimeclock-time-point-previous-no-eol utimeclock-time-point-previous-prefix utimeclock-extract-line-multi utimeclock-accumulate-line utimeclock-from-sec-total ".." ""] 16 (#$ . 8189)]) #@87 Return the time before the cursor or contained within the selection (when available). (defalias 'utimeclock-from-context-summary #[0 "\300 \203\214\301 \302 }\210\212db\210\303\304\305\306!\"*\207\305\307!\305\306!\205'\303\310#\207" [use-region-p region-beginning region-end format "(selected %s)" utimeclock-from-context t nil "%s (all %s)"] 6 (#$ . 8977)]) #@200 Clock on/off, declare time ranges from the current time. Add time to the end of the current lines time or search backwards to find one. Otherwise add `utimeclock-time-prefix' and the time after it. (defalias 'utimeclock-toggle #[0 "\304 \305 \306 \307\204`\262\310\261\210\212\311!b\210\312 `=\204%`|\210\210\313 !\2039c\210\314\315\316!\"\210\202R\317 \203E\320!\211c\266\310 \261\210\314\321\322!\"\210\306 =\n\203hi Y\203h\320!\323!\266\211\203o`\262\210)\211\205w\211b\207" [utimeclock-time-prefix utimeclock-time-pair utimeclock-split-at-fill-column fill-column utimeclock-current-time-as-string utimeclock-time-point-previous line-beginning-position nil " " utimeclock-end-of-line-multi line-end-position utimeclock-current-line-ends-with message "Clocked off! [%s]" utimeclock-last-clock-off-duration utimeclock-current-line-empty-p utimeclock-time-point-previous-prefix "Clocked on! [%s]" utimeclock-last-clock-on-duration utimeclock-split-at-point] 8 (#$ . 9350) nil]) #@139 Insert the current time at the cursor. Unlike `utimeclock-toggle' this doesn't pair time ranges or ensure `utimeclock-time-prefix' text. (defalias 'utimeclock-insert #[0 "\303 \211c\210\205&i Y\205&\304 \211\203 \305!\306!\262\202$\307\310\n\"\262\207" [utimeclock-split-at-fill-column fill-column utimeclock-time-prefix utimeclock-current-time-as-string utimeclock-time-point-previous utimeclock-time-point-previous-prefix utimeclock-split-at-point message "Can not split the line %S not found!"] 5 (#$ . 10365) nil]) #@79 Show a summary of the last time and all times combined in the message buffer. (defalias 'utimeclock-show-summary #[0 "\300\301\302 \"\207" [message "Time %S" utimeclock-from-context-summary] 3 (#$ . 10900) nil]) (provide 'utimeclock)