unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50216: 27.2; timeclock gives incorrect time in mode-line
@ 2021-08-26 19:11 Colin Baxter
  2021-08-27  1:01 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Baxter @ 2021-08-26 19:11 UTC (permalink / raw)
  To: 50216



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)





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-27  6:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 19:11 bug#50216: 27.2; timeclock gives incorrect time in mode-line Colin Baxter
2021-08-27  1:01 ` Lars Ingebrigtsen
2021-08-27  1:13   ` Lars Ingebrigtsen
2021-08-27  6:53     ` Colin Baxter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).