unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tiarnan <tiarnan.ocorrain@cmg.com>
Subject: diary behaving strangely
Date: 29 Oct 2002 14:19:02 +0000	[thread overview]
Message-ID: <86vg3l5nvt.fsf@wintermute.att.cmg.nl> (raw)

Hi--

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 ()
  (interactive)
  (let ((buffer (or (get-buffer "*Article*") (current-buffer))))
    (save-excursion
      (set-buffer buffer)
      (goto-char (point-min))
      (when (re-search-forward "^Subject: \\(.*\\)$")
	(setq subject (match-string 1))
	(beginning-of-buffer)
	(when (re-search-forward "^When: \\([0-9]+ \\w+\\) \\([0-9]+\\) \\([0-9]+:[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 where))
	    (save-buffer)
	    (bury-buffer diary-buffer)))))))

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

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

             reply	other threads:[~2002-10-29 14:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-29 14:19 Tiarnan [this message]
2002-10-29 15:36 ` diary behaving strangely ken
     [not found] <mailman.1035901228.11451.help-gnu-emacs@gnu.org>
2002-10-29 16:08 ` Alan Shutko
2002-10-29 16:37   ` Tiarnan
2002-10-29 16:48     ` Alan Shutko
2002-10-30  9:03       ` Tiarnan
2002-10-30 10:34         ` Tiarnan
     [not found]       ` <mailman.1035968667.28019.help-gnu-emacs@gnu.org>
2002-10-30 14:23         ` Alan Shutko
2002-11-12  9:43           ` Colin Marquardt
2002-11-13  1:54             ` Edward M. Reingold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86vg3l5nvt.fsf@wintermute.att.cmg.nl \
    --to=tiarnan.ocorrain@cmg.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).