GNU bug report logs -
#50216
27.2; timeclock gives incorrect time in mode-line
Previous Next
Reported by: Colin Baxter <m43cap <at> yandex.com>
Date: Thu, 26 Aug 2021 19:12:01 UTC
Severity: normal
Found in version 27.2
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50216 in the body.
You can then email your comments to 50216 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50216
; Package
emacs
.
(Thu, 26 Aug 2021 19:12:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Colin Baxter <m43cap <at> yandex.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 26 Aug 2021 19:12:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Using emacs-28.0.50:
A. First Process
1. No timeclock log file
2. emacs -Q
3. In Scratch buffer, evaluate
(display-time)
(timeclock-mode-line-display 1)
(setq timeclock-workday (* 12 60 60))
4. mode-line reads [0:00]
5. M-x timeclock-in <RET>
6. mode-line reads [11:59]
7. Wait a minute or two.
8. M-x timeclock-out <RET>
9. mode-line reads [11:58]
10. Wrote /home/redknight/.emacs.d/timelog
11. Close emacs.
Emacs correctly counts down the set workday of 12:00 hours.
B. Repeat the process.
1. timeclock log file present
2. emacs -Q
3. In Scratch buffer, evaluate
(display-time)
(timeclock-mode-line-display 1)
(setq timeclock-workday (* 12 60 60))
4. mode-line reads [7:58]
5. Mx timeclock-in <RET>
6. mode-line reads <7:57>
7. Wrote /home/redknight/.emacs.d/timelog
8. Wait a minute or two.
9. M-x timeclock-out <RET>
10. mode-line reads [7:55]
11. Wrote /home/redknight/.emacs.d/timelog
12. Close emacs
Emacs incorrectly counts down workday, starting form the default value of 8 hours even though it was set to 12 hours.
C. Repeat process but change order of lisp
1. timeclock log file present
2. emacs -Q
3. In Scratch buffer, evaluate
(display-time)
(setq timeclock-workday (* 12 60 60))
(timeclock-mode-line-display 1)
4. mode-line reads [11:55]
5. Mx timeclock-in <RET>
6. mode-line reads <11:55>
7. Wrote /home/redknight/.emacs.d/timelog
8. Wait a minute or two.
9. M-x timeclock-out <RET>
10. mode-line reads [11:54]
11. Wrote /home/redknight/.emacs.d/timelog
12. Close emacs
By setting workday before mode-line-display, Emacs gives the correct workday, counting down from the set 12 hours.
D. Repeat first process A. but omit (display-time)
1. No timeclock log file
2. emacs -Q
3. In Scratch buffer, evaluate
(timeclock-mode-line-display 1)
Message: "Activate ‘display-time-mode’ or turn off ‘timeclock-use-display-time’ to see timeclock information"
(setq timeclock-workday (* 12 60 60))
4. M-x timeclock-in <RET>
5. mode-line reads [11:59]
6. Wait a minute or two.
7. M-x timeclock-out <RET>
8. mode-line reads [11:56]
9. Wrote /home/redknight/.emacs.d/timelog
10. Close emacs.
Emacs gives the correct workday.
E. Repeat process but change the lisp order
1. No timeclock log file
2. emacs -Q
3. In Scratch buffer, evaluate
(setq timeclock-workday (* 12 60 60))
(timeclock-mode-line-display 1)
Message: "Activate ‘display-time-mode’ or turn off ‘timeclock-use-display-time’ to see timeclock information"
4. M-x timeclock-in <RET>
5. mode-line reads [11:56]
6. Wait a minute or two.
7. M-x timeclock-out <RET>
8. mode-line reads [11:54]
9. Wrote /home/redknight/.emacs.d/timelog
10. Close emacs.
Emacs again gives the correct workday even when the mode-line display occurs after the workday setting.
The issue seem to be the presence or otherwise of (display-time). If it is present then the display of the set workday of 12 hours depends on when timeclock-mode-line is activated. Only if it is activated after setting the workday does the mode-line display correctly. However, if (display-time) is not used then the user gets an "Activate" message.
In GNU Emacs 27.2 (build 1, i686-pc-linux-gnu, X toolkit, cairo version 1.14.8, Xaw3d scroll bars)
of 2021-03-28 built on bluestar
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50216
; Package
emacs
.
(Fri, 27 Aug 2021 01:02:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 50216 <at> debbugs.gnu.org (full text, mbox):
Colin Baxter <m43cap <at> yandex.com> writes:
> B. Repeat the process.
>
> 1. timeclock log file present
> 2. emacs -Q
> 3. In Scratch buffer, evaluate
> (display-time)
> (timeclock-mode-line-display 1)
> (setq timeclock-workday (* 12 60 60))
> 4. mode-line reads [7:58]
> 5. Mx timeclock-in <RET>
> 6. mode-line reads <7:57>
> 7. Wrote /home/redknight/.emacs.d/timelog
> 8. Wait a minute or two.
> 9. M-x timeclock-out <RET>
> 10. mode-line reads [7:55]
> 11. Wrote /home/redknight/.emacs.d/timelog
> 12. Close emacs
>
> Emacs incorrectly counts down workday, starting form the default value of 8 hours even though it was set to 12 hours.
Thanks for the detailed recipes. I tried this in Emacs 28, and I can
reproduce the problem. However, I'm seeing exactly the same behaviour
in Emacs 27.2 (and earlier), and I think you said over on emacs-devel
that this used to work there?
> E. Repeat process but change the lisp order
>
> 1. No timeclock log file
> 2. emacs -Q
> 3. In Scratch buffer, evaluate
> (setq timeclock-workday (* 12 60 60))
> (timeclock-mode-line-display 1)
> Message: "Activate ‘display-time-mode’ or turn off ‘timeclock-use-display-time’ to see timeclock information"
> 4. M-x timeclock-in <RET>
> 5. mode-line reads [11:56]
> 6. Wait a minute or two.
> 7. M-x timeclock-out <RET>
> 8. mode-line reads [11:54]
> 9. Wrote /home/redknight/.emacs.d/timelog
> 10. Close emacs.
>
> Emacs again gives the correct workday even when the mode-line display
> occurs after the workday setting.
>
> The issue seem to be the presence or otherwise of (display-time).
I'm not so sure. In all the cases where things work correctly (when
setting timeclock after `timeclock-mode-line-display'), there's no
timelog file. So the issue seems to be: Setting workday after timeclock
+ having a log file?
I haven't really started debugging in, but the issue seems to be
`timeclock-find-discrep' using some data that was computed before
timeclock-workday was set...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50216
; Package
emacs
.
(Fri, 27 Aug 2021 01:14:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 50216 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> I haven't really started debugging in, but the issue seems to be
> `timeclock-find-discrep' using some data that was computed before
> timeclock-workday was set...
Yup, that was it -- I made it flush the data on workday changes, and now
it displays correctly for me in the timelog test case -- that is, when
doing timelog-in, it'll use the current timelog-workday setting and
compute stuff correctly.
Note, however, that initial display when doing
(timeclock-mode-line-display 1)
(setq timeclock-workday (* 12 60 60))
will be incorrect -- because setting a variable like this won't trigger
mode-line updates. (Until a minute has passed and it updates the line.)
So I've noted in the timeclock-mode-line-display doc string that this
shouldn't be done.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 28.1, send any further explanations to
50216 <at> debbugs.gnu.org and Colin Baxter <m43cap <at> yandex.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 27 Aug 2021 01:14:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50216
; Package
emacs
.
(Fri, 27 Aug 2021 06:54:01 GMT)
Full text and
rfc822 format available.
Message #16 received at 50216 <at> debbugs.gnu.org (full text, mbox):
>>>>> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>> I haven't really started debugging in, but the issue seems to be
>> `timeclock-find-discrep' using some data that was computed before
>> timeclock-workday was set...
> Yup, that was it -- I made it flush the data on workday changes,
> and now it displays correctly for me in the timelog test case --
> that is, when doing timelog-in, it'll use the current
> timelog-workday setting and compute stuff correctly.
> Note, however, that initial display when doing
> (timeclock-mode-line-display 1) (setq timeclock-workday (* 12 60
> 60))
> will be incorrect -- because setting a variable like this won't
> trigger mode-line updates. (Until a minute has passed and it
> updates the line.) So I've noted in the
> timeclock-mode-line-display doc string that this shouldn't be
> done.
Thank you very much. I think I am *beginning* to understand what's
happening. I was wrong about it only being an emacs-28 issue. As you
wrote in an earlier email, you can see the same effect in emacs-27.
Best wishes,
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 24 Sep 2021 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 206 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.