From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UP1JDqsx7GE37gAAgWs5BA (envelope-from ) for ; Sat, 22 Jan 2022 17:32:43 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UA/cCqsx7GGORwAAauVa8A (envelope-from ) for ; Sat, 22 Jan 2022 17:32:43 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B4F2B2AFC4 for ; Sat, 22 Jan 2022 17:32:42 +0100 (CET) Received: from localhost ([::1]:49976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBJJh-0000SS-L3 for larch@yhetil.org; Sat, 22 Jan 2022 11:32:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBJIu-0000N8-4T for emacs-orgmode@gnu.org; Sat, 22 Jan 2022 11:31:52 -0500 Received: from [2a00:1450:4864:20::630] (port=37485 helo=mail-ej1-x630.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBJIs-0005es-3R for emacs-orgmode@gnu.org; Sat, 22 Jan 2022 11:31:51 -0500 Received: by mail-ej1-x630.google.com with SMTP id ah7so8862543ejc.4 for ; Sat, 22 Jan 2022 08:31:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kdaKTp8hiKWIxb2lB6u084esT7ZctpYteF0K3GS2WE4=; b=kRf+7H2jkOfLUrUuhYpOH5bqre91MbYWos2U1quA0A2n1adQGSkA8/jv1x/V3tkYJo VkLgVq2oB87QaKRHkhA2MvVOOiH96OOjvhAvfbsnun9AhfsXwcjeF3ANUS6sQT9o379I aDEaepcrqcc8Bq6gzZPEnHrJbimwXn9NQMnI/poX0GLNpTIN2VqChJdoJOnDCzvFwFjm /7+AR0eHGIBF1Ktd2W62JgP8Fw5xLfFzddyHCVdK0OFlPP7jfl/Xux6a2v+z/9OvBk6v UsKgZNntWUVT9W74c2qIdYhXNYX1IHIqBjnxbKO6ZqxbbwnLhHIlCrPIZ8nOij3Un3JR LQsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kdaKTp8hiKWIxb2lB6u084esT7ZctpYteF0K3GS2WE4=; b=bgUi1nJxQuTx15M5uc20MG6m/JsWYwupcxxv0RKPkOpAPooi0RW7ahTnBjlm0Wzdb7 rGRYft82s0ac9QRjnge5MnvEsI834pVNxr87UFZl1ii7pb1RwFIyaV88YN4sUlm7Cojt Dn5vZfBKVwuKOQTVvn9asoYmXueay3+7ID6SN6Z5NYXsOlmGrq2AKsjp60BFT1ISoKtK T0su5u9ZfCXcNtQyXR6Z5rZ3G1cElKAt5PGIxprV9k3XFddR0FosNlByof5sCMgLnXt0 6imRkyT1SddSAfGi306yf5Ju+RI14uG3hEoibuM51W/v+msNHGWmYtATAsL300FeHepp c7zg== X-Gm-Message-State: AOAM533TXR+Ss1WR4HmBbrEuTQl5XA2p9rdVGr89UuSuM954ASaj6S57 wPdodxlG6OmxUOPzv0AJv3t6PPiT0pVoQsu/66SIsHgFA6NEyzdd X-Google-Smtp-Source: ABdhPJzrGIFgd53t72R3RTGgUZfPLw/ID7hKfryWLPea9otgXKVaqEYlJthL/4e0BSWKF2kPiyGDteUXEskxMk+V3ek= X-Received: by 2002:a17:907:7e9c:: with SMTP id qb28mr1064300ejc.59.1642868660863; Sat, 22 Jan 2022 08:24:20 -0800 (PST) MIME-Version: 1.0 References: <875yqdtmb1.fsf@nicolasgoaziou.fr> In-Reply-To: <875yqdtmb1.fsf@nicolasgoaziou.fr> From: Samim Pezeshki Date: Sat, 22 Jan 2022 19:54:09 +0330 Message-ID: Subject: Re: [PATCH] lisp/org-agenda.el: Add header to agenda clock report table To: Nicolas Goaziou Content-Type: multipart/mixed; boundary="000000000000f19c2705d62e2a4c" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::630 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=p.samim@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642869162; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=FlFyTiEfzTwzo20x5jz8YVbF12WLp5Zypw9ixtZe8M4=; b=FnZDX3mpj8plZ0xXjHLcJ7cTTlSA3jVJg2T/XIMmjcRbKfWz0AOJ8KEF8/81WKh76IS9F+ BB8HzLYZG+KGQaUsM7OLxDhOEq2cPraqzRfJVWrdxyy0/ZxmTsHaqK6Ezk1I0H1QKO16ZV StfLDNSPPf0FLimiU8gq/KRS7qTVxIIdlMJaHCMtRg8FbYmeslhrGOjgowHMOy0ZYg5HBP umTTRF1i6nDnjoltTx0GPNLHaxYbz/pR30qr/FDR60lVLBlvLhYAvTvRhlwiK+9jZZ8GtU 5wbIUqUHNxH5iP+1IgrILDHgTTGEJk4T5FUSChRG0DPjz8N8n2rDaqmRql+YuA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642869162; a=rsa-sha256; cv=none; b=Womp16NsRHy1NjfA2FX7DRbU6F8NgRt0YcZFAWrHFalLmrfyy97eOTAKCV2tvk0F4xAYV1 xCLHwtNCiOu2+zi1uDBL5S1anX+wtHLncVazXX3W5JvFkPN0OQPVA0rmE/tUc8pLcqeJos 95hTtGeCtxwghPQENMmPyvLktABH5faeYY7lCpN/Pbjpd1Droul0XRi9/zcJ5FmPNkqW5n ptURoIKuJRTAbzllHx1TJVILJlYqnF/dFm6AOm8gtnDSaG7BwYV/VZu/TtQLUVi3mqTphZ xPUEWsKMKPjtwA/pONWUkPxF/xCImoURT3VZQywJxk6NCypz26kuTQmEMTIoSA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=kRf+7H2j; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=kRf+7H2j; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B4F2B2AFC4 X-Spam-Score: -0.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: 0jFOTMy8plFO --000000000000f19c2705d62e2a4c Content-Type: multipart/alternative; boundary="000000000000f19c2605d62e2a4a" --000000000000f19c2605d62e2a4a Content-Type: text/plain; charset="UTF-8" Thanks Nicolas for reviewing the changes! I applied the changes. Attached is the updated patch. On Fri, Jan 21, 2022 at 1:58 PM Nicolas Goaziou wrote: > Hello, > > Samim Pezeshki writes: > > > +(defcustom org-agenda-clock-report-header nil > > + "Header for org agenda clock report mode" > > + :group 'org-agenda > > + :type 'string) > > Please add :package-version and :safe keywords to the definition. > > Also, type does not match the default value. You probably mean > > (choice > (string :tag "Header") > (const :tag "No header" nil)) > > > + > > (defun org-agenda-time-of-day-to-ampm (time) > > "Convert TIME of a string like \"13:45\" to an AM/PM style time > string." > > (let* ((hour-number (string-to-number (substring time 0 -3))) > > @@ -4473,6 +4478,10 @@ items if they have an hour specification like > [h]h:mm." > > (setq p (plist-put p :tend clocktable-end)) > > (setq p (plist-put p :scope 'agenda)) > > (setq tbl (apply #'org-clock-get-clocktable p)) > > + (when org-agenda-clock-report-header > > + (put-text-property 0 (length org-agenda-clock-report-header) > 'face 'org-agenda-structure > > + org-agenda-clock-report-header) > > + (insert org-agenda-clock-report-header)) > > Maybe: > > (insert (propertize org-agenda-clock-report-header 'face > 'org-agenda-structure)) > > Could you send an updated patch? > > Regards, > -- > Nicolas Goaziou > --000000000000f19c2605d62e2a4a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks=C2=A0Nicolas for reviewing = the changes!

I applied the changes.
Attached is the update= d patch.


On Fri, Jan 21, 2022 at 1:58 PM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
Hello,

Samim Pezeshki <p= .samim@gmail.com> writes:

> +(defcustom org-agenda-clock-report-header nil
> +=C2=A0 "Header for org agenda clock report mode"
> +=C2=A0 :group 'org-agenda
> +=C2=A0 :type 'string)

Please add :package-version and :safe keywords to the definition.

Also, type does not match the default value. You probably mean

(choice
=C2=A0(string :tag "Header")
=C2=A0(const :tag "No header" nil))

> +
>=C2=A0 (defun org-agenda-time-of-day-to-ampm (time)
>=C2=A0 =C2=A0 "Convert TIME of a string like \"13:45\" t= o an AM/PM style time string."
>=C2=A0 =C2=A0 (let* ((hour-number (string-to-number (substring time 0 -= 3)))
> @@ -4473,6 +4478,10 @@ items if they have an hour specification like [= h]h:mm."
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq p (plist-put p :tend clocktable= -end))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq p (plist-put p :scope 'agen= da))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq tbl (apply #'org-clock-get-= clocktable p))
> +=C2=A0 =C2=A0 (when org-agenda-clock-report-header
> +=C2=A0 =C2=A0 =C2=A0 (put-text-property 0 (length org-agenda-clock-re= port-header) 'face 'org-agenda-structure
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0org-agenda-clock-report-header)
> +=C2=A0 =C2=A0 =C2=A0 (insert org-agenda-clock-report-header))

Maybe:

=C2=A0 (insert (propertize org-agenda-clock-report-header 'face 'or= g-agenda-structure))

Could you send an updated patch?

Regards,
--
Nicolas Goaziou
--000000000000f19c2605d62e2a4a-- --000000000000f19c2705d62e2a4c Content-Type: text/x-patch; charset="US-ASCII"; name="0001-lisp-org-agenda.el-Add-header-to-agenda-clock-report.patch" Content-Disposition: attachment; filename="0001-lisp-org-agenda.el-Add-header-to-agenda-clock-report.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kyq1kaa40 RnJvbSA2NjkxYWJkY2VmOTUxODFlYTk1MTdlMmMyYzYwY2E1MjQ0M2MxNGE2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTYW1pbSBQZXplc2hraSA8cHNhbWltQGdtYWlsLmNvbT4KRGF0 ZTogTW9uLCAxMCBKYW4gMjAyMiAxMjozMjo1MSArMDMzMApTdWJqZWN0OiBbUEFUQ0hdIGxpc3Av b3JnLWFnZW5kYS5lbDogQWRkIGhlYWRlciB0byBhZ2VuZGEgY2xvY2sgcmVwb3J0IHRhYmxlCgoq IGxpc3Avb3JnLWFnZW5kYS5lbCAob3JnLWFnZW5kYS1saXN0KTogQWRkIGhlYWRlciB0byBhZ2Vu ZGEKY2xvY2sgcmVwb3J0IHRhYmxlLgoKVElOWUNIQU5HRQotLS0KIGRvYy9vcmctbWFudWFsLm9y ZyB8ICA0ICsrLS0KIGV0Yy9PUkctTkVXUyAgICAgICB8ICAxICsKIGxpc3Avb3JnLWFnZW5kYS5l bCB8IDExICsrKysrKysrKysrCiAzIGZpbGVzIGNoYW5nZWQsIDE0IGluc2VydGlvbnMoKyksIDIg ZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvZG9jL29yZy1tYW51YWwub3JnIGIvZG9jL29yZy1t YW51YWwub3JnCmluZGV4IGI0YzIwZjI1Mi4uMmM1NGZkZTg3IDEwMDY0NAotLS0gYS9kb2Mvb3Jn LW1hbnVhbC5vcmcKKysrIGIvZG9jL29yZy1tYW51YWwub3JnCkBAIC05NzQyLDggKzk3NDIsOCBA QCB0aGUgb3RoZXIgY29tbWFuZHMsIHBvaW50IG5lZWRzIHRvIGJlIGluIHRoZSBkZXNpcmVkIGxp bmUuCiA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