From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0OqhDG33018LMwAA0tVLHw (envelope-from ) for ; Fri, 11 Dec 2020 22:49:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kApxCG3301+PMgAA1q6Kng (envelope-from ) for ; Fri, 11 Dec 2020 22:49:17 +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 940249400BF for ; Fri, 11 Dec 2020 22:49:16 +0000 (UTC) Received: from localhost ([::1]:47196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knrDt-0006Zc-9q for larch@yhetil.org; Fri, 11 Dec 2020 17:49:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knqoN-0005uF-O7 for emacs-orgmode@gnu.org; Fri, 11 Dec 2020 17:22:51 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:52211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knqoM-0003B1-3b for emacs-orgmode@gnu.org; Fri, 11 Dec 2020 17:22:51 -0500 Received: by mail-wm1-x331.google.com with SMTP id v14so8755815wml.1 for ; Fri, 11 Dec 2020 14:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=hRS+X0KWlSP33Dli2Fh9lKcgnCWn2S5/yWTvmwZNDPw=; b=T9n5N3WDqPNzGqvRBJ5oMWE7lvdhv4E0BRNPxIkrkiY1pOKECj+gvISJfNDFKuGnM/ WYrICRGixub1jbXBz6DyoxIdTqGO/SRB7BUhzg9UbgM3T/iEGSiurdY9L0SvD7PkgUO7 PxK5V9bq+JtF9ERUDZY6oHhvQmZiGyopGP5if0WNo9IsHXWWQc/Rt6h5PRg/3KtHjOPq HIDeopuzfPI0fekNWFYk2HQgDayWNdwhhkgtFy8wHXOKu7vFaeWqpl+4dfmPzxJ5D/dQ jLBlkbro9ASypZNFb63iwGnIuvtcioATCn7gMSmR7gKpqIIfCAn+20kOUXPhHec8VHfY pPQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=hRS+X0KWlSP33Dli2Fh9lKcgnCWn2S5/yWTvmwZNDPw=; b=CsS03vLQZY/5h3LFipCqaI3xVa3EYYZI12OucJ7p2rr/k03bwS7U1TpoYHq6bu8NSd SVxU2xSk53pNmTok+VVk3xup5dcvpvQbGS1uBEaRwn3nMcI9hy6JuFqwnZXhYcWRTrNd JvW1MbZJ8B8VbSWwu5XVgXz0XYT43nFIPuz/xZ8C1fk4fDqTGfafsoLazHixGih5zJUw v80I26kDAoXAcAKXq+abBDDL/iIk0krKxmWZbAnr55/UjaygfJDQd0X/etMZBvBsY/K7 ejHVugGsShtPtsk/F+MhcLjVFDhEQ8ip1+krBg2XM9yj3q4iQl0K9AXDkr5PvZffLn6P kkow== X-Gm-Message-State: AOAM5301DmU7wCs8k6P3Dhz+TUhhMAZRTtpLDIe6fQD7FsKQYvH9LsEN t26w8TxR1nbwBs+HGJCibJg= X-Google-Smtp-Source: ABdhPJxZ2QcEDUT+RagBdpMATIVC8+0hI5PIIXpZMk9FqOBH/E85GKK1Yeid+bYnLO3CR9eP4r3yvg== X-Received: by 2002:a1c:8d:: with SMTP id 135mr15612664wma.177.1607725367215; Fri, 11 Dec 2020 14:22:47 -0800 (PST) Received: from aspire-5942 (p200300ecdf02985ef41a5dd6f1686689.dip0.t-ipconnect.de. [2003:ec:df02:985e:f41a:5dd6:f168:6689]) by smtp.gmail.com with ESMTPSA id c81sm17831404wmd.6.2020.12.11.14.22.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Dec 2020 14:22:46 -0800 (PST) From: Marco Wahl To: steve-humphreys@gmx.com Subject: Re: Using org-agenda-time-grid with lists References: <87blf0tl9p.fsf@gmail.com> Date: Fri, 11 Dec 2020 23:22:44 +0100 In-Reply-To: (steve-humphreys@gmx.com's message of "Fri, 11 Dec 2020 16:45:28 +0100") Message-ID: <87zh2kvv7v.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=marcowahlsoft@gmail.com; helo=mail-wm1-x331.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: Org-Mode mailing list Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=T9n5N3WD; 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: 940249400BF X-Spam-Score: -3.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: YwvdFqkNPUFU Hi Steve! > I have made two versions for calling org-agenda-time-grid, but the first does not > comply with what the last call does. Yet the parameters are identical. > > (setq grid-displ '(today daily require-timed)) > (setq tm '(number-sequence 800 2000 100)) > (message "tm: %s" tm) > (setq org-agenda-time-grid '('grid-displ 'tm > "......" "----------------")) > > (setq org-agenda-time-grid '((today daily require-timed) > (800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 2000) > "......" "----------------")) Possibly my last answer was not so clear. IIUC you want to use some variables (concretely grid-displ and tm) instead of the hardcoded values in the setting of org-agenda-time-grid. This is a Lisp question AFAICT. (setq org-agenda-time-grid '((today daily require-timed) (800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 2000) "......" "----------------")) evaluates (C-x C-e) to ((today daily require-timed) (800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 2000) "......" "----------------") and the agenda appears as expected, I guess. Let's check the details and use some variables. (number-sequence 800 2000 100) evaluates to (800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000) LGTM. Introduce variables grid-displ and tm (setq grid-displ '(today daily require-timed)) (setq tm '(number-sequence 800 2000 100)) Ok. Let's check some variants using those variables (setq org-agenda-time-grid '(grid-displ tm "......" "----------------")) evaluates to (grid-displ tm "......" "----------------") which is not the wanted value i.e. the hardcoded version above. Somehow the variables grid-displ and tm need to get evaluated before the setting of org-agenda-time-grid. Next try (setq org-agenda-time-grid (list grid-displ tm "......" "----------------")) This evaluates to ((today daily require-timed) (number-sequence 800 2000 100) "......" "----------------") which is closer to the hardcoded version above. But the number-sequence call did not happen. Function eval can do that. (setq org-agenda-time-grid (list grid-displ (eval tm) "......" "----------------")) This evaluates (almost) to the hardcoded version above. Note that function eval is considered rather bad style and should be avoided if possible. Possibly you can use the setting (setq tm (number-sequence 800 2000 100)) instead of (setq tm '(number-sequence 800 2000 100)) and then just use tm instead of (eval tm) to get the list of numbers. If you want to dig deeper you can study the backtick notation of lisp which provides an elegant notation for variable evaluation in lists. HTH, -- Marco