From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Colin Baxter Newsgroups: gmane.emacs.bugs Subject: bug#50216: 27.2; timeclock gives incorrect time in mode-line Date: Thu, 26 Aug 2021 20:11:40 +0100 Message-ID: <874kbcvx5f.fsf@yandex.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11629"; mail-complaints-to="usenet@ciao.gmane.io" To: 50216@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 26 21:12:22 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJKnU-0002oX-U8 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Aug 2021 21:12:21 +0200 Original-Received: from localhost ([::1]:44896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJKnT-0006j6-UK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Aug 2021 15:12:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJKnE-0006hQ-GH for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 15:12:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJKnC-0001vc-2i for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 15:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJKnB-00082t-Sh for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 15:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Colin Baxter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 19:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50216 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163000511330910 (code B ref -1); Thu, 26 Aug 2021 19:12:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Aug 2021 19:11:53 +0000 Original-Received: from localhost ([127.0.0.1]:50510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJKn3-00082U-4D for submit@debbugs.gnu.org; Thu, 26 Aug 2021 15:11:53 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:48284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJKn1-00082M-25 for submit@debbugs.gnu.org; Thu, 26 Aug 2021 15:11:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJKn0-0006gi-Ph for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 15:11:50 -0400 Original-Received: from forward108p.mail.yandex.net ([77.88.28.116]:58842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJKmw-0001kz-SB for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 15:11:50 -0400 Original-Received: from myt4-5dd3963c4bb1.qloud-c.yandex.net (myt4-5dd3963c4bb1.qloud-c.yandex.net [IPv6:2a02:6b8:c12:525:0:640:5dd3:963c]) by forward108p.mail.yandex.net (Yandex) with ESMTP id A4607267EE61 for ; Thu, 26 Aug 2021 22:11:42 +0300 (MSK) Original-Received: from myt5-ca5ec8faf378.qloud-c.yandex.net (myt5-ca5ec8faf378.qloud-c.yandex.net [2a02:6b8:c12:2514:0:640:ca5e:c8fa]) by myt4-5dd3963c4bb1.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 9M4s9hG4is-BgIGAELa; Thu, 26 Aug 2021 22:11:42 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1630005102; bh=AMb/abB7TvHncV5i/VkQvvldJ8mwa2fz9dG9BBDRqUQ=; h=Subject:To:From:Message-Id:Date; b=Pm7GvPQv7BBPCN2YbZ33Pb4VkBv3ilTCdmrZRIbNgXF7N3Rz9UUg+NdOEmgSfmfnf w/X3n4XO7Mny7RnpUgy+ckDK4d7q7ODasnB2uJ626oGi7RkjZVdh5hxQ1Nj30NtXmy q0yzGDQs2apmST8rfzL6E2kIUZalXA+YzDantFKc= Authentication-Results: myt4-5dd3963c4bb1.qloud-c.yandex.net; dkim=pass header.i=@yandex.com Original-Received: by myt5-ca5ec8faf378.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 3j7oFaLls2-Bf2WDumW; Thu, 26 Aug 2021 22:11:41 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Received-SPF: pass client-ip=77.88.28.116; envelope-from=m43cap@yandex.com; helo=forward108p.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212759 Archived-At: 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 6. mode-line reads [11:59] 7. Wait a minute or two. 8. M-x timeclock-out 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 6. mode-line reads <7:57> 7. Wrote /home/redknight/.emacs.d/timelog 8. Wait a minute or two. 9. M-x timeclock-out 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 6. mode-line reads <11:55> 7. Wrote /home/redknight/.emacs.d/timelog 8. Wait a minute or two. 9. M-x timeclock-out 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 5. mode-line reads [11:59] 6. Wait a minute or two. 7. M-x timeclock-out 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 5. mode-line reads [11:56] 6. Wait a minute or two. 7. M-x timeclock-out 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)