unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* dope program
@ 2021-01-06  5:46 Emanuel Berg via Users list for the GNU Emacs text editor
  2021-01-06  9:11 ` Byung-Hee HWANG
  0 siblings, 1 reply; 2+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-01-06  5:46 UTC (permalink / raw)
  To: help-gnu-emacs

(defun dope (boxes pills dose &optional from)
  (interactive "nboxes: \nnpills/box: \nndose/day: ")
  (let*((days     (/ (* boxes pills) dose))
        (done     (time-add (when from
                              (date-to-time (concat from "T00:00+01:00")) )
                            (days-to-time (1- days)) ))
        (done-str (format-time-string "%F" done))
        (get-more (format-time-string "%F"
                                      (time-add done (days-to-time -10))) ))
    (insert (format "%s  [%s]   %s" ; don't change
                    (or from (format-time-string "%F")) get-more done-str) )))

Very useful, and seems to work, just put the output data in
a text file.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




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

end of thread, other threads:[~2021-01-06  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-06  5:46 dope program Emanuel Berg via Users list for the GNU Emacs text editor
2021-01-06  9:11 ` Byung-Hee HWANG

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