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 uF40Nwz+018RawAA0tVLHw (envelope-from ) for ; Fri, 11 Dec 2020 23:17:32 +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 cp7mMgz+019fbAAAbx9fmQ (envelope-from ) for ; Fri, 11 Dec 2020 23:17:32 +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 76354940111 for ; Fri, 11 Dec 2020 23:17:32 +0000 (UTC) Received: from localhost ([::1]:37830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knrfH-0002VM-3z for larch@yhetil.org; Fri, 11 Dec 2020 18:17:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knrTD-0003Re-FY for emacs-orgmode@gnu.org; Fri, 11 Dec 2020 18:05:03 -0500 Received: from mout.gmx.net ([212.227.17.22]:37723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knrT8-0007iA-Cr for emacs-orgmode@gnu.org; Fri, 11 Dec 2020 18:05:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607727895; bh=rZmn9oBzurkawbTLeLHRL88PiOM0jPXP5YkB1ZfGXrc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=hG3Z7UbU8ihCIYN+g6hAh7mNiLROq7aNbtnKtpbaR6jE2EK7dmF3k8LSk+FlKq6b8 q8jgg0hFk4cGEeqiH2IPmD60Serom5sPoNSkse3rOs3l0Cm1ZWH4mGZTL7k4fsxLja k+j9HtURrX2/+YT6xKc0gS3wkVVXMttBe34Zgdko= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs06.server.lan [172.19.170.174]) (via HTTP); Sat, 12 Dec 2020 00:04:55 +0100 MIME-Version: 1.0 Message-ID: From: steve-humphreys@gmx.com To: Marco Wahl Subject: Re: Using org-agenda-time-grid with lists Content-Type: text/plain; charset=UTF-8 Date: Sat, 12 Dec 2020 00:04:55 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <87zh2kvv7v.fsf@gmail.com> References: <87blf0tl9p.fsf@gmail.com> <87zh2kvv7v.fsf@gmail.com> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:hZLcWPiXuHVGxzTwT+JvCHB8Nf/zSFDS77iWJ4ZhWro1g+dhSlYsQNiIZh/ygnOBi4Xbu m/85JFYHewgqLuBp+flfPGaNwgdpUfn3ReUsCO+jhUNNg0C5b8sA5mP4UN08kxzdNnHpfVwRBD6A bRU5TB+KRxuQ07RzEUHaRsijWBWlwmSiG+KoNsC9INigWSTCBzbvxZL7UZL0CxF6sa73tIcQAcmV BtJ/E1qGE++Ohu5F3fBCcMusxkhgG4JjtxICCqy0B2fdTbVP8JZVECgIOrA2xerLkRkCHTfF9r8b rc= X-UI-Out-Filterresults: notjunk:1;V03:K0:pb7zyZiqYO4=:sPNYRdQRVs69bGkO9JVqcs 2I5ANn2+GZTGik45aXX9Z3eiQ/9KwUQXHzeC/D/98hb2iomt18ipcqcLhFSMuKf98q0oUhX6C esV3m/B+Ay2tutaxlHT37ZlGU7ODzHMOay68fGH5eOkdey/uXLOHbPENV+YTc8GFekeZZpWJE PArJ8E+/TtcNR/K7xWeW4LkdB84V4oA08+Ok4fU1s7zXvTnz7fQe3r9Z+vbwEyt0VS0mZjNmB FsUgnyj4foU6Qg8plq1CIdB608A1SSeLNLXAng7zBMk+xaMJcUaQc1HwRKIoJt8jwSezCYufa mkvWtiRP9S3S8F9xk+8lRIwKMfw9GOh1iAFqAHw3beAb2UdO+5acPoZ93VQUDEfa29lWfK6aR joPool1OLHwk4R1OErbLHw8ql4i1ruuyVsYVtlrrcQPsD2W457qz/hT1BBEcLvydzu0MUO8xX 9cCR9iAL5Rd0VuwIH8qhdWDrq1eoYx7+sJlrLQIootuuDvhcnv4TIKegqrAXZe8ue4UldMQ5z NaiaefdNdzxIekRYA8GtSyzq69jlAxMQDmL2iSQZv8BOGBkflzEhVSSWcjmhV3EvTcJLK8rBj DadYgTzT3zzFc= Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=212.227.17.22; envelope-from=steve-humphreys@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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: -1.90 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=hG3Z7UbU; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmx.com (policy=none); 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: 76354940111 X-Spam-Score: -1.90 X-Migadu-Scanner: scn1.migadu.com X-TUID: UlHlil6fLWfK > Sent: Friday, December 11, 2020 at 11:22 PM > From: "Marco Wahl" > To: steve-humphreys@gmx.com > Cc: "Org-Mode mailing list" > Subject: Re: Using org-agenda-time-grid with lists > > Hi Steve! > > > I have made two versions for calling org-agenda-time-grid, but the fir= st 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. Correct > 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. If you say so. > 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. Have used the backtick before. Will look how I can use it for this case. > HTH, > -- > Marco >