]> code.delx.au - gnu-emacs/commitdiff
* lisp/calendar/diary-lib.el (diary-from-outlook-function): New variable.
authorGlenn Morris <rgm@gnu.org>
Sat, 4 May 2013 23:55:57 +0000 (16:55 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 4 May 2013 23:55:57 +0000 (16:55 -0700)
(diary-from-outlook): Respect diary-from-outlook-function.

* doc/emacs/calendar.texi (Importing Diary):
Mention diary-from-outlook-function.

* etc/NEWS: Mention this.

doc/emacs/ChangeLog
doc/emacs/calendar.texi
etc/NEWS
lisp/ChangeLog
lisp/calendar/diary-lib.el

index 90e31b9923edf1674097bf4dbb135b9d332e47e5..2c47bdd4fad48f16b7e486d12613dc74a1a09a82 100644 (file)
@@ -1,3 +1,7 @@
+2013-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * calendar.texi (Importing Diary): Mention diary-from-outlook-function.
+
 2013-03-17  Paul Eggert  <eggert@cs.ucla.edu>
 
        doc: convert some TeX accents to UTF-8
index 52b966b76e19cf1c9acfd747ca3a306088bfeb7d..075d753ae7a4f240346782c3e8e3634a22fac267 100644 (file)
@@ -1542,7 +1542,8 @@ variety of other formats.
 messages.  While viewing such a message in Rmail or Gnus, do @kbd{M-x
 diary-from-outlook} to import the entry.  You can make this command
 recognize additional appointment message formats by customizing the
-variable @code{diary-outlook-formats}.
+variable @code{diary-outlook-formats}.  Other mail clients can set
+@code{diary-from-outlook-function} to an appropriate value.
 
 @c FIXME the name of the RFC is hardly very relevant.
 @cindex iCalendar support
index 0a8cf2c032554b02d87862801b4236be40b4b3a1..4669021c4724fcc19e6c7ac13b8f1883e9c8039f 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -146,6 +146,12 @@ The default separator is changed to allow surrounding spaces around the comma.
 
 *** Battery information via the BSD `apm' utility is now supported.
 
+** Calendar and Diary
+
++++
+*** New variable `diary-from-outlook-function' for used by the command
+`diary-from-outlook'.
+
 ** cl-lib
 
 *** New macro cl-tagbody.
index 88bc79ad707862f324037734505d909ef64bc99f..8c0414f7cfff1913dddb6c296301063f05505916 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-04  Glenn Morris  <rgm@gnu.org>
+
+       * calendar/diary-lib.el (diary-from-outlook-function): New variable.
+       (diary-from-outlook): Respect diary-from-outlook-function.
+
 2013-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * simple.el (read-expression-map): Use completion-at-point (bug#14255).
index f4aa26a086499020306ecd2ea97148acf8fd405e..2cc381122b7da2abd37b4afcf2e4e464bd4a5b09 100644 (file)
@@ -2611,14 +2611,23 @@ user is asked to confirm its addition."
           (diary-from-outlook-internal subject body)
           (message "Diary entry added"))))))
 
+(defvar diary-from-outlook-function nil
+  "If non-nil, a function of one argument for `diary-from-outlook' to call.
+If the current buffer contains an Outlook-style appointment message,
+this function should extract it into a diary entry.  If the argument is
+nil, it should ask for confirmation before adding this entry to the diary.
+For examples, see `diary-from-outlook-rmail' and `diary-from-outlook-gnus'.")
+
 (defun diary-from-outlook (&optional noconfirm)
   "Maybe snarf diary entry from current Outlook-generated message.
-Currently knows about Gnus and Rmail modes.  Unless the optional
-argument NOCONFIRM is non-nil (which is the case when this
-function is called interactively), then if an entry is found the
-user is asked to confirm its addition."
+Uses `diary-from-outlook-function' if that is non-nil, else
+`diary-from-outlook-rmail' for Rmail or `diary-from-outlook-gnus' for Gnus.
+Unless the optional argument NOCONFIRM is non-nil (which is the
+case when this function is called interactively), then if an
+entry is found the user is asked to confirm its addition."
   (interactive "p")
   (let ((func (cond
+               (diary-from-outlook-function)
                ((eq major-mode 'rmail-mode)
                 #'diary-from-outlook-rmail)
                ((memq major-mode '(gnus-summary-mode gnus-article-mode))