all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thorsten Bonow <thorsten.bonow@post.rwth-aachen.de>
To: help-gnu-emacs@gnu.org
Subject: Re: diary-mail-entries
Date: Sun, 16 Oct 2022 22:31:40 +0200	[thread overview]
Message-ID: <87tu43wlw3.fsf@post.rwth-aachen.de> (raw)
In-Reply-To: af89877389bd678c@eddie.fios-router.home

>>>>> aalinovi  <aalinovi@riseup.net> writes:

> It appears I spoke to soon.  In ~/.emacs.d/init.el I have:

> (require 'midnight) (midnight-delay-set 'midnight-delay "0:40am")

> In midnight customization, the only thing I changed was to add
> "diary-mail-entries" to "Midnight hook".

> My problem is that not only does dairy-mail-entry run at 40 minutes after
> midnight, it also runs each and everytime I start emacs.

Hi,

that's because you told GNU Emacs to do so :-)

There are two ways of setting the delay:

`midnight-delay-set' accepts a number as second arg, specifying the number of
seconds after the midnight when the midnight-timer is run.  So
(midnight-delay-set 'midnight-delay 2400) would have done the trick. 

You chose to use the other way by passing a string, which is then passed as the
first argument to `run-at-time'.  But for `run-at-time', if the time is
specified using a string, it is taken to be a time _today_, even if already in
the past.  So I bet you fired up Emacs after 0:40am and then midnight runs
immediately.

You can read about this in the GNU Emacs Lisp manual, see "Timers".

Hope this helps,

Toto

> I know some people keep emacs running for weeks or even months at a time. I
> don't work like that. I am retired and use my laptop to browse the web, read
> emails, etc. When I'm done I shut down and then boot up later in the day if I
> feel like it. Having emacs send me an email each time is not what I want.

> If anyone has any ideas I would be grateful.

> Thanks,

> Arthur

> aalinovi@riseup.net writes:
>> Thorsten Bonow <thorsten.bonow@post.rwth-aachen.de> writes:
>>>>>>> aalinovi <aalinovi@riseup.net> writes:
>> 
>>> I am running emacs-28.2 on OpenBSD-current. I will state at the outset t=
>> hat I
>>> do no know lisp but have acquired a copy of Robert Chassell's "Emacs Lis=
>> p: An
>>> Introduction" and have started going thru it.
>> 
>>> After several hours of experimenting I have finally got M-x
>>> diary-mail-entries to work. What I now need is to enable that in a cron =
>> job
>>> to run each night. Not knowing lisp I have no idea where or how to begin=
>> .
>> 
>>> Any assistance would be appreciated.  Thank you.  Arthur
>> 
>>>> Hi,
>> 
>>>> short answer, pressed for time: The help for `diary-mail-entries' has an
>>>> example script: "C-h f diary-mail-entries".
>> 
>>>> But I think this can be handled by the "midnight.el" library, already
>>>> included: "run something every midnight, e.g., kill old buffers".
>> 
>> I couldn't get the example script to run but I did get "midnight.el" (which
>> I didn't even know existed) to work.
>> 
>> Thank you very much.
>> 
>> Arthur

-- 
Sent from my GNU Emacs running on GNU/Linux
ROSENWALD’S THEOREM: The belief that all the wrong people have self-esteem.
Douglas Coupland: Player One




  reply	other threads:[~2022-10-16 20:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14 13:42 diary-mail-entries aalinovi
2022-10-16 20:31 ` Thorsten Bonow [this message]
2022-10-17 11:21   ` diary-mail-entries aalinovi
  -- strict thread matches above, loose matches on Subject: below --
2022-10-13 16:53 diary-mail-entries aalinovi
2022-10-13 17:31 ` diary-mail-entries Thorsten Bonow
2022-10-13 19:21 ` diary-mail-entries Emanuel Berg
2022-10-13 19:23 ` diary-mail-entries Emanuel Berg
2007-03-20 21:49 diary-mail-entries sven.bretfeld
2007-03-21  4:45 ` diary-mail-entries Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu43wlw3.fsf@post.rwth-aachen.de \
    --to=thorsten.bonow@post.rwth-aachen.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.