Message to planner

(defun message-to-planner ()
  "Logs this message to the News and Mail section of today's planner file."
  (save-window-excursion
    (let ((string (concat
             (format-time-string "%R")
             " | " (if (message-fetch-field "newsgroups")
                       (concat " News " (message-fetch-field "newsgroups"))
                     (concat " Mail " (message-fetch-field "to")))
             " | Subject: \"" (message-fetch-field "subject") "\""
             " | Message-ID: " (message-fetch-field "message-id")
             "\n")))22
      (planner-goto-today)
      (planner-seek-to-first "News and Mail")
      (insert string))))

(add-hook 'message-sent-hook 'message-to-planner)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>