From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Drechsler Subject: Re: mail agenda similar to `diary-mail-entries' Date: Sun, 10 Jun 2007 01:36:32 +0200 Message-ID: <877iqc1z0f.fsf@pdrechsler.de> References: <87mz0645e7.fsf@pdrechsler.de> <34aed42135ad4a217118ca0168898606@science.uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HxATR-0002Mw-7E for emacs-orgmode@gnu.org; Sat, 09 Jun 2007 19:36:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HxATQ-0002MK-93 for emacs-orgmode@gnu.org; Sat, 09 Jun 2007 19:36:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HxATQ-0002MB-3h for emacs-orgmode@gnu.org; Sat, 09 Jun 2007 19:36:00 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HxATP-0006kj-JA for emacs-orgmode@gnu.org; Sat, 09 Jun 2007 19:35:59 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HxATL-00019q-9W for emacs-orgmode@gnu.org; Sun, 10 Jun 2007 01:35:55 +0200 Received: from dslb-084-057-067-084.pools.arcor-ip.net ([84.57.67.84]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 10 Jun 2007 01:35:55 +0200 Received: from patrick by dslb-084-057-067-084.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 10 Jun 2007 01:35:55 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Carsten Dominik writes: > Untested: > > emacs -batch -l ~/.emacs -eval '(org-batch-agenda "a")' \ > | mail user@address.com > > > With (setq org-agenda-include-diary t), the diary will > be part of the mailing automatically. I am very sorry for the late reply. Thank you Carsten for your script! The problem I am having with your approach is that `mail' requires a full blown MTA. And since the diary script works fine with Emacs/Gnus I was wondering if an approach along those lines might work, but to no avail so far: Here is the script I a trying to use: --8<---------------cut here---------------start------------->8--- emacs \ --batch \ --load ~/.emacs.d/init.el \ --load ~/.emacs.d/.gnus \ --funcall org-mail --8<---------------cut here---------------end--------------->8--- And I have tried this in my ~/.emacs (well, actually ~/.emacs.d/init.el, but that should not make a difference): --8<---------------cut here---------------start------------->8--- ;;; Test 1: this sends a message, but only replicates the header in the ;;; body. The actual body (the agenda) is not present. ;; (defun org-mail () ;; "Send mail of agenda to myself." ;; (org-batch-agenda "a") ;; (compose-mail diary-mail-addr "agenda") ;; (insert (buffer-string)) ;; (call-interactively (get mail-user-agent 'sendfunc))) ;;; Test 2 ;;; ERROR: ;;; Buffer is read-only: # ;; (defun org-mail () ;; "Send mail of agenda to myself." ;; (compose-mail diary-mail-addr "agenda") ;; (insert (org-batch-agenda "a")) ;; (call-interactively (get mail-user-agent 'sendfunc))) ;;; Test 3: ;;; ERROR: ;;; Invalid header line (maybe a continuation line lacks initial whitespace) ;; (defun org-mail () ;; "Send mail of agenda to myself." ;; (compose-mail diary-mail-addr "agenda") ;; (insert (org-agenda-list "a")) ;; (call-interactively (get mail-user-agent 'sendfunc))) --8<---------------cut here---------------end--------------->8--- Maybe it is obvious to you or somebody else what I am doing wrong. I have the impression that this might work somehow. Thankful for any further input/ideas, Patrick -- OS's and GUI's come and go, only Emacs has lasting power. (Per Abrahamsen)