From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eAxIAVLdMGJbYAEAgWs5BA (envelope-from ) for ; Tue, 15 Mar 2022 19:39:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2FmeOVHdMGKMbwAAauVa8A (envelope-from ) for ; Tue, 15 Mar 2022 19:39:13 +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 6C98B3DBFF for ; Tue, 15 Mar 2022 19:39:13 +0100 (CET) Received: from localhost ([::1]:57206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUC4e-0000a6-HP for larch@yhetil.org; Tue, 15 Mar 2022 14:39:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUC1g-0000YY-S8 for emacs-orgmode@gnu.org; Tue, 15 Mar 2022 14:36:09 -0400 Received: from [2a00:1450:4864:20::62b] (port=33730 helo=mail-ej1-x62b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUC1f-0004X1-B2 for emacs-orgmode@gnu.org; Tue, 15 Mar 2022 14:36:08 -0400 Received: by mail-ej1-x62b.google.com with SMTP id pv16so4040249ejb.0 for ; Tue, 15 Mar 2022 11:36:06 -0700 (PDT) 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=OAnnCUW6OeLiJ259BAjvcq6LB7zAQN/vJEQdFYifV4c=; b=fyZP8z5NdpDadUZzLcaurDjsh2v3pRO1nh9fk3to2z1Fz9nSGN3jL+LtB3IplhOfTS gk1konZV6sbAD4C2xg/QciHj6h2p+oYLFGu34ENz5aZjqVJ6nPAAWxhurSys07cm70fE /4lgaXLC/uvsxdRdEfiNs6gfVz9UfAgFd+EGcizDXJ0xEj6nDjA+NCVn2+xyPnhmq6ju zbXqK9EnUygdGf6TC0a3tXLQ4RPG75/Ef789CUiKA+QiDtY0zwVKI371b9j4B+DixK/d NAps2H85meWkUyr3pCSl1PkQ0WqXJReMr42I9YymSCS2bC6I00FmCGKS4OcBnVxjDdkB 4PEw== 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=OAnnCUW6OeLiJ259BAjvcq6LB7zAQN/vJEQdFYifV4c=; b=IBMcwfE4o04a+6lgiXGwEMtbvmwj4mO368GWNHdLQ4lrmYVcFXnuoT3dbGsFXtqx6M A4NCSk5S1dEdDZGZUaNtm6GabdfTrDuW1Er+pYIeHORSai2ze5t3HlFy0Yj81whcnn6q kj7CxMmZLuH+Tstj99uKTrpiYRLknLp8vBXNImhBD8f8Rz5zJv+zRslTyJxHhj0ExqP9 Ltta8o0Qffi8TtESGUG9Lo9XyPEqHDZhm0KQQ5KQ3IuiZD+HY+Pmj5UIPU/j2mrgxG/c xMIgchrXbeVtEDVr8WNyb5BDbJ3/iionYJ7t+nC0OG4gmaKpphCJGn1/dSTJl1W53uOD fsdA== X-Gm-Message-State: AOAM5318nNR40kEYdH8YbHZm+fwv/dL4jQGfVduq4ZHI0RjenMhpNyRd wB++bjL+gTbSmqIsxPB9lyWvCTp3QAui/105Bm8= X-Google-Smtp-Source: ABdhPJyLdmvg9+raR8ZLStO1Qct/5dflKvWdGP8hf3KOttSXm4wxH2ODiMWr7i7w/NT7buU53y5AVx3UnAVmdEC4Zdo= X-Received: by 2002:a17:907:1b15:b0:6d7:13bd:dd62 with SMTP id mp21-20020a1709071b1500b006d713bddd62mr23659442ejc.673.1647369365017; Tue, 15 Mar 2022 11:36:05 -0700 (PDT) MIME-Version: 1.0 References: <87v8xsuywx.fsf@localhost> In-Reply-To: From: Samim Pezeshki Date: Tue, 15 Mar 2022 22:05:53 +0330 Message-ID: Subject: Re: [PATCH] org-agenda: Skip formatting if format string is "" To: Ihor Radchenko Content-Type: multipart/alternative; boundary="000000000000d0d75605da461180" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::62b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=p.samim@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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, Nicolas Goaziou Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647369553; 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=OAnnCUW6OeLiJ259BAjvcq6LB7zAQN/vJEQdFYifV4c=; b=p2QTpxD9rcya0R2zPRR9ssdE2OG0UTLAHLkOQ+P3kzwqNxgV57+cmG9KTV9JzrOsaGlIxT U4XQcLMtRZH1SkaXzwRKD+z7IS5IfSWpJeQ5tqV4hIryd2maKVljIFSBGgia2Nh8SUFOUk f3Ix5urrwgrQk1+TaXUfPbnutxFVel8D6VCLiy0mNLoweoubA8ljkihhpzPFR8Fj5YiH3W OizzPmHKxH/vfQg6YnDPsIC7+PIT7RlXSTXiW38t3VudkIaJj6SD2ePLIk/bqTV289u9Up E3RpykNCPesWQWyhNiuxITFn2shEPrc9ivVmWV4WLbn0KPCfXwtRFTILW2B6MQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647369553; a=rsa-sha256; cv=none; b=NydtvLiTDEE+ekVafx+ucOaZgL+OuNMUH6g82zFL08AvVCBsTK7i6Q+W9eDUFlppbrpFH6 l9GwwJmZqX+nCsygAGSRbO8JS00XdXsrgx/i2GmcTbrQMNs0aGvpVqj5jc2zP1tl+AZ9ez x+gxsTbWCalbNDCfJfqcMVAsVJcAW8ImtaR0QB3UcwdYs5zUQWP8YN3SVB8+COuV9+LnqA 1v4aQJmrNnnbPDDFk9vE3cwLtxxmkLG6BVTdwJPGUjJxNcL30BWHlUXiOI/faO7PvvXrtE pbHmChK18jznYMViFNYxG9HJ0YG10dlT0IqSnpaTi1IdnMVFLYtdsObd1PIRoA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fyZP8z5N; dmarc=pass (policy=none) header.from=gmail.com; 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: -4.16 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=fyZP8z5N; dmarc=pass (policy=none) header.from=gmail.com; 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: 6C98B3DBFF X-Spam-Score: -4.16 X-Migadu-Scanner: scn1.migadu.com X-TUID: F5GHQ7qwZLyi --000000000000d0d75605da461180 Content-Type: text/plain; charset="UTF-8" Hi! Is there anything I need to do for this to be merged? Thanks On Wed, Feb 9, 2022 at 10:44 PM Samim Pezeshki wrote: > Thanks Ihor for the detailed explanation, > I updated the patch as you suggested. > > On Sun, Feb 6, 2022 at 12:53 PM Ihor Radchenko wrote: > >> Samim Pezeshki writes: >> >> > This commit prevents having extra spaces when the TODO format string is >> an >> > empty string (""). It was not working properly, with this patch now it >> > works correctly. >> >> Thanks for the patch! >> >> > (concat >> > (substring x 0 (match-end 1)) >> > ... >> > + (unless (string= org-agenda-todo-keyword-format "") >> > + (format org-agenda-todo-keyword-format >> > + (match-string 2 x)) >> > + ;; Remove `display' property as the icon could leak >> > + ;; on the white space. >> > + (org-add-props " " (org-plist-delete (text-properties-at 0 x) >> > + 'display))) >> > (substring x (match-end 3))))))) >> > x))) >> >> Your patch will unconditionally hide todo keywords in agenda even when >> org-agenda-todo-keyword-format is not empty. This will happen because >> (unless ...) form will only return the last " ", but never the keyword. >> >> You should better wrap the (org-add-props ...) with another unless >> condition. >> >> Best, >> Ihor >> > --000000000000d0d75605da461180 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi!
<= br>
Is there anything I need to=C2=A0do for th= is to be merged?

Thanks

On Wed, Feb 9, 2022 at 10:44 PM Samim Pezeshki <p.samim@gmail.com> wrote:
Thanks Ihor for the detailed explanation,
I updated the patch as you suggested.

On Sun, Feb = 6, 2022 at 12:53 PM Ihor Radchenko <yantar92@gmail.com> wrote:
Samim Pezeshki <p.samim@gmail.com> writes:

> This commit prevents having extra spaces when the TODO format string i= s an
> empty string ("").=C2=A0 It was not working properly, with t= his patch now it
> works correctly.

Thanks for the patch!

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(concat >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (substri= ng x 0 (match-end 1))
> ...
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0(unless (string=3D org-agenda-todo-keyword= -format "")
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(format org-agenda-todo-keyword-for= mat
> +=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=A0 =C2=A0 =C2=A0(match-string 2 x))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Remove `display' property as= the icon could leak
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; on the white space.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-add-props " " (org-p= list-delete (text-properties-at 0 x)
> +=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=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 'display)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(substring x (match-end 3)))))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 x)))

Your patch will unconditionally hide todo keywords in agenda even when
org-agenda-todo-keyword-format is not empty. This will happen because
(unless ...) form will only return the last " ", but never the ke= yword.

You should better wrap the (org-add-props ...) with another unless
condition.

Best,
Ihor
--000000000000d0d75605da461180--