From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thorsten Bonow Newsgroups: gmane.emacs.help Subject: Re: diary-mail-entries Date: Sun, 16 Oct 2022 22:31:40 +0200 Message-ID: <87tu43wlw3.fsf@post.rwth-aachen.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19443"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:8euiw7XlWMWQdgaNV5mGt3jZAPg= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 16 22:39:30 2022 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 1okAPy-0004rj-6e for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 22:39:30 +0200 Original-Received: from localhost ([::1]:57288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okAPu-0008Cm-SI for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 16:39:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okAIb-0008CN-L3 for help-gnu-emacs@gnu.org; Sun, 16 Oct 2022 16:31:56 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:39172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okAIY-0002P8-Oa for help-gnu-emacs@gnu.org; Sun, 16 Oct 2022 16:31:53 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1okAIW-0005jE-AG for help-gnu-emacs@gnu.org; Sun, 16 Oct 2022 22:31:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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:140006 Archived-At: >>>>> aalinovi 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 writes: >>>>>>> aalinovi 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