From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Extending timeclock.el Date: Sat, 06 May 2023 19:53:27 +0300 Message-ID: <83cz3dflko.fsf@gnu.org> References: <86wn1la21d.fsf@disroot.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17827"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: John Task , John Wiegley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 06 18:53:18 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pvL9p-0004R5-MW for ged-emacs-devel@m.gmane-mx.org; Sat, 06 May 2023 18:53:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvL96-00025H-UX; Sat, 06 May 2023 12:52:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvL95-00023b-P8 for emacs-devel@gnu.org; Sat, 06 May 2023 12:52:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvL95-0006dW-Dy; Sat, 06 May 2023 12:52:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PXHA7zfOCsrgT3m6v1Gffxj3+dvrlnANolO9lAunqmM=; b=koDjXEC8IYuw fRWoVwZxwOSCO34QVGekucHQTnLRsomBF0RMJUWB4G/LH0cW+IQGcFEfeNsKWUNL5/kductY3u1Tb rTsek5vj56RNIQ6l5qfr3JnS3VxalzzmlCZDp7J86geqJs5iCRs7aWSCIMHQVRN0prjcpW6RE8oNl /GCaYw4lmzpVw3tRzHcQ/ygc0XBDpvE3TALmzJC3YCCf0G+hflTd5FmBRP7NQ0AfPETbGLEAQ5prt 8H/oqd/XXe0LEnP1ivJ4GvlRC/BeROMe3CnDeMiE7joby7whVCzTi/8nJYKS64+4sxdbwkAOxdX5L /DIxo18oanoOWyQL/tAOTw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvL94-0006fT-Tb; Sat, 06 May 2023 12:52:31 -0400 In-Reply-To: <86wn1la21d.fsf@disroot.org> (message from John Task on Sat, 06 May 2023 12:47:24 -0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305919 Archived-At: > From: John Task > Cc: emacs-devel@gnu.org > Date: Sat, 06 May 2023 12:47:24 -0300 > > Eli Zaretskii writes: > > > Why not simply add the code to timeclock.el itself? You can for now > > fork it and develop it separately; later, we will merge the changes. > > That works, too. My thinking was that timeclock.el worked perfectly > fine until now, and timeclock-modern.el would be a simple extension in > order to support a different workflow. However, it also makes room > for improvement in other areas of the package, so I'll look into that. The way we extend existing packages is by adding code to the existing files, not by starting new FOO-x.el files. This is a natural way of extending them, even if the extension adds something that is only loosely coupled with the previous functionalities. > Yes, that's how I realized they exist. But as I'm not well > familiarized with the package, they are still pretty cryptic from my > POV. For instance: > > b Set the current time balance, or "time debt". Useful when > archiving old log data, when a debt must be carried forward. > The COMMENT here is the number of seconds of debt. > > I understand every word here, and yet I don't really get what time > balance is or when to use it. I'm not sure this is being used. Do you see any code that logs "b" lines in the file? > Also, old log data can be archived? I'm guessing that this means you move the log file to some archive, e.g., when a year ends or something. > > As for the "clock-out" issue: like I said, time trackers used for > > tracking work activities do have both 'o' and 'O'. The former means > > "end of workday", the latter means "this activity will never again > > appear, because its project is 'finished'". The former can indeed be > > represented as the start of "untracked" activity, but the latter must > > be also explicitly supported, because a reasonably useful report or > > statistics could deal with projects which were already completed. For > > instance: how many projects were completed the last year? Or: what is > > the average amount of time spent per project until it's completed? > > OK, I think that's clearer now. That kind of statistic was not > possible at all in ETT, so I'll have to design it from scratch, but it > sounds good. You don't have to design and implement anything that didn't exist unless you think it's a must-to-have feature. We can always wait for users to request such a feature in some distant future. What I described was just a rationale for having "O", and my point was that allowing people to say the project is finished is useful even if for now this is largely unused. > I was thinking about something like that, too. Basically, > timeclock-modern, as it is designed right now, should ideally make > three main additions to stock timeclock: > > 1. A parser to retrieve information from the timelog file > 2. Advanced statistic reports > 3. A new optional workflow where it is able to track everything Yes. > Point 1 must explicitly support the current state of things, as it > would be useless otherwise. Point 2 also should support the default > behaviour of timeclock, so all users can benefit from it; however, > some things such as tags are not supported out-of-the-box as of now, > while other things such as the 'b' or 'h' keywords don't make much > sense for the new behaviour. So, statistic reports will depend on > what workflow the user chooses. Right. > As for point 3, it is the most complex one because I haven't come to a > clear solution of how to implement it properly yet. For now, I think > a user option which redefines the behaviour of some commands such as > timeclock-in and timeclock-out is the best path to follow. If that works, I agree it's the best. > And the thing is, the new workflow will probably slightly modify the > timelog format. Currently, my custom tm-clock-in (which would be > the new 'timeclock-in' once the user opts-in into the new worflow) > gets rid of the letter code altogether, somehow breaking backward > compatibility. Maybe that's not a bad thing though, because if the > user opted into the new workflow, they probably don't care about > that. As I said, the timelog file could announce what kind it is of. > > I have only ever used timeclock in a very simple workflow, with a > > single "project" into which I was clocking in and then clocking out > > every day. So my timelog file is a series of 'i's and 'o's, something > > that you can easily generate yourself. If specific issues are of > > interest, please ask more specific questions. > > Yes, I have tested that kind of timelogs and everything has gone well. > I was thinking on sligthly more complex files, maybe with 'O', 'h' and > 'b' here or there. Maybe I'm exaggerating a little, but it feels > wrong to not test it with real timelogs :) You can build tests using the ert package. We use it in our test suite (under the test/ subdirectory of the Emacs source tree). > > Why "worse"? Can't we do this in a backward-compatible manner, like > > based on user options? And if worse comes to worst, we can add a > > whole new set of commands to support the "track everything" workflow > > you had in mind for ETT. > > Now that I think about it, maybe modifying timeclock-in in order to > support that workflow based on user options is a good idea. That way > I don't have to support a separate tm-clock-in. That's also another > argument in favour of forking timeclock instead of developing a > separate file. I'll look into that. Thanks.