From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oKpxFjik4WNR3gAAbAwnHQ (envelope-from ) for ; Tue, 07 Feb 2023 02:07:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SGi8FTik4WMgQAAAG6o9tA (envelope-from ) for ; Tue, 07 Feb 2023 02:07:04 +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 6B8E7264D for ; Tue, 7 Feb 2023 02:07:03 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPCR2-0000uM-3X; Mon, 06 Feb 2023 20:06:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPCQy-0000tf-Ga for emacs-orgmode@gnu.org; Mon, 06 Feb 2023 20:06:09 -0500 Received: from mail-qt1-f169.google.com ([209.85.160.169]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPCQu-0005LL-J8 for emacs-orgmode@gnu.org; Mon, 06 Feb 2023 20:06:08 -0500 Received: by mail-qt1-f169.google.com with SMTP id g8so15105213qtq.13 for ; Mon, 06 Feb 2023 17:06:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b3CAQ4gYs/8tM3a8wTSyfHbAI6xgcjDPAlFOevSexoI=; b=iB4FUjDAsFEjgp2E2oB3UG9k0eq8jH52MO017OeXiRJXPlnRhfmB8W3OlWwRsKrjUx V3Pary7eVCMLVn0zX4uSxdQ/WKXHRM4yR2m7NrGG5Bq9BigU6997osJ+t5xrYCiSBD/4 yBidZ8BzShTJZZeAGcIzB+VFUfAmzg/j7RkTSKydEZusCVi900y+mkYWlP6fl3g+4DlF jHgpMc6QHTOfYpxGVxIfLBjitS5VY0x6LnpBwU+cmKY0QZIu4miVYwai6/ipjxnf4GC7 cFALp4WTJEHmhT6MameomrnIe7ZNvOWIvZRL5LAWnnn4sfTwGX07v4UEazWx6CgZoVad WBxA== X-Gm-Message-State: AO0yUKXnKW4qmPjqqF5sopoCi9bbGb/0j3dsRhboyLqF5N3Z01R4aX7U F9pswrkTw1+Fyk4M3N4KnYg6ojZ61v8= X-Google-Smtp-Source: AK7set9WBHAh3V134IAjqSY6rQ0Tr4XDnjDlxObmETvBIMpGMdEPArNFhOwNQhUWx+ZLmoYjyiaQOg== X-Received: by 2002:a05:622a:611:b0:3b9:bcac:725b with SMTP id z17-20020a05622a061100b003b9bcac725bmr2792276qta.22.1675731961547; Mon, 06 Feb 2023 17:06:01 -0800 (PST) Received: from localhost.localdomain (pool-98-113-163-150.nycmny.fios.verizon.net. [98.113.163.150]) by smtp.gmail.com with ESMTPSA id u6-20020ac80506000000b003afbf704c7csm8322132qtg.24.2023.02.06.17.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 17:06:00 -0800 (PST) From: "Aaron L. Zeng" To: emacs-orgmode@gnu.org Cc: "Aaron L. Zeng" Subject: [PATCH] org--batch-store-agenda-views: Fix treatment of lambda functions Date: Mon, 6 Feb 2023 20:05:34 -0500 Message-Id: <20230207010534.1697261-1-me@bcc32.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=209.85.160.169; envelope-from=zeng.aaron.l@gmail.com; helo=mail-qt1-f169.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675732024; a=rsa-sha256; cv=none; b=U7KkkMDOi/CbWpJ/CHg32BSw+4Q5BTh1LLn5iD19fWGKdoQGQR+QvNgCJe1R9iEYcsqwJ/ yKLEUbHqcTouC7AOqBBdYxQR5d7c9zIw4+12YW457B4ZOj4lAJd/Ip1qA2b2GL6QGVsdpY fZesRbCEbKywRAuEFnMrnRr0UrNeA5ri58M5lC/XM8SzKKsF+lFHXqK4bkGbGyotibn5oR ljUy9l9iAB5goxzWr7Mx630PQmBqyrpcyiLLVF0vBhmtYkkaiN7N4J9oCv0udlURluEixA DS8UHWjhac3sVkCrB79mCnd4cb8CieZ6owh20tK5b8pgnAuvRuNVxITpJD91+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675732024; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=b3CAQ4gYs/8tM3a8wTSyfHbAI6xgcjDPAlFOevSexoI=; b=QxJd9agEINmwFoekVJh2UluFHPOvtuIFwXq+3Tp1/D3Pxs/tNwbnyKfPk24yLpOKS86Qtc qYjjGBJ16OHFuIe2UHdREf0w0dTL+YB5cokvHaEZb9aAvLged0NL9ztxwi1+QfbRn3xV2P MwOkKlXl+TXpp2VklQ9jct5rEAsp6E+HFqABCyjFiw//WFbAZrCiRzNtLKSWg23RW+9pz1 iAzP4atNMTfuwsAshUyI5b/0GhBgnDKl+nEhGHIja4rYegjsy9dGXi8rq4ghMIK8PFu/1O 39v4n9DyrV+m9kpd5cnkAEucn81JcooEmPap3aODWUr7okkZA6cx3OvTIT34/w== X-Migadu-Queue-Id: 6B8E7264D X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=none X-Migadu-Spam-Score: -2.19 X-Spam-Score: -2.19 X-TUID: VRdQMZ/dUYv9 `org-agenda-custom-commands' entries may specify a custom function instead of a symbol like `tags-todo'. `org--batch-store-agenda-views' behaved differently from `org-agenda' when that custom function was defined as a lambda rather than a symbol, incorrectly treating the lambda form as a list of agenda commands. This patch makes `org--batch-store-agenda-views' use the same test as `org-agenda' does to determine whether the command is a series. --- lisp/org-agenda.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 1d1f2271b..1aab64820 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3525,7 +3525,8 @@ This ensures the export commands can easily use it." (let ((cmds (org-agenda-normalize-custom-commands org-agenda-custom-commands)) (pop-up-frames nil) (dir default-directory) - cmd thiscmdkey thiscmdcmd match files opts cmd-or-set bufname) + cmd thiscmdkey thiscmdcmd match files opts cmd-or-set + seriesp bufname) (save-window-excursion (while cmds (setq cmd (pop cmds) @@ -3538,8 +3539,9 @@ This ensures the export commands can easily use it." (format "*Org Agenda(%s)*" thiscmdkey)) org-agenda-buffer-name) cmd-or-set (nth 2 cmd) - opts (nth (if (listp cmd-or-set) 3 4) cmd) - files (nth (if (listp cmd-or-set) 4 5) cmd)) + seriesp (not (or (symbolp cmd-or-set) (functionp cmd-or-set))) + opts (nth (if seriesp 3 4) cmd) + files (nth (if seriesp 4 5) cmd)) (if (stringp files) (setq files (list files))) (when files (let* ((opts (append org-agenda-exporter-settings opts)) -- 2.38.1