From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QMD5FJwKT2B+LgAA0tVLHw (envelope-from ) for ; Mon, 15 Mar 2021 07:19:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id eLrLEJwKT2BUIQAAbx9fmQ (envelope-from ) for ; Mon, 15 Mar 2021 07:19:56 +0000 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 543611DF81 for ; Mon, 15 Mar 2021 08:19:55 +0100 (CET) Received: from localhost ([::1]:44040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLhW5-00063Z-3h for larch@yhetil.org; Mon, 15 Mar 2021 03:19:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLhV0-000633-R7 for emacs-orgmode@gnu.org; Mon, 15 Mar 2021 03:18:46 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:36495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLhUx-0005Z7-NI for emacs-orgmode@gnu.org; Mon, 15 Mar 2021 03:18:46 -0400 Received: by mail-lj1-x229.google.com with SMTP id z25so14948495lja.3 for ; Mon, 15 Mar 2021 00:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version:content-disposition; bh=yuJYxjjeybgp1d5gEuSJ+fw+3MoT8hO2CfWM2upgNbk=; b=j6a1hyKf3t8XDIQiddq7osfa4f/mkBaZ6PtDj3NJ1WJyNARC0VHeDQrYGgav0vtKL2 9gZx7r5O0EuMCsF0JziAGOC84HlgG2evPk1U9DFmR+1KBD7zIjULC7q8APsnIPiDOLeJ PXy+LBu4RBxsoxEFDSDMI5Ow3ADaPBIsh/KOrz3e/PUVJnmQdMl+vkdo+xQWGZlpszBl x7wtnEEYER2F/GJLnSMxatEXKZghpEVllAluQaVYkN/o1b9GiPYkr/wVn1Gd+QnGBLiz HF2jC3igrc9DyjbD+q8ahzAjyB7eIvo+Hx1Qsxn8x4jJkAxgbiEI/N0jBtPTHjl0YfOB k5wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-disposition; bh=yuJYxjjeybgp1d5gEuSJ+fw+3MoT8hO2CfWM2upgNbk=; b=m291JMfYzSQxD2Asl7Ajz7riXo+dFYm1fpnRxusSgeZTScdzR01jV5P0dOweArgTxW 2D8AK1E7Fz8vm9Okv9PSB8T25O7LRdeBmLFQI+8ogSsl5kALypyu9KIjpNOIWP53p5WA UCmmJ9aK6w3klyHj6oxLJxvnjmsEmO8QHQAXEhh5TJNZGYliVmNl7w0vRl5nFDxAeETH SquI/KMY0TCT4A6GjuYVIz/4qpptjtBFAJG7GVWydZE9XosS9ggtkjIC+6Dek3jRNkvu T0v38h/vjS+5ucKMzV+Cc+52K5XYaHrB+hVDf8ZFAo06LcpdD1Jaok+9VHYJfT/hL1Yp zwSw== X-Gm-Message-State: AOAM530B/+MfptYOC5zfHUCmm1GTMlfZT6/tRV/hQwN+tdU6qYXpHmjT cA28e9ktj/5WZSeOBiniPUBUkdRmFjgemQ== X-Google-Smtp-Source: ABdhPJzxd3aqZGaAd642lTTBL7KACqXTyPFdTmaxLyDUBgb1rMxIoiyy48bCetWbH2IMZrk46/hUzg== X-Received: by 2002:a05:651c:85:: with SMTP id 5mr9976185ljq.470.1615792720923; Mon, 15 Mar 2021 00:18:40 -0700 (PDT) Received: from localhost ([158.255.2.2]) by smtp.gmail.com with ESMTPSA id l29sm2584325lfp.63.2021.03.15.00.18.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 00:18:40 -0700 (PDT) From: Ihor Radchenko To: emacs-orgmode@gnu.org Subject: [PATCH] Allow multiple %(expression) instances in org-agenda-prefix-format Date: Mon, 15 Mar 2021 15:22:45 +0800 Message-ID: <87k0q8rid6.fsf@localhost> MIME-Version: 1.0 Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Allow-multiple-expression-instances-in-org-agenda-pr.patch Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=yantar92@gmail.com; helo=mail-lj1-x229.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615792796; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=yuJYxjjeybgp1d5gEuSJ+fw+3MoT8hO2CfWM2upgNbk=; b=NEiykzjvGKZDY2In0GtpjA2aRNms3ihA6RJ+doLy4VeAgEZEtAzwfWV7zwyEF0jr+pu0W8 D5G0dNfQFjcmdD/6N1SXKHSMb+846O+Ivi8uHQ8yfCKCbhyYe+syhsOHwe/fIFg4ANDymB aKOMduNOcUh92dAneT6qK8C57NHIEdVZIrdobIP/JEncrBtlk+CwFyp6B6QEw4AuVT6JLR dI4rFQ6rXOUCC00LRElHuRBjIgcB0N1hNTEG4dCRnbPbkvf3/C6ZUizbGUViaK38gdQFRq cwATVzD13L3l0kSfKmfob+56CWc/zB2eEElOxVNOAPtvCMFDl+X62lj0mXjfjQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615792796; a=rsa-sha256; cv=none; b=OveWQaUAgqIpDL6H9ozrohe6tTBq5IZn8vliD56Rq/JVHQTh9zDemhmYrzDN0MdS+4uh5d K/lwtDmHdfIghJgytZlf1G1AnC7YgNwrm4hOpI2m0IjiVU5xwHtt+sKt7D6I0w9mghIUMV 1+2Vlz0Vf2HVWeaYr/9+BOEIvuwIGadghP1GnpOlhnbV89dlOlD2KG3TbBZePdcGKYPem2 xeiDYh3SZ0HQya2luQzK+cFr8i0K+mzIyMS2HwVZVHfuY+Xafh1p/hk8tcDLTt9cFtqE8j 5wSjY7OJTm3iwLK86jUq85Cx/j4kq7yuYd86XQiJJyPF5SBlOvROFNM+9890UA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=j6a1hyKf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.60 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=j6a1hyKf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 543611DF81 X-Spam-Score: -2.60 X-Migadu-Scanner: scn0.migadu.com X-TUID: QsJHxpZPeJT6 >From ae1e4041f77d056649b8fa90d12e2cd1354b78f3 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Mon, 15 Mar 2021 15:18:20 +0800 Subject: [PATCH] Allow multiple %(expression) instances in org-agenda-prefix-format * lisp/org-agenda.el (org-compile-prefix-format): Use non-greedy match for %(expression). Previously, format like "%-12.12s%(expr1) %(expr2)" would not be parsed correctly because of greedy "(.+)" regexp used to match the expressions. --- lisp/org-agenda.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 50a9b3dbd..8bd328e6d 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6929,7 +6929,7 @@ and stored in the variable `org-prefix-format-compiled'." (t " %-12:c%?-12t% s"))) (start 0) varform vars var c f opt) ;; e - (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cltseib]\\|(.+)\\)" + (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cltseib]\\|(.+?)\\)" s start) (setq var (or (cdr (assoc (match-string 4 s) '(("c" . category) ("t" . time) ("l" . level) ("s" . extra) -- 2.26.2