From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Drake Subject: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Sun, 19 Jan 2020 14:13:41 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000004f39b2059c83d075" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41008) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itGxJ-0003gL-Ig for emacs-orgmode@gnu.org; Sun, 19 Jan 2020 15:13:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itGxH-0001JL-Sq for emacs-orgmode@gnu.org; Sun, 19 Jan 2020 15:13:57 -0500 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:46032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itGxH-0001II-Lm for emacs-orgmode@gnu.org; Sun, 19 Jan 2020 15:13:55 -0500 Received: by mail-io1-xd2c.google.com with SMTP id i11so31427911ioi.12 for ; Sun, 19 Jan 2020 12:13:55 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --0000000000004f39b2059c83d075 Content-Type: multipart/alternative; boundary="0000000000004f39b0059c83d073" --0000000000004f39b0059c83d073 Content-Type: text/plain; charset="UTF-8" I asked about a way to specify a time when using org-resolve-clock instead of a number of minutes: https://lists.gnu.org/archive/html/emacs-orgmode/2020-01/msg00010.html I've implemented this myself and a patch is attached. Comments welcome -- my change works, but I'm not sure about coding style, and right now there's no error checking. I marked the patch as a tiny change, but it does add a new menu option and behavior to org-resolve-clock, so there may be an argument that it's not, from a user perspective, a "tiny change", but code-wise it's quite simple: the core logic really isn't more than "ask the user for a time and subtract". I hope this change can be incorporated into the official Org release. Regards, Dan -- Ceci n'est pas une .signature. --0000000000004f39b0059c83d073 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I asked about a way to specify a time when using org-= resolve-clock instead of a number of minutes:


I've implemented this myself and a pat= ch is attached. Comments welcome -- my change works, but I'm not sure a= bout coding style, and right now there's no error checking.
<= div>
I marked the patch as a tiny change, but it does add a n= ew menu option and behavior to org-resolve-clock, so there may be an argume= nt that it's not, from a user perspective, a "tiny change", b= ut code-wise it's quite simple: the core logic really isn't more th= an "ask the user for a time and subtract".

I hope this change can be incorporated into the official Org release.

Regards,

Dan

=

--
C= eci n'est pas une .signature.
--0000000000004f39b0059c83d073-- --0000000000004f39b2059c83d075 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-org-clock.el-add-t-option-to-org-clock-resolve.patch" Content-Disposition: attachment; filename="0001-org-clock.el-add-t-option-to-org-clock-resolve.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_k5lgkg950 RnJvbSA3YzM2OTY5NmMyZWI5ZWJjZDcyYWM5ZTc0MTVkMjQ4MWM0ZGE3ZDgwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYW4gRHJha2UgPGRhbi5kcmFrZUBnbWFpbC5jb20+CkRhdGU6 IFN1biwgMTkgSmFuIDIwMjAgMDg6MjQ6MTIgLTA2MDAKU3ViamVjdDogW1BBVENIXSBvcmctY2xv Y2suZWw6IGFkZCBgdCcgb3B0aW9uIHRvIG9yZy1jbG9jay1yZXNvbHZlCgoqIG9yZy1jbG9jay5l bCAob3JnLWNsb2NrLXJlc29sdmUpOiBhZGQgYHQnIG9wdGlvbi4gVGhpcyB3b3JrcyBqdXN0IGxp a2UKYGsnLCBidXQgYXNrcyB0aGUgdXNlciB0byBzcGVjaWZ5IGEgdGltZSwgaW5zdGVhZCBvZiBh IG51bWJlciBvZgptaW51dGVzLgoKT2Z0ZW4gd2hlbiB5b3UgYXJ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KSkKIAkgICAgICAodAogCSAgICAgICAoZXJyb3IgIlVuZXhwZWN0ZWQsIHBsZWFzZSByZXBvcnQg dGhpcyBhcyBhIGJ1ZyIpKSkKICAgICAgICAoYW5kIGdvdGJhY2sgbGFzdC12YWxpZCkKLSAgICAg ICAobWVtcSBjaCAnKD9LID9HID9TKSkKKyAgICAgICAobWVtcSBjaCAnKD9LID9HID9TID9UKSkK ICAgICAgICAoYW5kIHN0YXJ0LW92ZXIKIAkgICAgKG5vdCAobWVtcSBjaCAnKD9LID9HID9TID9D KSkpKQogICAgICAgIGZhaWwtcXVpZXRseSkpKSkpCi0tIAoyLjE3LjEKCg== --0000000000004f39b2059c83d075--