* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
@ 2020-09-28 1:18 Aaron Zeng
2020-09-30 2:50 ` Lars Ingebrigtsen
2020-09-30 9:42 ` Mattias Engdegård
0 siblings, 2 replies; 13+ messages in thread
From: Aaron Zeng @ 2020-09-28 1:18 UTC (permalink / raw)
To: 43677
Hello,
I observe the following incorrect behavior starting from `emacs -Q`:
1. M-x calc
2. ' <2020-11-01> RET --- displays "<Sun Nov 1, 2020>"
3. 1 t - --- should have subtracted one business day, but it displays
"<Sat Oct 31, 2020>" instead of "<Fri Oct 30, 2020>"
Adding a business day to Saturday gives Tuesday instead of Monday. It
seems like this is would be an off-by-one error. This appears to be
confirmed by setting the Holidays vector in calc (`s e Holidays`) to
be `[fri, sat]` and trying the above procedure again.
After applying the workaround, instead of seeing Saturday and Tuesday
as the previous and next business days, respectively, I see Friday and
Monday as I would expect.
In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.21,
cairo version 1.16.0)
Windowing system distributor 'Colin Harrison', version 11.0.60900031
System Description: NixOS 20.03 (Markhor)
Recent messages:
When done with a buffer, type , c
Type , c to finish, , k to cancel, and M-p and M-n to recover older messages
Auto-saving...done
Saving file /home/aaron/todo/.git/COMMIT_EDITMSG...
Wrote /home/aaron/todo/.git/COMMIT_EDITMSG
Git finished
Running git push -v origin refs/heads/master:refs/heads/master
Git finished
line-move-visual: End of buffer [10 times]
Quit [3 times]
Quit
Configured using:
'configure
--prefix=/nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1
--disable-build-details --with-modules --with-x-toolkit=gtk3
--with-xft --with-cairo CFLAGS=-DMAC_OS_X_VERSION_MAX_ALLOWED=101200'
Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD
JSON PDUMPER GMP
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Org
Minor modes in effect:
evil-org-mode: t
org-superstar-mode: t
org-indent-mode: t
global-evil-surround-mode: t
evil-surround-mode: t
Info-breadcrumbs-in-mode-line-mode: t
eval-sexp-fu-flash-mode: t
global-magit-file-mode: t
magit-file-mode: t
global-git-commit-mode: t
async-bytecomp-package-mode: t
company-mode: t
flycheck-pos-tip-mode: t
global-flycheck-mode: t
show-smartparens-global-mode: t
show-smartparens-mode: t
yas-global-mode: t
yas-minor-mode: t
global-vi-tilde-fringe-mode: t
vi-tilde-fringe-mode: t
evil-escape-mode: t
global-display-line-numbers-mode: t
projectile-mode: t
recentf-mode: t
mode-line-bell-mode: t
indent-guide-global-mode: t
indent-guide-mode: t
global-column-enforce-mode: t
dired-async-mode: t
winner-mode: t
global-spacemacs-whitespace-cleanup-mode: t
spacemacs-whitespace-cleanup-mode: t
winum-mode: t
pupo-mode: t
save-place-mode: t
savehist-mode: t
persp-mode: t
global-ligature-mode: t
ligature-mode: t
ivy-rich-mode: t
global-hl-todo-mode: t
global-fasd-mode: t
purpose-mode: t
eyebrowse-mode: t
global-anzu-mode: t
anzu-mode: t
editorconfig-mode: t
counsel-mode: t
ivy-mode: t
clean-aindent-mode: t
hybrid-mode: t
which-key-mode: t
override-global-mode: t
global-undo-tree-mode: t
undo-tree-mode: t
flyspell-mode: t
shell-dirtrack-mode: t
evil-mode: t
evil-local-mode: t
spacemacs-leader-override-mode: t
global-spacemacs-leader-override-mode: t
global-hl-line-mode: t
xterm-mouse-mode: t
global-auto-revert-mode: t
minibuffer-depth-indicate-mode: t
midnight-mode: t
display-time-mode: t
ido-vertical-mode: t
global-page-break-lines-mode: t
page-break-lines-mode: t
global-eldoc-mode: t
eldoc-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
auto-fill-function: yas--auto-fill
transient-mark-mode: t
Load-path shadows:
/home/aaron/.emacs.d/elpa/27.1/develop/magit-section-20200908.1021/magit-section
hides /home/aaron/.emacs.d/elpa/27.1/develop/magit-20200913.2013/magit-section
/home/aaron/.emacs.d/elpa/27.1/develop/dash-20200803.1520/dash hides
/home/aaron/.emacs.d/core/libs/dash
/home/aaron/.emacs.d/elpa/27.1/develop/ht-20200217.2331/ht hides
/home/aaron/.emacs.d/core/libs/ht
/run/current-system/sw/share/emacs/site-lisp/site-start hides
/nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/site-lisp/site-start
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-id
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-id
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-tempo
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-tempo
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-clock
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-clock
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-table
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-table
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-sqlite
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-sqlite
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-eww
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-eww
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-css
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-css
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-inlinetask
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-inlinetask
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-org
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-org
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-timer
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-timer
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-eshell
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-eshell
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-duration
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-duration
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-protocol
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-protocol
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-latex
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-latex
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-stan
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-stan
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-datetree
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-datetree
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-agenda
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-agenda
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-lint
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-lint
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-scheme
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-scheme
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-sass
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-sass
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-element
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-element
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-beamer
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-beamer
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-sed
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-sed
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-compat
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-compat
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-bibtex
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-bibtex
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-latex
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-latex
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-pcomplete
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-pcomplete
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-goto
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-goto
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-lua
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-lua
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-asymptote
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-asymptote
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-entities
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-entities
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-ascii
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-ascii
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-info
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-info
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-lilypond
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-lilypond
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-vala
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-vala
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-attach
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-attach
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-io
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-io
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-screen
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-screen
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-lisp
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-lisp
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-table
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-table
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-loaddefs
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-loaddefs
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-haskell
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-haskell
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-ruby
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-ruby
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-mouse
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-mouse
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-sql
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-sql
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-eshell
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-eshell
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-ditaa
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-ditaa
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-md
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-md
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-matlab
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-matlab
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-picolisp
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-picolisp
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-python
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-python
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-gnus
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-gnus
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-publish
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-publish
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-plot
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-plot
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-groovy
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-groovy
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-src
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-src
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-eval
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-eval
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-clojure
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-clojure
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-feed
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-feed
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-dot
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-dot
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-html
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-html
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-J
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-J
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-macro
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-macro
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-colview
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-colview
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-odt
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-odt
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-texinfo
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-texinfo
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-fortran
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-fortran
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-w3m
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-w3m
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-footnote
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-footnote
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-list
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-list
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-hledger
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-hledger
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-bbdb
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-bbdb
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-org
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-org
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-mhe
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-mhe
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-docview
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-docview
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-R
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-R
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-shen
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-shen
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-calc
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-calc
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-num
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-num
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-ocaml
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-ocaml
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-macs
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-macs
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-core
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-core
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-ledger
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-ledger
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-makefile
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-makefile
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-plantuml
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-plantuml
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-lob
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-lob
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-perl
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-perl
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-mscgen
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-mscgen
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-comint
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-comint
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-ref
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-ref
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-coq
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-coq
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-crypt
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-crypt
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-mobile
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-mobile
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-ctags
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-ctags
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-icalendar
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-icalendar
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-octave
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-octave
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-abc
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-abc
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-gnuplot
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-gnuplot
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-processing
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-processing
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-capture
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-capture
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-awk
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-awk
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-exp
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-exp
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-install
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-install
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-js
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-js
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-forth
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-forth
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-ebnf
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-ebnf
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-habit
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-habit
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-shell
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-shell
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-faces
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-faces
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-java
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-java
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-version
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-version
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-keys
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-keys
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-attach-git
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-attach-git
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-tangle
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-tangle
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-maxima
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-maxima
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-emacs-lisp
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-emacs-lisp
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ob-C
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ob-C
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-irc
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-irc
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-indent
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-indent
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/org-archive
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/org-archive
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ol-rmail
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ol-rmail
/home/aaron/.emacs.d/elpa/27.1/develop/org-plus-contrib-20200921/ox-man
hides /nix/store/afbpyhbafbc0rhl54h86wcsvnpprygfb-emacs-27.1/share/emacs/27.1/lisp/org/ox-man
Features:
(shadow cl-print debug calc-map calc-stat hippie-exp emacsbug sendmail
pulse calc-store calc-undo calc-vec calc-prog ox-texinfo ox-org ox-md
ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox calc-forms
evil-iedit-state mail-extr skeleton shell-pop company-web-html
company-web company-css web-completion-data emmet-mode
smartparens-html web-mode dune link-hint nix-mode nix-repl nix-shell
nix-store nix-instantiate nix-shebang nix-format nix sort
magit-bookmark bookmark org-projectile org-category-capture
org-capture calc-arith calccomp calc-misc font-utils magit-extras
make-mode dired-x eieio-opt evil-matchit-ocaml evil-matchit-simple
evil-matchit evil-matchit-sdk counsel-projectile term/rxvt term/xterm
xterm cua-base calc-aent calc-yank calc-alg calc-menu tabify cal-move
ledger-mode ledger-check ledger-texi ledger-test ledger-sort
ledger-report ledger-reconcile ledger-occur ledger-fonts
ledger-fontify ledger-state ledger-complete ledger-schedule
ledger-init ledger-xact ledger-post ledger-exec ledger-navigate
ledger-context ledger-commodities ledger-regex misearch multi-isearch
calc-embed calc-ext calc calc-loaddefs calc-macs mule-util diary-lib
diary-loaddefs cal-iso scheme org-eldoc bcc32-org evil-org ob-C
smartparens-c cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs ob-js ob-perl ob-python
smartparens-python python tramp-sh ob-sql ob-shell org-download
org-attach org-id org-superstar toc-org org-indent image-file
org-element avl-tree ol-man org-checklist ol-eshell eshell-z em-dirs
esh-var em-term term ehelp em-smart esh-mode eshell esh-cmd esh-ext
esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
org-tempo tempo ol-info org-habit ol-docview doc-view image-mode exif
ol-bibtex bibtex org-agenda org-refile smartparens-org org-clock orgit
org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote
org-src ob-comint org-pcomplete org-list org-faces org-entities
org-version ob-emacs-lisp ob-core ob-eval org-table org-keys
org-loaddefs cal-menu calendar cal-loaddefs ol org-compat org-macs
evil-surround company-shell flycheck-bashate sh-script executable ffap
tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat
parse-time iso8601 ls-lisp jka-compr info+ pp company-capf overseer
pkg-info url-http url url-proxy url-privacy url-expand url-methods
url-history mailcap url-auth url-cookie url-domsuf url-util url-gw nsm
epl auto-compile packed elisp-slime-nav flycheck-elsa flycheck-package
package-lint finder eval-sexp-fu helpful trace edebug backtrace
info-look dash-functional elisp-refs smex magit-gitflow face-remap
evil-magit git-rebase magit-submodule magit-obsolete magit-popup
magit-blame magit-stash magit-reflog magit-bisect magit-push
magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode magit-core magit-autorevert magit-margin magit-transient
magit-process magit-mode git-commit transient magit-git magit-section
magit-utils log-edit message rmc puny rfc822 mml mml-sec epa gnus-util
rmail rmail-loaddefs text-property-search time-date mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log with-editor
async-bytecomp ocamlformat whitespace vc-git diff-mode company-files
company-keywords company-etags etags fileloop generator company-gtags
company-dabbrev-code company-dabbrev company-semantic company-template
merlin-company company merlin-eldoc merlin-imenu flycheck-ocaml
merlin-cap merlin crm ocp-indent utop utop-minor-mode goto-addr
bug-reference auto-highlight-symbol evil-lisp-state flycheck-pos-tip
pos-tip flycheck-ledger flycheck find-func highlight-numbers
parent-mode highlight-parentheses hideshow rainbow-delimiters
smartparens-config smartparens-ml smartparens-text smartparens
yasnippet-snippets yasnippet tuareg speedbar sb-image ezimage dframe
tuareg-opam flymake-proc flymake smie caml-help caml-types caml-emacs
find-file editorconfig-core editorconfig-core-handle
editorconfig-fnmatch zoom-frm frame-cmds frame-fns avoid
vi-tilde-fringe diminish evil-escape display-line-numbers disp-table
projectile grep recentf tree-widget mode-line-bell indent-guide
column-enforce-mode fancy-battery battery dired-async async dired-aux
winner server xterm-color spacemacs-whitespace-cleanup ws-butler winum
spacemacs-purpose-popwin window-purpose-x imenu-list imenu ibuf-ext
ibuffer ibuffer-loaddefs unicode-fonts symbol-overlay
string-inflection spaceline-config spaceline-segments spaceline
powerline powerline-separators powerline-themes saveplace savehist
popwin persp-mode org-rich-yank merlin-iedit iedit iedit-lib
multiple-cursors-core ligature ivy-rich ivy-hydra ivy-avy avy hl-todo
fasd window-purpose window-purpose-fixes
window-purpose-prefix-overload window-purpose-switch let-alist
window-purpose-layout window-purpose-core window-purpose-configuration
window-purpose-utils eyebrowse evil-unimpaired f evil-textobj-line
evil-anzu anzu emr popup s editorconfig noutline outline counsel xdg
xref project dired dired-loaddefs compile swiper ivy flx delsel
ivy-faces ivy-overlay colir color clean-aindent-mode clang-format xml
cl hybrid-mode evil-evilified-state which-key use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key use-package-core hydra lv cus-edit evil
evil-keybindings evil-integration undo-tree diff evil-maps
evil-commands reveal flyspell ispell evil-jumps evil-command-window
evil-types evil-search evil-ex shell pcomplete comint ansi-color
evil-macros evil-repeat evil-states evil-core evil-common windmove
thingatpt rect evil-digraphs evil-vars ring bind-map quelpa mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr lisp-mnt help-fns radix-tree hl-line xt-mouse
autorevert filenotify cl-extra wid-edit base16-material-theme
base16-theme format-spec info finder-inf mb-depth midnight time
cus-start cus-load ido-vertical-mode ido core-spacemacs core-spacebind
core-use-package-ext core-transient-state core-micro-state core-toggle
core-keybindings core-fonts-support core-themes-support
core-display-init core-jump core-release-management
core-custom-settings core-configuration-layer eieio-compat
core-progress-bar core-spacemacs-buffer core-funcs ht dash help-mode
warnings package browse-url url-handlers url-parse auth-source cl-seq
password-cache json map url-vars eieio eieio-core eieio-loaddefs epg
epg-config core-command-line pcase core-debug edmacro kmacro derived
cl-macs profiler easymenu cl-loaddefs cl-lib core-hooks
page-break-lines easy-mmode core-env load-env-vars rx
core-dotspacemacs advice core-emacs-backports core-dumper subr-x seq
byte-opt gv bytecomp byte-compile cconv tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese
eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese composite charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)
Memory information:
((conses 16 2463178 2188195)
(symbols 48 263811 35)
(strings 32 617131 174299)
(string-bytes 1 26918019)
(vectors 16 132846)
(vector-slots 8 2935185 1278064)
(floats 8 1621 9719)
(intervals 56 146727 145044)
(buffers 1000 550))
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-28 1:18 bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation Aaron Zeng
@ 2020-09-30 2:50 ` Lars Ingebrigtsen
2020-09-30 8:55 ` Robert Pluim
2020-09-30 9:42 ` Mattias Engdegård
1 sibling, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-30 2:50 UTC (permalink / raw)
To: Aaron Zeng; +Cc: 43677
Aaron Zeng <zeng.aaron.l@gmail.com> writes:
> I observe the following incorrect behavior starting from `emacs -Q`:
>
> 1. M-x calc
> 2. ' <2020-11-01> RET --- displays "<Sun Nov 1, 2020>"
> 3. 1 t - --- should have subtracted one business day, but it displays
> "<Sat Oct 31, 2020>" instead of "<Fri Oct 30, 2020>"
>
> Adding a business day to Saturday gives Tuesday instead of Monday. It
> seems like this is would be an off-by-one error. This appears to be
> confirmed by setting the Holidays vector in calc (`s e Holidays`) to
> be `[fri, sat]` and trying the above procedure again.
>
> After applying the workaround, instead of seeing Saturday and Tuesday
> as the previous and next business days, respectively, I see Friday and
> Monday as I would expect.
Indeed -- applying the following patch (which numbers Monday as 0 and
Sunday as 6) makes the test case work correctly for me. But trying to
follow the code makes it unclear... er... what's going on, and there
aren't many comments in the Calc code to explain what they were
thinking.
I wondered whether this might be a US/non-US thing (with a difference in
what day starts the week), but I couldn't really find anything in calc
talking about that...
Does anybody have any insight here?
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index 5a8f0a38d2..5d3629ea0a 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -1928,8 +1928,8 @@ math-sh-year
(defun math-setup-holidays (&optional date)
(or (eq (calc-var-value 'var-Holidays) math-holidays-cache-tag)
(let ((h (calc-var-value 'var-Holidays))
- (wdnames '( (sun . 0) (mon . 1) (tue . 2) (wed . 3)
- (thu . 4) (fri . 5) (sat . 6) ))
+ (wdnames '( (mon . 0) (tue . 1) (wed . 2)
+ (thu . 3) (fri . 4) (sat . 5) (sun . 6) ))
(days nil) (weekdays nil) (exprs nil) (limit nil) (hours nil))
(or (math-vectorp h)
(math-reject-arg h "*Holidays variable must be a vector"))
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply related [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-30 2:50 ` Lars Ingebrigtsen
@ 2020-09-30 8:55 ` Robert Pluim
0 siblings, 0 replies; 13+ messages in thread
From: Robert Pluim @ 2020-09-30 8:55 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Aaron Zeng, 43677
>>>>> On Wed, 30 Sep 2020 04:50:25 +0200, Lars Ingebrigtsen <larsi@gnus.org> said:
Lars> Indeed -- applying the following patch (which numbers Monday as 0 and
Lars> Sunday as 6) makes the test case work correctly for me. But trying to
Lars> follow the code makes it unclear... er... what's going on, and there
Lars> aren't many comments in the Calc code to explain what they were
Lars> thinking.
Lars> I wondered whether this might be a US/non-US thing (with a difference in
Lars> what day starts the week), but I couldn't really find anything in calc
Lars> talking about that...
Lars> Does anybody have any insight here?
Sunday is the first day of the week in the US and in France (and
others, probably). Monday is the first *business* day of the week,
which I think is what's important here.
Robert
--
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-28 1:18 bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation Aaron Zeng
2020-09-30 2:50 ` Lars Ingebrigtsen
@ 2020-09-30 9:42 ` Mattias Engdegård
2020-09-30 13:40 ` Lars Ingebrigtsen
1 sibling, 1 reply; 13+ messages in thread
From: Mattias Engdegård @ 2020-09-30 9:42 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Aaron Zeng, 43677
> Indeed -- applying the following patch (which numbers Monday as 0 and Sunday as 6) makes the test case work correctly for me. But trying to follow the code makes it unclear... er... what's going on, and there aren't many comments in the Calc code to explain what they were thinking.
Welcome to Calc!
> I wondered whether this might be a US/non-US thing (with a difference in what day starts the week), but I couldn't really find anything in calc talking about that...
The weekday numbering can be arbitrary as long as it is only used internally. Calc's date representation (from Rata Die) sets Dec 31, 1 B.C. as day 0, and this happens to be a Sunday. That means that (mod DAY 7) is an easy way to get the week-starts-on-Sunday numbering used by some foreigners.
Since the bug is a regression -- it is present in Emacs 26.1 but not in 22.1.1 -- it may be a good idea to find out exactly what change introduced it, and work from there. That might reduce the risk of causing secondary bugs.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-30 9:42 ` Mattias Engdegård
@ 2020-09-30 13:40 ` Lars Ingebrigtsen
2020-09-30 15:52 ` Glenn Morris
2020-09-30 16:12 ` Mattias Engdegård
0 siblings, 2 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-30 13:40 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: Aaron Zeng, 43677
Mattias Engdegård <mattiase@acm.org> writes:
> Since the bug is a regression -- it is present in Emacs 26.1 but not
> in 22.1.1 -- it may be a good idea to find out exactly what change
> introduced it, and work from there. That might reduce the risk of
> causing secondary bugs.
That's quite a stretch to be bisecting, though... What's the best test
function here?
(require 'calc-forms)
(math-from-business-day 526951)
=> (date 737732)
while it should be 737731?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-30 13:40 ` Lars Ingebrigtsen
@ 2020-09-30 15:52 ` Glenn Morris
2020-09-30 16:22 ` Lars Ingebrigtsen
2020-09-30 16:12 ` Mattias Engdegård
1 sibling, 1 reply; 13+ messages in thread
From: Glenn Morris @ 2020-09-30 15:52 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Aaron Zeng, Mattias Engdegård, 43677
Emacs 24.3 = good, Emacs 24.4 = bad
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-30 13:40 ` Lars Ingebrigtsen
2020-09-30 15:52 ` Glenn Morris
@ 2020-09-30 16:12 ` Mattias Engdegård
2020-09-30 16:23 ` Lars Ingebrigtsen
2020-10-01 10:19 ` Mattias Engdegård
1 sibling, 2 replies; 13+ messages in thread
From: Mattias Engdegård @ 2020-09-30 16:12 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Aaron Zeng, 43677
30 sep. 2020 kl. 15.40 skrev Lars Ingebrigtsen <larsi@gnus.org>:
> That's quite a stretch to be bisecting, though...
Bisecting is logarithmic so large stretches are seldom a problem. You can also bisect restricted to one path which reduces the number of versions dramatically. (Building old versions of Emacs, on the other hand -- that can be messy!)
But you don't have to! I found it. The error was introduced in the calendar changes between c9f618db441 and fd1f1603a4f, during which the internal date numbering changed: date Jan 1, 1 AD went from date 0 to 1. However, the business days code remained unchanged and thus started getting the weekdays wrong.
Of course there were no tests but that is excusable since this was 2012 and tests weren't invented back then.
I'll put together a patch a little later today or tomorrow.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-30 15:52 ` Glenn Morris
@ 2020-09-30 16:22 ` Lars Ingebrigtsen
2020-09-30 16:31 ` Andreas Schwab
0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-30 16:22 UTC (permalink / raw)
To: Glenn Morris; +Cc: Aaron Zeng, Mattias Engdegård, 43677
Glenn Morris <rgm@gnu.org> writes:
> Emacs 24.3 = good, Emacs 24.4 = bad
Emacs 24.3 doesn't build for me here (Debian bullseye), which makes it
difficult to bisect...
Urr...
git log refs/tags/emacs-24.3..refs/tags/emacs-24.4
gives me a range back to 2009? Surely that can't be right? 24.3 was
released in 2013...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-30 16:12 ` Mattias Engdegård
@ 2020-09-30 16:23 ` Lars Ingebrigtsen
2020-10-01 10:19 ` Mattias Engdegård
1 sibling, 0 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-30 16:23 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: Aaron Zeng, 43677
Mattias Engdegård <mattiase@acm.org> writes:
> Bisecting is logarithmic so large stretches are seldom a problem.
log hugenumber is still a lot bigger than log smallnumber. :-)
> Of course there were no tests but that is excusable since this was
> 2012 and tests weren't invented back then.
:-)
> I'll put together a patch a little later today or tomorrow.
Great!
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-30 16:22 ` Lars Ingebrigtsen
@ 2020-09-30 16:31 ` Andreas Schwab
0 siblings, 0 replies; 13+ messages in thread
From: Andreas Schwab @ 2020-09-30 16:31 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Aaron Zeng, Glenn Morris, 43677, Mattias Engdegård
On Sep 30 2020, Lars Ingebrigtsen wrote:
> Urr...
>
> git log refs/tags/emacs-24.3..refs/tags/emacs-24.4
>
> gives me a range back to 2009? Surely that can't be right? 24.3 was
> released in 2013...
You also get all side branches that were branched before 24.3. But you
cannot trust the commit dates. The date in the changelog has 2012.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-09-30 16:12 ` Mattias Engdegård
2020-09-30 16:23 ` Lars Ingebrigtsen
@ 2020-10-01 10:19 ` Mattias Engdegård
2020-10-01 22:47 ` Aaron Zeng
1 sibling, 1 reply; 13+ messages in thread
From: Mattias Engdegård @ 2020-10-01 10:19 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Aaron Zeng, 43677
[-- Attachment #1: Type: text/plain, Size: 411 bytes --]
Aaron, does this patch solve your problem?
It turned out that the ability to select arbitrary holiday weekdays never really worked correctly; the patch attempts to do something about that as well.
The business days code also doesn't work at all very well for BC dates, which of course limits its applicability somewhat but perhaps not critically so. Please tell me if that is something you need fixed.
[-- Attachment #2: 0001-Calc-fix-business-days-calculation-bug43677.patch --]
[-- Type: application/octet-stream, Size: 6946 bytes --]
From 802089648160a91876f471c17a400b84b465ce5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Wed, 30 Sep 2020 23:57:27 +0200
Subject: [PATCH] Calc: fix business days calculation (bug43677)
The calculation of business days was broken in 2012 (probably
310e60d9454fe2 or thereabouts) when the date representation changed
epoch so that Jan 1, 1 AD became day number 1 instead of 0. Repair
this, along with an unrelated bug that prevented arbitrary holiday
weekdays from working.
* lisp/calc/calc-forms.el (math-to-business-day)
(math-from-business-day): Correct calculation of weekdays using Calc's
current (Rata Die) chronology. Modify loop condition to cope with odd
sets of holiday weekdays.
* test/lisp/calc/calc-tests.el (calc-business-days): New test.
---
lisp/calc/calc-forms.el | 13 +++---
test/lisp/calc/calc-tests.el | 76 ++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+), 6 deletions(-)
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index 5a8f0a38d2..6d70126c09 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -1870,8 +1870,8 @@ math-to-business-day
(and days (= day (car days))
(setq holiday t)))
(let* ((weekdays (nth 3 math-holidays-cache))
- (weeks (1- (/ (+ day 6) 7)))
- (wkday (- day 1 (* weeks 7))))
+ (weeks (/ day 7))
+ (wkday (mod day 7))) ; Day of week: 0=Sunday, 6=Saturday
(setq delta (+ delta (* weeks (length weekdays))))
(while (and weekdays (< (car weekdays) wkday))
(setq weekdays (cdr weekdays)
@@ -1905,14 +1905,15 @@ math-from-business-day
(setq delta (1+ delta)))
(setq day (+ day delta)))
(let* ((weekdays (nth 3 math-holidays-cache))
- (bweek (- 7 (length weekdays)))
- (weeks (1- (/ (+ day (1- bweek)) bweek)))
- (wkday (- day 1 (* weeks bweek)))
+ (bweek (- 7 (length weekdays))) ; Business days in a week, 1..7.
+ (weeks (/ day bweek)) ; Whole weeks.
+ (wkday (mod day bweek)) ; Business day in last week, 0..bweek-1
(w 0))
(setq day (+ day (* weeks (length weekdays))))
+ ;; Add business days in the last week; `w' is weekday, 0..6.
(while (if (memq w weekdays)
(setq day (1+ day))
- (> (setq wkday (1- wkday)) 0))
+ (>= (setq wkday (1- wkday)) 0))
(setq w (1+ w)))
(let ((hours (nth 7 math-holidays-cache)))
(if hours
diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el
index dce82b6f53..4dded007f7 100644
--- a/test/lisp/calc/calc-tests.el
+++ b/test/lisp/calc/calc-tests.el
@@ -458,6 +458,82 @@ calc-choose
(calcFunc-choose '(frac -15 2) 3))
(calc-tests--choose -7.5 3))))
+(ert-deftest calc-business-days ()
+ (cl-flet ((m (s) (math-parse-date s))
+ (b+ (a b) (calcFunc-badd a b))
+ (b- (a b) (calcFunc-bsub a b)))
+ ;; Sanity check.
+ (should (equal (m "2020-09-07") '(date 737675)))
+
+ ;; Test with standard business days (Mon-Fri):
+ (should (equal (b+ (m "2020-09-07") 1) (m "2020-09-08"))) ; Mon->Tue
+ (should (equal (b+ (m "2020-09-08") 1) (m "2020-09-09"))) ; Tue->Wed
+ (should (equal (b+ (m "2020-09-09") 1) (m "2020-09-10"))) ; Wed->Thu
+ (should (equal (b+ (m "2020-09-10") 1) (m "2020-09-11"))) ; Thu->Fri
+ (should (equal (b+ (m "2020-09-11") 1) (m "2020-09-14"))) ; Fri->Mon
+
+ (should (equal (b+ (m "2020-09-07") 4) (m "2020-09-11"))) ; Mon->Fri
+ (should (equal (b+ (m "2020-09-07") 6) (m "2020-09-15"))) ; Mon->Tue
+
+ (should (equal (b+ (m "2020-09-12") 1) (m "2020-09-14"))) ; Sat->Mon
+ (should (equal (b+ (m "2020-09-13") 1) (m "2020-09-14"))) ; Sun->Mon
+
+ (should (equal (b- (m "2020-09-11") 1) (m "2020-09-10"))) ; Fri->Thu
+ (should (equal (b- (m "2020-09-10") 1) (m "2020-09-09"))) ; Thu->Wed
+ (should (equal (b- (m "2020-09-09") 1) (m "2020-09-08"))) ; Wed->Tue
+ (should (equal (b- (m "2020-09-08") 1) (m "2020-09-07"))) ; Tue->Mon
+ (should (equal (b- (m "2020-09-07") 1) (m "2020-09-04"))) ; Mon->Fri
+
+ (should (equal (b- (m "2020-09-11") 4) (m "2020-09-07"))) ; Fri->Mon
+ (should (equal (b- (m "2020-09-15") 6) (m "2020-09-07"))) ; Tue->Mon
+
+ (should (equal (b- (m "2020-09-12") 1) (m "2020-09-11"))) ; Sat->Fri
+ (should (equal (b- (m "2020-09-13") 1) (m "2020-09-11"))) ; Sun->Fri
+
+ ;; Stepping fractional days
+ (should (equal (b+ (m "2020-09-08 21:00") '(frac 1 2))
+ (m "2020-09-09 09:00")))
+ (should (equal (b+ (m "2020-09-11 21:00") '(frac 1 2))
+ (m "2020-09-14 09:00")))
+ (should (equal (b- (m "2020-09-08 21:00") '(frac 1 2))
+ (m "2020-09-08 09:00")))
+ (should (equal (b- (m "2020-09-14 06:00") '(frac 1 2))
+ (m "2020-09-11 18:00")))
+
+ ;; Test with a couple of extra days off:
+ (let ((var-Holidays (list 'vec
+ '(var sat var-sat) '(var sun var-sun)
+ (m "2020-09-09") (m "2020-09-11"))))
+
+ (should (equal (b+ (m "2020-09-07") 1) (m "2020-09-08"))) ; Mon->Tue
+ (should (equal (b+ (m "2020-09-08") 1) (m "2020-09-10"))) ; Tue->Thu
+ (should (equal (b+ (m "2020-09-10") 1) (m "2020-09-14"))) ; Thu->Mon
+ (should (equal (b+ (m "2020-09-14") 1) (m "2020-09-15"))) ; Mon->Tue
+ (should (equal (b+ (m "2020-09-15") 1) (m "2020-09-16"))) ; Tue->Wed
+
+ (should (equal (b- (m "2020-09-16") 1) (m "2020-09-15"))) ; Wed->Tue
+ (should (equal (b- (m "2020-09-15") 1) (m "2020-09-14"))) ; Tue->Mon
+ (should (equal (b- (m "2020-09-14") 1) (m "2020-09-10"))) ; Mon->Thu
+ (should (equal (b- (m "2020-09-10") 1) (m "2020-09-08"))) ; Thu->Tue
+ (should (equal (b- (m "2020-09-08") 1) (m "2020-09-07"))) ; Tue->Mon
+ )
+
+ ;; Test with odd non-business weekdays (Tue, Wed, Sat):
+ (let ((var-Holidays '(vec (var tue var-tue)
+ (var wed var-wed)
+ (var sat var-sat))))
+ (should (equal (b+ (m "2020-09-07") 1) (m "2020-09-10"))) ; Mon->Thu
+ (should (equal (b+ (m "2020-09-10") 1) (m "2020-09-11"))) ; Thu->Fri
+ (should (equal (b+ (m "2020-09-11") 1) (m "2020-09-13"))) ; Fri->Sun
+ (should (equal (b+ (m "2020-09-13") 1) (m "2020-09-14"))) ; Sun->Mon
+
+ (should (equal (b- (m "2020-09-14") 1) (m "2020-09-13"))) ; Mon->Sun
+ (should (equal (b- (m "2020-09-13") 1) (m "2020-09-11"))) ; Sun->Fri
+ (should (equal (b- (m "2020-09-11") 1) (m "2020-09-10"))) ; Fri->Thu
+ (should (equal (b- (m "2020-09-10") 1) (m "2020-09-07"))) ; Thu->Mon
+ )
+ ))
+
(provide 'calc-tests)
;;; calc-tests.el ends here
--
2.21.1 (Apple Git-122.3)
[-- Attachment #3: Type: text/plain, Size: 2 bytes --]
^ permalink raw reply related [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-10-01 10:19 ` Mattias Engdegård
@ 2020-10-01 22:47 ` Aaron Zeng
2020-10-02 10:00 ` Mattias Engdegård
0 siblings, 1 reply; 13+ messages in thread
From: Aaron Zeng @ 2020-10-01 22:47 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: Lars Ingebrigtsen, 43677
Mattias, that patch seems to work well for me (I tested this by just
loading the lisp into an older version of emacs, since I don't have
experience compiling emacs from source). I don't need business days
for BC dates.
Thanks all for the quick responses.
On Thu, Oct 1, 2020 at 6:19 AM Mattias Engdegård <mattiase@acm.org> wrote:
>
> Aaron, does this patch solve your problem?
>
> It turned out that the ability to select arbitrary holiday weekdays never really worked correctly; the patch attempts to do something about that as well.
>
> The business days code also doesn't work at all very well for BC dates, which of course limits its applicability somewhat but perhaps not critically so. Please tell me if that is something you need fixed.
>
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation
2020-10-01 22:47 ` Aaron Zeng
@ 2020-10-02 10:00 ` Mattias Engdegård
0 siblings, 0 replies; 13+ messages in thread
From: Mattias Engdegård @ 2020-10-02 10:00 UTC (permalink / raw)
To: Aaron Zeng; +Cc: Lars Ingebrigtsen, 43677-done
2 okt. 2020 kl. 00.47 skrev Aaron Zeng <zeng.aaron.l@gmail.com>:
>
> Mattias, that patch seems to work well for me (I tested this by just
> loading the lisp into an older version of emacs, since I don't have
> experience compiling emacs from source). I don't need business days
> for BC dates.
Excellent, patch pushed to master and bug closed.
Nevermind those BC dates -- it doesn't make much sense to compute business days for proleptic Gregorian dates anyway, even more so considering that the very concept of business days shift wildly throughout history. It's just something that would be fun to have.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2020-10-02 10:00 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-28 1:18 bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation Aaron Zeng
2020-09-30 2:50 ` Lars Ingebrigtsen
2020-09-30 8:55 ` Robert Pluim
2020-09-30 9:42 ` Mattias Engdegård
2020-09-30 13:40 ` Lars Ingebrigtsen
2020-09-30 15:52 ` Glenn Morris
2020-09-30 16:22 ` Lars Ingebrigtsen
2020-09-30 16:31 ` Andreas Schwab
2020-09-30 16:12 ` Mattias Engdegård
2020-09-30 16:23 ` Lars Ingebrigtsen
2020-10-01 10:19 ` Mattias Engdegård
2020-10-01 22:47 ` Aaron Zeng
2020-10-02 10:00 ` Mattias Engdegård
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.