From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: steve-humphreys@gmx.com Newsgroups: gmane.emacs.help Subject: Re: ELisp - Making a list from a function returning a number Date: Fri, 18 Dec 2020 03:26:18 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32800"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: steve-humphreys@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 18 03:27:03 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kq5Ty-0008P5-6N for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 03:27:02 +0100 Original-Received: from localhost ([::1]:47484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kq5Tx-0003bW-70 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 21:27:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kq5TL-0003b9-SK for help-gnu-emacs@gnu.org; Thu, 17 Dec 2020 21:26:24 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:41013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kq5TJ-0004sY-7p for help-gnu-emacs@gnu.org; Thu, 17 Dec 2020 21:26:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608258379; bh=MK0vtE0/OIgbSrPoSlJMzT7+34r8S8tHKdpwO2s++a0=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=U3nd6EhUldX4zHCpdN19NvBl9dZjoECSDFJmuuUTQUaYae3eCq65Tf9QCPUInjuS5 +pSbwj6mNcsJwjkH9Aa7gmyzxxWsQPbstFQYRj90goyDcWauHLlT2aHlhYe+yfcAbV vjIbA6CXXXdhUkpO3PYpnwGBXgEX3wTb9tpHb8U4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs11.server.lan [172.19.170.179]) (via HTTP); Fri, 18 Dec 2020 03:26:18 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:Lm/NwyfqLCags078/cWq/ruUX0uGsC6mqBARqN6WjWM/YsTC6N2pLySflk+s55SNkF5fF yR6StVLtgMSexe7pggUVdmt3zlRZlW+9z87uGNamUkgqp6lkmPPnPYRA81t3ZsimP/lXfKAUHWHM 4MMUtwsIyLcBFAOG19bhQNZYa2OjOxGfKHinxVu/RJJbYcibFQPRL8JVXgPDktrLSqjL7p5WgtKN /S/l4DhmAx+VZN4ScBNxijomF1g42/Sq3wkTz3ljyGJm1cQDSpY5RT8sjbeESO4OYsIe7O/zAv6l Kw= X-UI-Out-Filterresults: notjunk:1;V03:K0:0MK3Jzn/1wo=:6n45kHO38JYKv7UNIc6oSf xS8R10bp/C9ehPb/1/q3G9Zlq8u94Oa6zCOQ3W4UR2TqNPnCtpo5SSKT4OwBcmM6CykCVXIW8 nhAiW8BU19MA27GuoX+btdoO8+6w4sHa7DMHgHEasJTFzH/5+1Lv3nJ0FpgRd+zwx3MvYWlYV YpcV4guvCnskXNNBnZ2zYSmxec9Olna3/PGClh8YR6aMXAtlXEMTn0ofiOq8J6FDdEqNmGhj0 +h+PL17xdY7i2r7aq0+eh1EeCyaPR1q16NsO1Z1fpGW0w2s6kVE281I4JeCkfsiTN7VCeeQmw UnDnFlCw7b2j9So9ttl55xXvd5QWCdxWsvKbWX2wwgFCPnfOoH7fvGITrHFB/5/0kQcJV8bX7 KHFzcg4oJPD4XaCbeYNCnCL0GXKffLTcBryeuuVkKD/QHG5BxRuMhekks6Ziq/J4JpOzvAKq3 DVExqua0Ni7/ddrXJDWupzjbDSEh303CL/YbKik2jdDVGkBaEdjfO6oqmJU8qujHN0264mFvJ sJVOKa4awM4u69A/Tx7vNxHemCmH+UsF4L01stqsLxFKLmvQSIjrryPkCXGJ/gOPkr394diTm vXoOAHm5bToxc= Received-SPF: pass client-ip=212.227.15.19; 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126477 Archived-At: I have now started constructing my function but get many problems. (defun timgrid () (setq tstr 800) (setq tend 1300) (setq tpd 34) (setq i 0) (setq tim tstr) (setq tlist '(tim)) (dotimes (i 4) (setq tfr (timfutur (tim tpd))) (setq tim tfr) (setq tlist (append (tlist) (tim))) )) > Sent: Thursday, December 17, 2020 at 12:42 PM > From: steve-humphreys@gmx.com > To: "Help Gnu Emacs" > Subject: ELisp - Making a list from a function returning a number > > > I have written a function to return time as a number so I can set the te= mporal grid > in org-agenda. > > I was previously using number-sequence until someone fount a problem. N= ow I have timfutur to > give me the next time (time interval "tsk" after time "tim") > > (tim (number-sequence tstr tend tskp)) > > So what I have remaining to do is to make a list of numbers representing= the times when the > agenda grids are displayed. > > > (defun timfutur (tim tsk) > > (let* ( (thr (/ tim 100)) > (tmn (- tim (* thr 100))) > > (tinc_mn (+ tmn tsk)) > (tinc_hr (/ (+ tmn tsk) 60)) > (tinc_mn (- tinc_mn (* tinc_hr 60))) > > (thr_futur (* (+ thr tinc_hr) 100)) > (tmn_futur tinc_mn) > (tim_out (+ thr_futur tmn_futur)) ) > ;; --- body of let ---- > tim_out )) ; function returns last form > >