Fix infinite loop in `chronometrist-report` triggered by non-English locale

This commit is contained in:
contrapunctus 2020-11-17 08:28:18 +05:30
parent 4413e93b76
commit 309d651dc9
2 changed files with 7 additions and 4 deletions

View File

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Remove quotes from key-value prompt in quit keybindings * Remove quotes from key-value prompt in quit keybindings
* Lisp objects being stored as un`read`able strings in `chronometrist-value-history`, resulting in value suggestions not matching user input. * Lisp objects being stored as un`read`able strings in `chronometrist-value-history`, resulting in value suggestions not matching user input.
* `chronometrist-report` no longer calls `delete-other-windows`; use `chronometrist-report-mode-hook` if it is desired. * `chronometrist-report` no longer calls `delete-other-windows`; use `chronometrist-report-mode-hook` if it is desired.
* Fixed infinite loop in `chronometrist-report` triggered by non-English locales.
## [0.5.5] - 2020-09-02 ## [0.5.5] - 2020-09-02
### Added ### Added

View File

@ -144,10 +144,12 @@ If the day of TS is the same as the
`chronometrist-report-week-start-day', return TS. `chronometrist-report-week-start-day', return TS.
TS must be a ts struct (see `ts.el')." TS must be a ts struct (see `ts.el')."
(cl-loop until (equal chronometrist-report-week-start-day (cl-loop
(ts-day-name ts)) with week-start =
do (ts-decf (ts-day ts)) (alist-get chronometrist-report-week-start-day chronometrist-report-weekday-number-alist nil nil #'equal)
finally return ts)) until (= week-start (ts-dow ts))
do (ts-decf (ts-day ts))
finally return ts))
(provide 'chronometrist-common) (provide 'chronometrist-common)