[Top][All Lists]

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

diary behaving strangely

From: Tiarnan
Subject: diary behaving strangely
Date: 29 Oct 2002 14:19:02 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2


I've written a bit of lisp (based on code on the emacs Wiki) for
snarfing MS Outlook appointment messages and saving them to the emacs
diary. One problem... even though the correct entries are listed in
the diary when I call it as a file, they don't show up in the
appointments list. I've tried reloading diary (M-x diary), and even
reloading emacs, but still, the appointments are not recognised,
although they seem to be correctly formatted.

Can anyone help?

Here's the lisp:

(defun toc-outlook-invitation-to-diary ()
  (let ((buffer (or (get-buffer "*Article*") (current-buffer))))
      (set-buffer buffer)
      (goto-char (point-min))
      (when (re-search-forward "^Subject: \\(.*\\)$")
        (setq subject (match-string 1))
        (when (re-search-forward "^When: \\([0-9]+ \\w+\\) \\([0-9]+\\) 
          (setq date (match-string 1))
          (setq year (match-string 2))
          (setq time (match-string 3))
          (when (re-search-forward "^Where: \\(.*\\)$")
            (setq where (match-string 1))
            (setq diary-buffer (find-file-noselect diary-file))
            (set-buffer diary-buffer)
            (goto-char (point-max))
            (insert (format "\n%s %s\n %s %s (%s)\n" date year time subject 
            (bury-buffer diary-buffer)))))))

Tiarnán Ó Corráin               CMG-WDSC
Sysadmin                        Cork.
tiarnan.o'       +353-21-4933200

"Iraq: incredible weapons - incredible weapons." How do you know that? 
"Uh, well... We looked at the receipt." -- Bill Hicks, 1992

reply via email to

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