From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +Iy4K8KU/2GufQEAgWs5BA (envelope-from ) for ; Sun, 06 Feb 2022 10:28:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id KFppKMKU/2FzkAAAauVa8A (envelope-from ) for ; Sun, 06 Feb 2022 10:28:34 +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 5DDB3F87F for ; Sun, 6 Feb 2022 10:28:34 +0100 (CET) Received: from localhost ([::1]:34192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGdqT-0006se-GU for larch@yhetil.org; Sun, 06 Feb 2022 04:28:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGdlY-0004qh-3Y for emacs-orgmode@gnu.org; Sun, 06 Feb 2022 04:23:28 -0500 Received: from [2607:f8b0:4864:20::636] (port=33392 helo=mail-pl1-x636.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGdlW-0001gP-7b for emacs-orgmode@gnu.org; Sun, 06 Feb 2022 04:23:27 -0500 Received: by mail-pl1-x636.google.com with SMTP id k17so8969906plk.0 for ; Sun, 06 Feb 2022 01:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=HDY1c1c88Bo6fUCv0M2vG29Mjh9ZSP+V7YKZSw4+reI=; b=b1JuHNbZBALFrvWdvUXnU9CRzR2XWmtfCX/PRN1Ivnuyd9YxacoYMbomDGh7acOEM0 Ea2H/tXz5Zjm6tLkeq/6a6TGuCkqDd5AGe0ybqxly3EWUPuCsvg5E0s66VRiIqO0RzEA vt0n/ymF52HlPMOeV/Wo7/WPFXMCHw6zWf1enOG1izhI5o1LToWqVmQd+uaXOH3Uk58k ESjUS4Twvy8qFn7SDd5JsB7oRuDImOKzWo/luy1QU8v9OwAbEOaA9DNFw01f0Yvlo6fx NDSnpUrXZ3GFzZx5GlK9Q2HdFSINv74R8MkafbOqk/ASmkjZTRR+MHJLnqWnu6EoJ6Qk GXNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=HDY1c1c88Bo6fUCv0M2vG29Mjh9ZSP+V7YKZSw4+reI=; b=oDJVIPD9/o4T7c4w9a0S8qb85t4UCMxrE78GgahPGVvpcs7eWqYrr+RlB2IOSMNxzH FL2GAFZ/OdI60wx5W/R5itnLXJDGcKa4x3k7fg2EykvfZ0CZ1CgliPDwYIpbsfhzUXJk 0BA8pp8DGUsfvV9GeTzUFAujkJYayr9n5ASA8eDDOqw+AhMwYDodJgKK7jtVLT6La95Z mKNG3YdIrkq71xfsKp4LY9pz4c4C8/yAEjI2n5/leovy/yScWsZcaflqWi1yQsszBYnU 09C4QqgEFflpjahfyRymdIN8Ar9xIua4kAwxeX+KG37Y89eIlA8ozh4tcnwioLqxPp7D FZvw== X-Gm-Message-State: AOAM533Wqq1mKjPPgtHIqO8lk+dfLn/yCPsO2s+NK2g4PzZXr6N3eKTi 6AQ9VYn2Uv9Gggnh14b8URw= X-Google-Smtp-Source: ABdhPJzNVbMwpe4kAvEid/07CkdFfCNEqSlzrQ6JqOsNzLwPrSGub6gh9JpZT2VcspE7gQUj1FrMgQ== X-Received: by 2002:a17:903:18d:: with SMTP id z13mr11278753plg.49.1644139404408; Sun, 06 Feb 2022 01:23:24 -0800 (PST) Received: from localhost ([103.125.234.62]) by smtp.gmail.com with ESMTPSA id j15sm8670141pfj.102.2022.02.06.01.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 01:23:23 -0800 (PST) From: Ihor Radchenko To: Samim Pezeshki Subject: Re: [PATCH] org-agenda: Skip formatting if format string is "" In-Reply-To: References: Date: Sun, 06 Feb 2022 17:28:30 +0800 Message-ID: <87v8xsuywx.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::636 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=yantar92@gmail.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=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, 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644139714; 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=HDY1c1c88Bo6fUCv0M2vG29Mjh9ZSP+V7YKZSw4+reI=; b=XcK/5seTQaD0PP90OLJr3oW2ZtnWxriGEhE3X/c1K3pJpO11ICcdfY3aBBiV5sNqjq6Cxq rT8Yn9uAza3pxcI6hjzDA6sGECrwaRIiOfyOAh6jCofZBK5yOkPNy6mos1CGUMQITx03lo +zxEE05wfmpN7r0r/y4V4GVIsB10CvJQr9dTRhCCB9QI5Am9MD6XxHc/Q0uQnMYcLTpvI8 Y5Dh472bcK6zp1U0QS1gfjL8k3ARkDeViiwhsPXftoPa4tWgiS6CiYn1VS6BT/DiPItLt7 11H8kG5/QVijY3OtihTwzk2C9p1vaEDmcgj4Be/ETx3D2ARjMaeZNSON4ebPGg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644139714; a=rsa-sha256; cv=none; b=TWCnp06nnrx4xAph227S0RT+tNr9QQODT8UpprDyaw3b5DAsNMazVGQgjWHOZtp9Dhwzk4 FaZYrdZdCRlSEQASgs1KzBbOB4FZaWqZh/E6yWnoQ7S+mI6bdGyH6PEchJDmT1jdMZi8Jr y87NO95QALD2x2B6FamCj+Kf95Ap5nJGki8pfdzyYFF6LWj7NMHTOHnZNDvFHuIuQ8iOt+ 73DVwSKF80dfpSIqgnIgzvP+mZ/zxGQAa4A/h+hO2HdVIDmVxnJO0qmH6N+6S3R/v6wibQ /jkzSC18Blk/edYcyt9UXArSjwUGcvQAzSRkb6cm+Q074sYWBGYB8rhFfk1ymA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=b1JuHNbZ; 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: -3.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=b1JuHNbZ; 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: 5DDB3F87F X-Spam-Score: -3.83 X-Migadu-Scanner: scn1.migadu.com X-TUID: uBJTL31EGeBq 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