From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#50216: 27.2; timeclock gives incorrect time in mode-line Date: Fri, 27 Aug 2021 03:01:13 +0200 Message-ID: <877dg7u2ee.fsf@gnus.org> References: <874kbcvx5f.fsf@yandex.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23468"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 50216@debbugs.gnu.org To: Colin Baxter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 27 03:02:37 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 1mJQGT-0005yW-Py for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Aug 2021 03:02:37 +0200 Original-Received: from localhost ([::1]:59198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJQGS-0003H6-AV for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Aug 2021 21:02:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJQFu-0003GK-LJ for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 21:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJQFu-0007pE-DO for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 21:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJQFu-0006KE-17 for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2021 21:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Aug 2021 01:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50216 X-GNU-PR-Package: emacs Original-Received: via spool by 50216-submit@debbugs.gnu.org id=B50216.163002608724272 (code B ref 50216); Fri, 27 Aug 2021 01:02:01 +0000 Original-Received: (at 50216) by debbugs.gnu.org; 27 Aug 2021 01:01:27 +0000 Original-Received: from localhost ([127.0.0.1]:50808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJQFL-0006JQ-8r for submit@debbugs.gnu.org; Thu, 26 Aug 2021 21:01:27 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:53314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJQFI-0006JC-Qp for 50216@debbugs.gnu.org; Thu, 26 Aug 2021 21:01:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=h+khPzLeZXC+MLgMjr7dygy37q5F3+ervXkZbXfyp/k=; b=HhLkTFDfAsMfLP1OTnGYCCWIvm Apofk20w1Kq9ftUQstyKstfZbJibCiDcyZfReOwNdTrqZqRDXBaoLkOWTweT5lPN2mqVTpSjgbjyv PiQ85haV8rmwJbFAiczod8RQW5xDcm0orMnQN0nxaiUdK6jJ5zXeu+OTIElJSDLGGZp8=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJQF8-0008Jo-Gn; Fri, 27 Aug 2021 03:01:18 +0200 In-Reply-To: <874kbcvx5f.fsf@yandex.com> (Colin Baxter's message of "Thu, 26 Aug 2021 20:11:40 +0100") 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:212774 Archived-At: Colin Baxter 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 > 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. 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 =E2=80=98display-time-mode=E2=80=99 or turn off =E2= =80=98timeclock-use-display-time=E2=80=99 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). 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... --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no