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-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Sat, 25 Jan 2020 00:30:57 +0100 Message-ID: <87sgk4o2j2.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:50596) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv8Pu-0001Z6-SZ for emacs-orgmode@gnu.org; Fri, 24 Jan 2020 18:31:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv8Ps-0003XO-FO for emacs-orgmode@gnu.org; Fri, 24 Jan 2020 18:31:09 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:26813) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv8Pq-0003Tj-TX for emacs-orgmode@gnu.org; Fri, 24 Jan 2020 18:31:08 -0500 In-Reply-To: (Dan Drake's message of "Sun, 19 Jan 2020 14:13:41 -0600") 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: Dan Drake Cc: emacs-orgmode@gnu.org Hello, Dan Drake writes: > 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. Thank you. Some comments follow. > 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". TINYCHANGE is only about the number of non-trivial lines of code in your patch (15 or so). > +(defun time-to-mins-to-keep (start-time) > + "Asks the user for a time and returns the number of minutes > +from START-TIME to that time." > + (floor (/ (float-time > + (time-subtract (org-read-date t t) start-time)) 60))) The name of the function is wrong, it should start with "org-clock". Also, docstring's first line must contain a full sentence. Anyway, this is used only once in your patch, I suggest to inline in instead. > + (or (and (memq ch '(?k ?K)) > + (read-number "Keep how many minutes? " default)) > + (and (memq ch '(?t ?T)) > + (time-to-mins-to-keep last-valid)))) See above about inlining. Would you mind adding an ORG-NEWS entry, and, if possible, writing a test? Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Drake Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Tue, 28 Jan 2020 20:11:42 -0600 Message-ID: References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000045b9be059d3dddcc" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44150) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwcph-0005YQ-Pc for emacs-orgmode@gnu.org; Tue, 28 Jan 2020 21:11:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwcpf-0000sK-Lu for emacs-orgmode@gnu.org; Tue, 28 Jan 2020 21:11:57 -0500 Received: from mail-il1-x144.google.com ([2607:f8b0:4864:20::144]:41395) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iwcpf-0000s9-Dm for emacs-orgmode@gnu.org; Tue, 28 Jan 2020 21:11:55 -0500 Received: by mail-il1-x144.google.com with SMTP id f10so12561212ils.8 for ; Tue, 28 Jan 2020 18:11:55 -0800 (PST) In-Reply-To: <87sgk4o2j2.fsf@nicolasgoaziou.fr> 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: Dan Drake , emacs-orgmode@gnu.org --00000000000045b9be059d3dddcc Content-Type: multipart/alternative; boundary="00000000000045b9bb059d3dddca" --00000000000045b9bb059d3dddca Content-Type: text/plain; charset="UTF-8" Thank you, Nicolas, for the review of my first patch. I've updated my code and have the new patch attached. I didn't inline the "time to minutes to keep function"; yes, that function is very short, but the function name makes the intent/purpose of the code obvious, and the org-clock-resolve a bit more readable. If it's important to inline that -- performance concerns about the function call overhead, accepting org-mode/emacs coding style, etc. -- I'm willing to do that. I added an entry to ORG-NEWS for version 9.4. I didn't write any tests, as the change seems so simple, and UI-focused. But again, if that's a dealbreaker, I can work on doing that. Further comments welcome. On Fri, Jan 24, 2020 at 5:31 PM Nicolas Goaziou wrote: > Hello, > > Dan Drake writes: > > > 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. > > Thank you. Some comments follow. > > > 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". > > TINYCHANGE is only about the number of non-trivial lines of code in your > patch (15 or so). > > > +(defun time-to-mins-to-keep (start-time) > > + "Asks the user for a time and returns the number of minutes > > +from START-TIME to that time." > > + (floor (/ (float-time > > + (time-subtract (org-read-date t t) start-time)) 60))) > > The name of the function is wrong, it should start with "org-clock". > Also, docstring's first line must contain a full sentence. > > Anyway, this is used only once in your patch, I suggest to inline in > instead. > > + (or (and (memq ch '(?k ?K)) > > + (read-number "Keep how many minutes? " default)) > > + (and (memq ch '(?t ?T)) > > + (time-to-mins-to-keep last-valid)))) > > See above about inlining. > > Would you mind adding an ORG-NEWS entry, and, if possible, writing > a test? > > Regards, > > -- > Nicolas Goaziou > -- Ceci n'est pas une .signature. --00000000000045b9bb059d3dddca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you, Nicolas, for the review of my first patch.= I've updated my code and have the new patch attached.

I didn't inline the "time to minutes to keep function&quo= t;; yes, that function is very short, but the function name makes the inten= t/purpose of the code obvious, and the org-clock-resolve a bit more readabl= e. If it's important to inline that -- performance concerns about the f= unction call overhead, accepting org-mode/emacs coding style, etc. -- I'= ;m willing to do that.

I added an entry to ORG-NEW= S for version 9.4.

I didn't write any tes= ts, as the change seems so simple, and UI-focused. But again, if that's= a dealbreaker, I can work on doing that.

Further = comments welcome.

On Fri, Jan 24, 2020 at 5:31 PM Nicolas Goazi= ou <mail@nicolasgoaziou.fr= > wrote:
Hell= o,

Dan Drake <dan.= drake@gmail.com> writes:

> I asked about a way to specify a time when using org-resolve-clock ins= tead
> of a number of minutes:
>
> https://lists.gnu.org/arc= hive/html/emacs-orgmode/2020-01/msg00010.html
>
> I've implemented this myself and a patch is attached. Comments wel= come --
> my change works, but I'm not sure about coding style, and right no= w there's
> no error checking.

Thank you. Some comments follow.

> 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&#= 39;s quite simple:
> the core logic really isn't more than "ask the user for a tim= e and
> subtract".

TINYCHANGE is only about the number of non-trivial lines of code in your patch (15 or so).

> +(defun time-to-mins-to-keep (start-time)
> +=C2=A0 "Asks the user for a time and returns the number of minut= es
> +from START-TIME to that time."
> +=C2=A0 (floor (/ (float-time
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (time-subtract (org-read-date t t)= start-time)) 60)))

The name of the function is wrong, it should start with "org-clock&quo= t;.
Also, docstring's first line must contain a full sentence.

Anyway, this is used only once in your patch, I suggest to inline in
instead.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(or (and (memq ch '(?k ?K))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (read-number = "Keep how many minutes? " default))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(and (memq ch '(?t ?T))<= br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (time-to-mins= -to-keep last-valid))))

See above about inlining.

Would you mind adding an ORG-NEWS entry, and, if possible, writing
a test?

Regards,

--
Nicolas Goaziou


--
Ceci n'est pas une .signature.
--00000000000045b9bb059d3dddca-- --00000000000045b9be059d3dddcc 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_k5yobmej0 RnJvbSA1MmQ1M2RlNWY2N2U5YmExNmI2ZWZlOTFhYzc5YjM3MGQ4OWM5ZmVhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYW4gRHJha2UgPGRhbi5kcmFrZUBnbWFpbC5jb20+CkRhdGU6 IFN1biwgMTkgSmFuIDIwMjAgMDg6MjQ6MTIgLTA2MDAKU3ViamVjdDogW1BBVENIXSBvcmctY2xv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1lc3NhZ2UgIiIpKQogICAgICAodAogICAgICAgKG9yZy1jbG9jay1y ZXNvbHZlLWNsb2NrCkBAIC0xMDkyLDcgKzExMDIsNyBAQCB0byBiZSBDTE9DS0VEIE9VVC4iKSkp KQogCSAgICAgICh0CiAJICAgICAgIChlcnJvciAiVW5leHBlY3RlZCwgcGxlYXNlIHJlcG9ydCB0 aGlzIGFzIGEgYnVnIikpKQogICAgICAgIChhbmQgZ290YmFjayBsYXN0LXZhbGlkKQotICAgICAg IChtZW1xIGNoICcoP0sgP0cgP1MpKQorICAgICAgIChtZW1xIGNoICcoP0sgP0cgP1MgP1QpKQog ICAgICAgIChhbmQgc3RhcnQtb3ZlcgogCSAgICAobm90IChtZW1xIGNoICcoP0sgP0cgP1MgP0Mp KSkpCiAgICAgICAgZmFpbC1xdWlldGx5KSkpKSkKLS0gCjIuMTcuMQoK --00000000000045b9be059d3dddcc-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Wed, 29 Jan 2020 10:49:05 +0100 Message-ID: <8736byegoe.fsf@nicolasgoaziou.fr> References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56978) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwjyK-0003eY-9S for emacs-orgmode@gnu.org; Wed, 29 Jan 2020 04:49:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwjyI-0000FM-QE for emacs-orgmode@gnu.org; Wed, 29 Jan 2020 04:49:19 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:44989) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iwjyI-00007j-KO for emacs-orgmode@gnu.org; Wed, 29 Jan 2020 04:49:18 -0500 In-Reply-To: (Dan Drake's message of "Tue, 28 Jan 2020 20:11:42 -0600") 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: Dan Drake Cc: emacs-orgmode@gnu.org Hello, Dan Drake writes: > Thank you, Nicolas, for the review of my first patch. I've updated my code > and have the new patch attached. Thank you! > I didn't inline the "time to minutes to keep function"; yes, that function > is very short, but the function name makes the intent/purpose of the code > obvious, and the org-clock-resolve a bit more readable. If it's important > to inline that -- performance concerns about the function call overhead, > accepting org-mode/emacs coding style, etc. -- I'm willing to do that. If you think it makes the code more readable, which is debatable IMO, one option is to simply add a comment where it is going to be inlined. It is not about speed or Org coding style, but generally speaking, defining a global function out of a one-liner, just to use it once, does not sound reasonable. You may define it in a `let' within the function, but I'm still confident that a comment and plain inlining is more than enough. > I added an entry to ORG-NEWS for version 9.4. Great! > I didn't write any tests, as the change seems so simple, and UI-focused. > But again, if that's a dealbreaker, I can work on doing that. It's certainly not a deal breaker in this case, but a regression test more or less guarantees a future code refactoring will not unwillingly break your feature. Test can come later, or even never, that's your call. No worries. Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Wed, 29 Jan 2020 13:47:55 +0100 Message-ID: <87imkuwhs4.fsf@gnu.org> References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:38521) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwmlD-0001tq-ED for emacs-orgmode@gnu.org; Wed, 29 Jan 2020 07:48:00 -0500 In-Reply-To: <87sgk4o2j2.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sat, 25 Jan 2020 00:30:57 +0100") 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: Nicolas Goaziou Cc: Dan Drake , emacs-orgmode@gnu.org Hi Dan and Nicolas, Nicolas Goaziou writes: > TINYCHANGE is only about the number of non-trivial lines of code in > your patch (15 or so). I would not say "non-trivial lines" of code. The change should be less *than 15 lines or so* to be accepted. I may be wrong, but this is how I read this: https://www.gnu.org/prep/maintain/maintain.html I don't see any inconvenient in being strict here: this is just a matter of signing the FSF papers for the contributors, and signing the FSF papers is good for engaging contributors for future contributions. Dan, if you didn't take this route yet, would you mind doing so? Here is the form and instructions: https://code.orgmode.org/bzg/org-mode/raw/master/request-assign-future.txt https://orgmode.org/worg/org-contribute.html Thanks! -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Sat, 01 Feb 2020 11:22:15 +0100 Message-ID: <87y2tmd2ug.fsf@nicolasgoaziou.fr> References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> <87imkuwhs4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47027) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixpv5-00011g-KH for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 05:22:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixpv4-00082u-4t for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 05:22:31 -0500 In-Reply-To: <87imkuwhs4.fsf@gnu.org> (Bastien's message of "Wed, 29 Jan 2020 13:47:55 +0100") 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: Bastien Cc: Dan Drake , emacs-orgmode@gnu.org Hello, Bastien writes: > Nicolas Goaziou writes: > >> TINYCHANGE is only about the number of non-trivial lines of code in >> your patch (15 or so). > > I would not say "non-trivial lines" of code. > > The change should be less *than 15 lines or so* to be accepted. > > I may be wrong, but this is how I read this: > https://www.gnu.org/prep/maintain/maintain.html I disagree. As stated in this page, only lines of code significant copyright-wise count. Commenting a line of code, changing indentation (e.g., when you wrap a `let') do not count. You cannot copyright an indentation change. Nor a symbol renaming (this example is even given in the page above). Also, applying the same change multiple times may count /at most/ once. So, I stand on my ground: there is a "non-trivial" part to take into consideration when counting locs. I would go even further: when you transform a string regexp into a rx regexp, there is no line to count, because there is no new idea to copyright in the first place. This is a trivial change. Anyway, I think arguing here is just wasting our time. Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Sat, 01 Feb 2020 14:10:28 +0100 Message-ID: <87sgjuh2rf.fsf@gnu.org> References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> <87imkuwhs4.fsf@gnu.org> <87y2tmd2ug.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35243) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixsXi-0003TX-1N for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 08:10:35 -0500 In-Reply-To: <87y2tmd2ug.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sat, 01 Feb 2020 11:22:15 +0100") 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: Nicolas Goaziou Cc: Dan Drake , emacs-orgmode@gnu.org Hi Nicolas, I think it is worth spending a little time discussing this to ensure that everyone is aligned on the same understanding, otherwise we may have to spend more time later, discussing it over and over for other cases. Nicolas Goaziou writes: > So, I stand on my ground: there is a "non-trivial" part to take into > consideration when counting locs. Yes, you are right. My point is that distinguishing trivial vs. non-trivial parts of a change may be subject to interpretation. When in doubt, I recommend staying on the safe side of not accepting a change that is more than 15 lines of "maybe-significant" changes. In general, the more FSF-signed contributors there are, the less time maintainers spend on deciding whether changes are significant or not. Also, signed contributors are more likely to contribute again, so I recommend inciting contributors to sign. I am glad we already have more than 200 signed contributors, that's a great achievement :) > I would go even further: when you transform a string regexp into a rx > regexp, there is no line to count, because there is no new idea to > copyright in the first place. This is a trivial change. Yes, in this case there is no new idea, but this is irrelevant to the discussion, since ideas cannot be copyrighted anyway. Copyright is about the expression of ideas, and code is also all about this, hence the difficulty, sometimes, to interpret "significant". > Anyway, I think arguing here is just wasting our time. Well, I hope I clarified my point, which is to stay on safe side of asking contributors to sign the FSF papers when the importance of the change can be subject to intepretation. Thanks, -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Sat, 01 Feb 2020 15:15:10 +0100 Message-ID: <87h80acs29.fsf@nicolasgoaziou.fr> References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> <87imkuwhs4.fsf@gnu.org> <87y2tmd2ug.fsf@nicolasgoaziou.fr> <87sgjuh2rf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53520) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixtYY-0004mG-CS for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 09:15:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixtYW-00012J-W5 for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 09:15:29 -0500 In-Reply-To: <87sgjuh2rf.fsf@gnu.org> (Bastien's message of "Sat, 01 Feb 2020 14:10:28 +0100") 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: Bastien Cc: Dan Drake , emacs-orgmode@gnu.org Bastien writes: > My point is that distinguishing trivial vs. non-trivial parts of a > change may be subject to interpretation. When in doubt, I recommend > staying on the safe side of not accepting a change that is more than > 15 lines of "maybe-significant" changes. AFACT, there was no doubt involved when I said "15 lines of non-trivial code". > Yes, in this case there is no new idea, but this is irrelevant to the > discussion, I thought we had a discussion about it recently, but my memories may be brittle. > since ideas cannot be copyrighted anyway. I knew I shouldn't have used this word. Fair enough. Replace it with "process", or whatever has a copyright meaning. > Well, I hope I clarified my point, which is to stay on safe side of > asking contributors to sign the FSF papers when the importance of the > change can be subject to intepretation. If your point (I didn't get it actually) is "interpretation is hard, let's not interpret anything and count everything as significant", well, I think this is not a good way to look at the problem. But that's fine, as long as it suits you. Regards, From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Sat, 01 Feb 2020 15:34:54 +0100 Message-ID: <8736bu9y0h.fsf@bzg.fr> References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> <87imkuwhs4.fsf@gnu.org> <87y2tmd2ug.fsf@nicolasgoaziou.fr> <87sgjuh2rf.fsf@gnu.org> <87h80acs29.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:60024) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixtrO-0002tM-9W for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 09:34:59 -0500 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: Nicolas Goaziou Cc: Dan Drake , emacs-orgmode@gnu.org Hi Nicolas, Nicolas Goaziou writes: > Bastien writes: > >> My point is that distinguishing trivial vs. non-trivial parts of a >> change may be subject to interpretation. When in doubt, I recommend >> staying on the safe side of not accepting a change that is more than >> 15 lines of "maybe-significant" changes. > > AFACT, there was no doubt involved when I said "15 lines of non-trivial > code". I'm sure there was no doubt on your side, but as the one responsible for the consistency of copyright assignment for Org-mode, my attention is necessarily triggered when I see a change of >20 lines marked as "tiny change". I fully trust your judgement. I am not arguing that *this* change required Dan to sign the papers. I'm saying that in general, I would rather avoid relying on the evaluation of the "triviality" of the locs and incite contributors to sign the papers. > If your point (I didn't get it actually) is "interpretation is hard, > let's not interpret anything and count everything as significant", well, > I think this is not a good way to look at the problem. But that's fine, > as long as it suits you. My point is this: the inconveniency of *systematically* requesting copyright assignment from the contributor when its contribution is more than 15 lines (significant *or not*) is a small inconveniency compared to the one of having to check carefully whether every >15 lines change is significant or not. And since is it a good outcome to have more people signing the FSF papers, I recommend requesting contributors to sign the copyright assignment for every >15 lines contributions (significant or not). Future maintainers may of course interpret the recommendations of the FSF differently, but that's mine for now. Thanks, -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Sat, 01 Feb 2020 17:48:04 +0100 Message-ID: <87d0ayckzf.fsf@nicolasgoaziou.fr> References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> <87imkuwhs4.fsf@gnu.org> <87y2tmd2ug.fsf@nicolasgoaziou.fr> <87sgjuh2rf.fsf@gnu.org> <87h80acs29.fsf@nicolasgoaziou.fr> <8736bu9y0h.fsf@bzg.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39596) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixvwQ-0001qv-8H for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 11:48:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixvwO-0004gX-Ro for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 11:48:17 -0500 In-Reply-To: <8736bu9y0h.fsf@bzg.fr> (Bastien's message of "Sat, 01 Feb 2020 15:34:54 +0100") 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: Bastien Cc: Dan Drake , emacs-orgmode@gnu.org Bastien writes: > Future maintainers may of course interpret the recommendations of > the FSF differently, but that's mine for now. Of course, sir. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Drake Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Sun, 2 Feb 2020 07:41:24 -0600 Message-ID: References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> <87imkuwhs4.fsf@gnu.org> <87y2tmd2ug.fsf@nicolasgoaziou.fr> <87sgjuh2rf.fsf@gnu.org> <87h80acs29.fsf@nicolasgoaziou.fr> <8736bu9y0h.fsf@bzg.fr> <87d0ayckzf.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000284e96059d97f794" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:52062) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyFVM-0007y7-2N for emacs-orgmode@gnu.org; Sun, 02 Feb 2020 08:41:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyFVK-0002xM-LZ for emacs-orgmode@gnu.org; Sun, 02 Feb 2020 08:41:39 -0500 In-Reply-To: <87d0ayckzf.fsf@nicolasgoaziou.fr> 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: Bastien , Dan Drake , emacs-orgmode@gnu.org --000000000000284e96059d97f794 Content-Type: text/plain; charset="UTF-8" I just wanted to add that I have no real opinion one way or the other on the TINYCHANGE bit; I was just following what I found at https://orgmode.org/worg/org-contribute.html. I also have no strong opinion on how copyright should be handled for this. I'm willing to assign copyright to the FSF, make my contribution public domain, or whatever is most convenient and easiest to get this into org. Regards, Dan On Sat, Feb 1, 2020 at 10:48 AM Nicolas Goaziou wrote: > Bastien writes: > > > Future maintainers may of course interpret the recommendations of > > the FSF differently, but that's mine for now. > > Of course, sir. > -- Ceci n'est pas une .signature. --000000000000284e96059d97f794 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I just wanted to add that I have no real opinion one = way or the other on the TINYCHANGE bit; I was just following what I found a= t https://orgmode.= org/worg/org-contribute.html.

I also have no s= trong opinion on how copyright should be handled for this. I'm willing = to assign copyright to the FSF, make my contribution public domain, or what= ever is most convenient and easiest to get this into org.

Regards,

Dan

On Sat, F= eb 1, 2020 at 10:48 AM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
Bastien <bzg@gnu.org> writes:

> Future maintainers may of course interpret the recommendations of
> the FSF differently, but that's mine for now.

Of course, sir.


--
Ceci n'est pas une .signature.
--000000000000284e96059d97f794-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Sun, 02 Feb 2020 14:51:11 +0100 Message-ID: <87tv4914j4.fsf@bzg.fr> References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> <87imkuwhs4.fsf@gnu.org> <87y2tmd2ug.fsf@nicolasgoaziou.fr> <87sgjuh2rf.fsf@gnu.org> <87h80acs29.fsf@nicolasgoaziou.fr> <8736bu9y0h.fsf@bzg.fr> <87d0ayckzf.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:55079) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyFed-0006nk-8I for emacs-orgmode@gnu.org; Sun, 02 Feb 2020 08:51:16 -0500 In-Reply-To: (Dan Drake's message of "Sun, 2 Feb 2020 07:41:24 -0600") 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: Dan Drake Cc: emacs-orgmode@gnu.org Hi Dan, Dan Drake writes: > I'm willing to assign copyright to the FSF, make my > contribution public domain, or whatever is most convenient and > easiest to get this into org. Thanks! My understanding is that your contribution has already been added to org-mode, which is fine. To assign your copyright to the FSF for future contributions, you can follow the instructions here: https://code.orgmode.org/bzg/org-mode/raw/master/request-assign-future.txt Best (and hello from the OLPC old days!) -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Pluim Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Mon, 03 Feb 2020 15:41:35 +0100 Message-ID: References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> <87imkuwhs4.fsf@gnu.org> <87y2tmd2ug.fsf@nicolasgoaziou.fr> <87sgjuh2rf.fsf@gnu.org> <87h80acs29.fsf@nicolasgoaziou.fr> <8736bu9y0h.fsf@bzg.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:42119) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iycv0-0002EM-AN for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 09:41:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iycuz-0002Jm-93 for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 09:41:42 -0500 In-Reply-To: <8736bu9y0h.fsf@bzg.fr> (Bastien's message of "Sat, 01 Feb 2020 15:34:54 +0100") 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: Bastien Cc: Dan Drake , emacs-orgmode@gnu.org, Nicolas Goaziou >>>>> On Sat, 01 Feb 2020 15:34:54 +0100, Bastien said: Bastien> And since is it a good outcome to have more people signing the FSF Bastien> papers, I recommend requesting contributors to sign the copyright Bastien> assignment for every >15 lines contributions (significant or not). Not only that: without copyright assignment you need to keep track of whether an individual has contributed more than 15 significant lines *total*, which is a hassle. Robert From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [RFC PATCH] specify a time, not number of minutes to keep, with org-resolve-clock Date: Mon, 03 Feb 2020 15:53:02 +0100 Message-ID: <87v9ond8oh.fsf@gnu.org> References: <87sgk4o2j2.fsf@nicolasgoaziou.fr> <87imkuwhs4.fsf@gnu.org> <87y2tmd2ug.fsf@nicolasgoaziou.fr> <87sgjuh2rf.fsf@gnu.org> <87h80acs29.fsf@nicolasgoaziou.fr> <8736bu9y0h.fsf@bzg.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:46383) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyd62-0000wt-Rv for emacs-orgmode@gnu.org; Mon, 03 Feb 2020 09:53:07 -0500 In-Reply-To: (Robert Pluim's message of "Mon, 03 Feb 2020 15:41:35 +0100") 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: Robert Pluim Cc: Dan Drake , emacs-orgmode@gnu.org, Nicolas Goaziou Robert Pluim writes: >>>>>> On Sat, 01 Feb 2020 15:34:54 +0100, Bastien said: > Bastien> And since is it a good outcome to have more people signing the FSF > Bastien> papers, I recommend requesting contributors to sign the copyright > Bastien> assignment for every >15 lines contributions (significant or not). > > Not only that: without copyright assignment you need to keep track of > whether an individual has contributed more than 15 significant lines > *total*, which is a hassle. Yes, indeed. -- Bastien