From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id c3ZVDdfPNWBALgAA0tVLHw (envelope-from ) for ; Wed, 24 Feb 2021 04:02:31 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0HSjCNfPNWAcJgAAB5/wlQ (envelope-from ) for ; Wed, 24 Feb 2021 04:02:31 +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 DC0A928F5C for ; Wed, 24 Feb 2021 05:02:30 +0100 (CET) Received: from localhost ([::1]:33720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lElNc-0002bo-VX for larch@yhetil.org; Tue, 23 Feb 2021 23:02:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lElNA-0002aM-6I for emacs-orgmode@gnu.org; Tue, 23 Feb 2021 23:02:00 -0500 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:33572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lElN8-0000ro-6B for emacs-orgmode@gnu.org; Tue, 23 Feb 2021 23:01:59 -0500 Received: by mail-lf1-x134.google.com with SMTP id u4so981663lfs.0 for ; Tue, 23 Feb 2021 20:01:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dgrN3ym3a7qL6k1K1xtXq1xOi7W+DaSJuEcAneCc10s=; b=EuAZpwpSkOuiQTSgaS+M7Yb6uQ3BFoFJk0J+PoU1uDIhCfsqjRs2P2LbBClWp+z9eh YtLW00+UnuRknD80eYE0UAHMy/EdOTwNdytXpOfdJ83oOxpHSiNzBBqNMbZlfEHrg9om uUT/8GykmVmI8UX43A/hCikVMWHQJuM1fR4e4r2zB5ZS3TY9ip+32putEpnFkpfWotmS YlLzb/wzRH/yhLoMpGUS10A3r32ZtzOE1L+2A33MxVQnTe2hvxZ5fmkWRcyJn120Us97 A9DEYSRvD+SyFUjN5ysgCeKpkNoct1RHYfPMxUjidN6U4q7+en6Zp9K/hCsSYVBeW+rh YnCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dgrN3ym3a7qL6k1K1xtXq1xOi7W+DaSJuEcAneCc10s=; b=QOypplaqluapejoPkykGWI0l1TTZuNhvdOVLgATZODB6OGKtcCCwWEqI6CZ+Kz4Pgy tTv1Qih49BRBPViGmXxMEHSSBDVQw1FUHRHiaixizxknCqPqQP3zNisev89DD6W2lcXP cuF2c7eAPqTONKJoYLy0dk56QpExl2zcuMyhkUOGt4TCD0GSF7xo9RlMXM33s185oPcP kMaRvDk3Gf4TNv0B+WS09Bqau7ufe24Dxep7iyL9PSHBj1o2LMpiQYllJjX+hF1MrEWs Djn1Me7zVQK5FHZ7r+m8sfq1YSCWbjH5LgZmOiCnzB3iu9do6i7oxipz5Dd6TqI6GVJG WVPA== X-Gm-Message-State: AOAM530tUXPm8oTs9iXlyVxiuRYLZAQ39K1375G7Naaw7gcXWROxJL7I 6Dzw6mdVGFxhUW4go6PB5TLIQYAN8OL4f5INVwU= X-Google-Smtp-Source: ABdhPJwL833UDKkL/JspNYbRQJoNKa3XNzJuwq4wnATsEK0Pjqq95OACy6nqagIQ9w3nevITBHSAkxBwJsGGRHmjyrU= X-Received: by 2002:a05:6512:110a:: with SMTP id l10mr19228318lfg.140.1614139315671; Tue, 23 Feb 2021 20:01:55 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6504:40c8:0:0:0:0 with HTTP; Tue, 23 Feb 2021 20:01:55 -0800 (PST) In-Reply-To: <87ft1mw2nb.fsf@kyleam.com> References: <87k0qywbtb.fsf@kyleam.com> <87ft1mw2nb.fsf@kyleam.com> From: Samuel Wales Date: Tue, 23 Feb 2021 21:01:55 -0700 Message-ID: Subject: Re: Using lexical-binding To: Kyle Meyer Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=samologist@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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_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: , Cc: emacs-orgmode@gnu.org, Stefan Monnier Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: DC0A928F5C X-Spam-Score: -4.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: zqsstHfnkyVN just a thanks to maintainers of emacs and org including those of you fixing this and those who wrote the tests. i had no idea org wasn't fully lexical yet. i look forward to whatever good that brings. On 2/23/21, Kyle Meyer wrote: > Kyle Meyer writes: > >> Stefan Monnier writes: > [...] >> ;; (org-agenda-list) ; fails: void-variable date >> >> There are also some `make test' failures: >> >> 7 unexpected results: >> FAILED test-org-agenda/diary-inclusion >> FAILED test-org-agenda/empty >> FAILED test-org-agenda/one-line >> FAILED test-org-agenda/scheduled-non-todo >> FAILED test-org-agenda/set-priority >> FAILED test-org-agenda/sticky-agenda-name >> FAILED test-org-agenda/sticky-agenda-name-after-reload >> >>> or "pretends everything is fine but doesn't do the right thing any >>> more", or (even better) actual feedback about the code itself and the >>> approach(es) I chose to use. >> >> While I'm not sure I can provide any useful feedback about approaches, >> I'll see if I can tweak your patch to resolve the org-agenda-list >> failure or any of the above test failures. > > With the changes below on top of your patch, the simple org-agenda-list > call from above works and the test failures are gone. > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index 16ec70c77..81409d6ac 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -5448,27 +5448,29 @@ (defun org-agenda-get-day-entries (file date &rest > args) > (setf args (cons :deadline* (delq :deadline* args))))) > ;; Collect list of headlines. Return them flattened. > (let ((case-fold-search nil) results deadlines) > - (dolist (arg args (apply #'nconc (nreverse results))) > - (pcase arg > - ((and :todo (guard (org-agenda-today-p date))) > - (push (org-agenda-get-todos) results)) > - (:timestamp > - (push (org-agenda-get-blocks) results) > - (push (org-agenda-get-timestamps deadlines) results)) > - (:sexp > - (push (org-agenda-get-sexps) results)) > - (:scheduled > - (push (org-agenda-get-scheduled deadlines) results)) > - (:scheduled* > - (push (org-agenda-get-scheduled deadlines t) results)) > - (:closed > - (push (org-agenda-get-progress) results)) > - (:deadline > - (setf deadlines (org-agenda-get-deadlines)) > - (push deadlines results)) > - (:deadline* > - (setf deadlines (org-agenda-get-deadlines t)) > - (push deadlines results))))))))))) > + (org-dlet > + ((date date)) > + (dolist (arg args (apply #'nconc (nreverse results))) > + (pcase arg > + ((and :todo (guard (org-agenda-today-p date))) > + (push (org-agenda-get-todos) results)) > + (:timestamp > + (push (org-agenda-get-blocks) results) > + (push (org-agenda-get-timestamps deadlines) results)) > + (:sexp > + (push (org-agenda-get-sexps) results)) > + (:scheduled > + (push (org-agenda-get-scheduled deadlines) results)) > + (:scheduled* > + (push (org-agenda-get-scheduled deadlines t) results)) > + (:closed > + (push (org-agenda-get-progress) results)) > + (:deadline > + (setf deadlines (org-agenda-get-deadlines)) > + (push deadlines results)) > + (:deadline* > + (setf deadlines (org-agenda-get-deadlines t)) > + (push deadlines results)))))))))))) > > (defsubst org-em (x y list) > "Is X or Y a member of LIST?" > @@ -6710,6 +6712,7 @@ (defun org-agenda-format-item (extra txt &optional > level category tags dotime > (get-text-property 1 'effort txt))) > (tag (if tags (nth (1- (length tags)) tags) "")) > (time-grid-trailing-characters (nth 2 org-agenda-time-grid)) > + (extra (or (and (not habitp) extra) "")) > time > (ts (when dotime (concat > (if (stringp dotime) dotime "") > @@ -6793,7 +6796,6 @@ (defun org-agenda-format-item (extra txt &optional > level category tags dotime > (concat time-grid-trailing-characters " > ") > time-grid-trailing-characters))) > (t "")) > - extra (or (and (not habitp) extra) "") > category (if (symbolp category) (symbol-name category) category) > level (or level "")) > (if (string-match org-link-bracket-re category) > > -- The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html