Commit Graph

645 Commits

Author SHA1 Message Date
contrapunctus 2042d86549 Reword CHANGELOG entry 2020-06-26 17:01:10 +05:30
contrapunctus 4d9a3e1476 Add the good news to the CHANGELOG 2020-06-26 01:50:18 +05:30
contrapunctus 278f616008 Name new functions consistently 2020-06-26 01:44:52 +05:30
contrapunctus fb7c4940df Optimization - reduce use of chronometrist-tags-history-populate
We now avoid running chronometrist-tags-history-populate for the
chronometrist-sexp-new and the chronometrist-sexp-replace-last
operations.

Clocking in/out is nearly instant now!
2020-06-26 01:15:51 +05:30
contrapunctus 161c9ef547 sexp-replace-last - explain assumption in docstring 2020-06-26 00:39:07 +05:30
contrapunctus 5ed8111936 Merge branch 'dev' into less-reading-v2 2020-06-25 18:35:03 +05:30
contrapunctus db25451b06 Fix bug where pushing a button would always trigger the first task
(prefix-numeric-value nil) => 1, so we were always going to the
first line.
2020-06-25 18:34:06 +05:30
contrapunctus dd7ec40da7 Optimization - reduce use of chronometrist-tasks-from-table
We now avoid running chronometrist-tasks-from-table for the
chronometrist-sexp-new and the chronometrist-sexp-replace-last
operations.

Hurray. Clocking in/out is tangibly faster now.
2020-06-25 18:14:25 +05:30
contrapunctus 5e4854272e Optimization - reduce situations in which events-populate is run
Namely, don't run it when appending an s-expression to the file, nor
when replacing the last s-expression. Instead, we modify the hash
table itself.

I wanted the code which sets chronometrist--inhibit-read-p to t to
also reset it to nil (ideally via `let`), but file watchers seem to
run _after_ the form modifying the file returns. (i.e. after the scope
of `let` ends and the global bindings are restored)

Still uncertain if this really has sped things up, though.
2020-06-25 14:34:12 +05:30
contrapunctus 3905d04226 Add optimization notes 2020-06-25 02:49:48 +05:30
contrapunctus 2470da085d Remove reference to removed local variable
This was causing chronometrist-sexp-last to return nil, and the
ignore-errors was, well, ignoring-errors, resulting in all sorts of
mysterious bugs.

Added a test to prevent it from happening again.
2020-05-28 01:48:24 +05:30
contrapunctus 6c1f5c0272 Reindent ecukes feature definition 2020-05-28 00:59:16 +05:30
contrapunctus 13f66d2409 chronometrist-goals - pass minutes instead of seconds 2020-05-25 03:05:12 +05:30
contrapunctus e234ae5a03 Update docstring to reflect use of ts structs 2020-05-25 03:04:11 +05:30
contrapunctus 868325c4db Fixed prefix arguments not working if point was on a button 2020-05-24 02:08:40 +05:30
contrapunctus 146f21cc2c tags-history-populate - clarify comment and local variable name 2020-05-24 00:00:14 +05:30
contrapunctus c6fb67f74e Resurrect chronometrist-interval
It was used in my configuration, and has the potential to be used in
the program, too.
2020-05-22 10:31:59 +05:30
contrapunctus fdd9cc4a2e chronometrist-report-entries - improve clarity 2020-05-22 09:58:20 +05:30
contrapunctus 3e90db9ac1 Add macro chronometrist-sexp-in-file 2020-05-22 01:14:29 +05:30
contrapunctus da552aa6ac Move source files to elisp/ 2020-05-22 01:13:52 +05:30
contrapunctus a3fca870e3 changelog - note use of ts.el 2020-05-21 09:26:54 +05:30
contrapunctus fc867a4aec Merge branch 'use-ts.el' into dev 2020-05-21 09:13:37 +05:30
contrapunctus b5c5cfd4a2 Update function reference; remove unused functions
Removed
chronometrist-report-format-date
chronometrist-statistics-format-date
chronometrist-interval
2020-05-21 08:48:11 +05:30
contrapunctus b2c7d2763c Reindent cl-loop calls 2020-05-21 01:48:06 +05:30
contrapunctus d8f34d430b Update function reference and docstring
Also, add type information for chronometrist-day-start
2020-05-21 01:45:16 +05:30
contrapunctus 2a6829c0d3 Fix byte compiler errors; add tests for task-time-one-day 2020-05-21 01:44:11 +05:30
contrapunctus c190ced000 Replace time values with integer seconds
1. chronometrist-events->time-list -> chronometrist-events->ts-pairs,
now returns a list of ts pairs. Rewritten using cl-loop.
2. chronometrist-time-list->sum-of-intervals ->
chronometrist-ts-pairs->durations, now returns a list of durations in
integer seconds.
3. A critical bug in chronometrist-iso-timestamp->ts was discovered -
we were passing the output of encode-time (via
parse-iso8601-time-string) to (make-ts :unix ...) - the latter expects
a number, not a list.
4. Both chronometrist-task-time-one-day and
chronometrist-events->ts-pairs were checking if a task was still
ongoing. Removed the redundant checking from the former.
5. Updated docstring of chronometrist-active-time-one-day
6. chronometrist-statistics-count-average-time-spent rewritten using
cl-loop

Also, when trying to write tests, I realized that
chronometrist-events-clean has long been removed. Removed a reference
to it from the manual and a docstring.
2020-05-20 16:45:29 +05:30
contrapunctus 38eba669ec manual - convert time type table to Org tree 2020-05-20 03:25:42 +05:30
contrapunctus f80cbeaaa7 Remove non-user-facing uses of integer minutes as duration type
Remove
chronometrist-task-minutes-one-day
chronometrist-minutes-string

Rename
chronometrist-minutes->alert-string -> chronometrist-seconds->alert-string
2020-05-19 16:09:14 +05:30
contrapunctus 98627c12f6 Rename tests for renamed function iso-date->ts 2020-05-19 15:33:42 +05:30
contrapunctus 0c05c431f5 Remove unused function; update time format reference 2020-05-19 15:05:31 +05:30
contrapunctus 349a260089 Merge branch 'use-ts.el' of github.com:contrapunctus-1/chronometrist into use-ts.el 2020-05-18 04:16:00 +05:30
contrapunctus a09058dcfd Change return values of seconds-to-hms and format-time
seconds-to-hms now returns a list instead of a vector.
chronometrist-format-time now takes integer seconds instead of lists
or vectors.

manual - remove types which are no longer used

Removed unused functions
chronometrist-time-interval-span-midnight?
chronometrist-time-add
2020-05-18 04:15:23 +05:30
contrapunctus 9c7128b1e9 Change return values of seconds-to-hms and format-time
seconds-to-hms now returns a list instead of a vector.
chronometrist-format-time now takes integer seconds instead of lists
or vectors.

manual - remove types which are no longer used

Removed unused functions
chronometrist-time-interval-span-midnight?
chronometrist-time-add
2020-05-18 04:01:18 +05:30
contrapunctus 14337d5268 task-time-one-day - clarify code 2020-05-18 03:49:16 +05:30
contrapunctus b6c9337a42 Remove 3 unused functions
Removed
chronometrist-time->seconds
chronometrist-date->time
chronometrist-date-less-p
2020-05-18 00:18:47 +05:30
contrapunctus e04cb19be6 Fix previous/next scrolling bug introduced in 7bf6750 2020-05-17 23:58:07 +05:30
contrapunctus 3f2fc0f662 Remove 3 unused definitions 2020-05-17 22:17:26 +05:30
contrapunctus 99fab0f92e Migrate statistics to ts.el
Removed - chronometrist-calendrical->date
2020-05-17 22:01:00 +05:30
contrapunctus 7bf6750c21 Migrate report to use ts.el 2020-05-17 20:40:36 +05:30
contrapunctus d744268392 print-non-tabular, report-print-non-tabular - reindent code
It was much too spaced out, for no benefit I could perceive.

Also, we remove the interactive spec from query-stop. There's no need
for it to appear in the execute-extended-command menu.
2020-05-17 16:50:28 +05:30
contrapunctus 99ee0acfc3 Fix task-events-in-day to work with TS
Changing chronometrist-date requires changing task-events-in-day,
because the latter expected "YYYY-MM-DD" and chronometrist-date was
used to provide that.
2020-05-17 14:13:30 +05:30
contrapunctus c85fab197b Merge branch 'dev' into use-ts.el 2020-05-17 12:55:38 +05:30
contrapunctus ff10ff9b32 Use cl-defun + default values where applicable 2020-05-17 12:17:51 +05:30
contrapunctus e7c0eb055d Rewrite chronometrist-date to use ts.el
Rename chronometrist-make-ts-date to chronometrist-iso-timestamp->ts
2020-05-17 10:40:51 +05:30
contrapunctus 93097a5a85 manual - remove recently removed unused function 2020-05-17 09:54:23 +05:30
contrapunctus fd4dc7008b Create make-ts-date
The tests for previous-week-start now pass.
2020-05-17 09:49:14 +05:30
contrapunctus 666d9e0726 Reimplement some functions using ts
Sadly, it didn't go so well - pretty challenging, lots of debugging,
and plenty of tests failing. Left them some feedback -
https://github.com/alphapapa/ts.el/issues/11
2020-05-16 21:40:20 +05:30
contrapunctus 96f79a7f37 Use cl-defun + default values where applicable 2020-05-16 10:09:26 +05:30
contrapunctus 958551d498 Address nearly all byte compiler warnings
For the time being, we use a consistent pattern of packages requiring
sexp.el instead of the other way round.

chronometrist-current-task has been moved back to chronometrist-common
2020-05-16 08:35:54 +05:30