emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: mail agenda similar to `diary-mail-entries'


From: Patrick Drechsler
Subject: [Orgmode] Re: mail agenda similar to `diary-mail-entries'
Date: Mon, 11 Jun 2007 13:10:45 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux)

Carsten Dominik <address@hidden> writes:

> On Jun 10, 2007, at 1:36, Patrick Drechsler wrote:
>
>> Carsten Dominik <address@hidden> writes:

[...]

>> 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)))
>
>
> When you do `(insert (buffer-string))', then you are already in the
> mail buffer, so indeed you are only duplocating the content of the
> mail buffer.  You need to do something like this:
>
> (defun org-mail ()
>   "Send mail of agenda to myself."
>   (org-batch-agenda "a")
>   (let ((str (buffer-string)))
>      (compose-mail diary-mail-addr "agenda")
>      (insert str)
>      (call-interactively (get mail-user-agent 'sendfunc))))

Thank you very much Carsten! Works like a charm! I also appreciate you
taking the time to explain why my Lisp snipplets didn't work.

Cheers,

Patrick
-- 
"Statistics are like bikinis. What they reveal is suggestive, but what
they conceal is vital" --Aaron Levenstein





reply via email to

[Prev in Thread] Current Thread [Next in Thread]