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

* Re: dope program
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Byung-Hee HWANG @ 2021-01-06  9:11 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

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

Hellow Emanul,

Sorry i did fail to imagin what this program is. So could you please
more expalin or background? Possibly i would like to feel your mind for
this program "dope". Because i also work for long time day by day with
text files.

Sincerely, Gnus fan Byung-Hee

-- 
^고맙습니다 _和合團結_ 감사합니다_^))//



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