unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ELisp - Making a list from a function returning a number
@ 2020-12-17 11:42 steve-humphreys
  2020-12-18  2:26 ` steve-humphreys
  0 siblings, 1 reply; 9+ messages in thread
From: steve-humphreys @ 2020-12-17 11:42 UTC (permalink / raw)
  To: Help Gnu Emacs


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 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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-12-20  7:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-17 11:42 ELisp - Making a list from a function returning a number steve-humphreys
2020-12-18  2:26 ` steve-humphreys
2020-12-18  3:01   ` steve-humphreys
2020-12-18 14:43     ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-18 17:53       ` Jean Louis
2020-12-20  5:03         ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-20  6:23           ` Jean Louis
2020-12-20  6:30             ` Christopher Dimech
2020-12-20  7:01             ` Emanuel Berg via Users list for the GNU Emacs text editor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).