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 04:01:26 +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="23862"; 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 04:02:55 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 1kq62h-00067u-9X for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 18 Dec 2020 04:02:55 +0100 Original-Received: from localhost ([::1]:38144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kq62g-0005NI-CC for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 22:02:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kq61N-0005LT-3r for help-gnu-emacs@gnu.org; Thu, 17 Dec 2020 22:01:33 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:43193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kq61I-0000I1-8j for help-gnu-emacs@gnu.org; Thu, 17 Dec 2020 22:01:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608260486; bh=B4oU9qKJIaLdiY6iN4ntvcx3I/3jqbSgFrX7lwEITnU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=PoB09k9R9UZHFCngB9EBEDGvZn7NAl9b+4QNsaX0nhT6jPCgL95EyohQ0QdKPIDie evRqJ9kqKPIF71CRiIqc3g10TZUR0P6hXHaC9Ymadi6T6moKypmxu+u+QyH7S/+02q /Nz5e7OBlw2Tk0geI5vKHjRuGlr+nxsn8LyP0O0E= 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 04:01:26 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:sLMgCEzHaCC0ccfyHMB//KWtjYywPiWGZS52XtoRH1cjgKi0MBmXtbIzcfxoOhp8daQgE xnPyHSjp3cAOzTnEJCB94XL73pa2qBmPvaVZlq1SotLSWv/IEwjlyxJbe/J6AgBAvGT0P388AE82 EUyG+zAxwBKZQMJf0waov5/eV6RENP2rHNHOh5U8QjJwU+z5u3MkxfTz3OB8StaArrJeSdPrIL2P /ArJXSeBJoGEv/T0dldeF1yBxbkhmBt16wa9bn/Ug5T0fe9TW6Ae+zz+PWBnE9NLB76pEEsC8wOZ Ko= X-UI-Out-Filterresults: notjunk:1;V03:K0:dWHjzUaO3EU=:B1mcYRBAW0y1uPsxQtD1Ua bha0Uzjy8fLhHO4261RIl2gfMpNa/o86ZCh1ZsaD7isVozXm4Vt/x1mzMohu6AO9Z/+TBs4pa 3VtNvteX3D4JG+nlcQ6Co266Kv0TfS6uh9a1CNGfmfCWnhC6NgnoUMxSuyoPVEw5rfXeb5jPW +q27W+ih7HdV3Mw6hRIPj02GFeUZxSO0By7czEiPqLOXXRojkzZs/PXPyi+ff1U3n+Ory9CKb sG0Yu+jcruEK9VSIWxzMrM/WkL/SlpL7mb/MdkOGs84KNLEUfbMoMzAAYs9IHCV+rOdqgzEbW hxwbEj7cx8BSPRXWOenaZmiZVtHgUeVuKn7aDGub4L1CI/D79bv469wK4LvGgHy7RbDjCnmRJ +v6GgVO0QuOCTfb4Kq+vla7fetmdA08zui5ggXGd3qcxBHmdzIPO/1IdxFBZniqUnZdFiZq5g nbBsRW8LDRQR3NZjg/x9QHStUijP5JlG518KwHpHLaUqb/1rUBKzZUKQRg+dO9TdyNzhVx+u+ UZYbpiugGYXi4ylRv/88MZBd8jC5K854wl3OojAQMN3xxjO3dlx91p/dwADcvnIo2YMBTbyM6 2OL3cdufuEtAI= 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: 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:126478 Archived-At: This is my new function (defun timgrid () (let* ( (tstr 800) (tend 1300) (tpd 34) (i 0) (tim tstr) tim tfr ) ;; ----- body of let ----- (dotimes (i 4) (message "tim tpd: %d %d" tim tpd) (setq tfr (timfutur tim tpd)) (message "tim: %d" tim) ;;(setq tlist (append 'tlist (list tim))) (setq tim tfr)) )) > Sent: Friday, December 18, 2020 at 3:26 AM > From: steve-humphreys@gmx.com > To: steve-humphreys@gmx.com > Cc: "Help Gnu Emacs" > Subject: Re: ELisp - Making a list from a function returning a number > > 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 = temporal grid > > in org-agenda. > > > > I was previously using number-sequence until someone fount a problem. = Now 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 representi= ng 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 > > > > >