Function: diary-from-outlook-internal

diary-from-outlook-internal is a byte-compiled function defined in diary-lib.el.gz.

Signature

(diary-from-outlook-internal SUBJECT BODY &optional TEST-ONLY)

Documentation

Snarf a diary entry from a message assumed to be from MS Outlook.

SUBJECT and BODY are strings giving the message subject and body. Arg TEST-ONLY non-nil means return non-nil if and only if the message contains an appointment, don't make a diary entry.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/diary-lib.el.gz
;; Following code from Dave Love <fx@gnu.org>.
;; Import Outlook-format appointments from mail messages in Gnus or
;; Rmail using command `diary-from-outlook'.  This, or the specialized
;; functions `diary-from-outlook-gnus' and `diary-from-outlook-rmail',
;; could be run from hooks to notice appointments automatically (in
;; which case they will prompt about adding to the diary).  The
;; message formats recognized are customizable through `diary-outlook-formats'.

(defun diary-from-outlook-internal (subject body &optional test-only)
  "Snarf a diary entry from a message assumed to be from MS Outlook.
SUBJECT and BODY are strings giving the message subject and body.
Arg TEST-ONLY non-nil means return non-nil if and only if the
message contains an appointment, don't make a diary entry."
  (catch 'finished
    (let (format-string)
      (dolist (fmt diary-outlook-formats)
        (when (eq 0 (string-match (car fmt) body))
          (unless test-only
            (setq format-string (cdr fmt))
            (save-excursion
              (save-window-excursion
                (diary-make-entry
                 (format (replace-match (if (functionp format-string)
                                            (funcall format-string body)
                                          format-string)
                                        t nil (match-string 0 body))
                         subject)))))
          (throw 'finished t))))
    nil))