Browse Source

Added documentation for org-mac-iCal.org. Tidied up
org-mac-message.org and org-contrib/index.org.

Christopher Suckling 10 years ago
parent
commit
6f6c0e2abd
3 changed files with 99 additions and 7 deletions
  1. 8 4
      org-contrib/index.org
  2. 86 0
      org-contrib/org-mac-iCal.org
  3. 5 3
      org-contrib/org-mac-message.org

+ 8 - 4
org-contrib/index.org

@@ -126,10 +126,14 @@ hopefully have some documentation.
   Written by /Carsten Dominik/.
   [[repofile:contrib/lisp/org-man.el][Link to raw file]].
 
-- [[file:org-mac-message.org][org-mac-message.el --- linking to messages in OS X Mail.app]] ::
-  Create links to selected or flagged messages in Mail.app
-  Written by /John Wiegley/ and /Christopher Suckling/
-  [[repofile:lisp/org-mac-message.el][Link to raw file]]
+- [[file:org-mac-iCal.org][org-mac-iCal.el -- import OS X iCal.app events into Emacs diary]] ::
+  Written by /Christopher Suckling/.
+  [[repofile:contrib/lisp/org-mac-iCal.el][Link to raw file]].
+
+- [[file:org-mac-message.org][org-mac-message.el -- linking to messages in OS X Mail.app]] ::
+  Create links to selected or flagged messages in Mail.app.
+  Written by /John Wiegley/ and /Christopher Suckling/.
+  [[repofile:lisp/org-mac-message.el][Link to raw file]].
 
 - /org-mtags.el/ -- support for some Muse-like tags in Org-mode ::
   This package allows you to write =<example>= and =<src>= and other

+ 86 - 0
org-contrib/org-mac-iCal.org

@@ -0,0 +1,86 @@
+#+TITLE:     org-mac-iCal.el -- import Mac OS X iCal.app events into Emacs diary
+#+OPTIONS:   ^:{} author:nil
+#+STARTUP: odd
+
+[[file:index.org][{Back to Worg's contibutions index}]]
+
+If you find iCal.app the most convenient way to manage your diary, but
+would still like to view your appointments in org agenda, then this
+module may help.
+
+*N.B.* org-mac-iCal.el has only been tested on OS X 10.5. Apple's
+handling of ics files changed between 10.4 and 10.5 to allow Spotlight
+to index events. Unfortunately, the author no longer has access to
+10.4 and 10.4 support is based entirely on his memory. The author
+would welcome reports of success or failure of org-mac-iCal.el with OS
+X 10.4 or earlier.
+
+* Installation
+  - To load org-mac-iCal.el by default:
+
+    : (add-to-list 'org-modules 'org-mac-iCal)
+
+    Note that =org-modules= must be set before org-mode is loaded.
+
+  - To view Emacs diary entries in the org agenda, ensure that 
+
+    : (setq org-agenda-include-diary t)
+
+    is set.
+
+* Usage
+  =(org-mac-iCal)= will import all /checked/ iCal.app calendars into
+  your Emacs diary when called either interactively or as part of
+  another function.
+
+  *Warning: (org-mac-iCal) is destructive and will overwrite the
+  current contents of your Emacs diary.*
+
+** Customizable variables
+   - =org-mac-iCal-range= ::
+
+     Sets the number of months (default: 2) of events imported from
+     iCal.app calendars.
+
+     Because all-day and multi-day events are imported into the Emacs
+     diary as sexps, a large number of these can cause the Emacs
+     calendar view to slow down unacceptably. =org-mac-iCal-range=
+     sets how many months of events to import, /centred around the
+     current day/. Thus the default value of 2 imports events from one
+     month in the past to one month in the future.
+
+** Examples of usage
+   The following code creates a custom command in the agenda
+   dispatcher to import iCal.app events and then display the agenda:
+
+#+begin_src emacs-lisp
+(setq org-agenda custom-commands
+      '(("I" "Import diary from iCal" agenda ""
+	 ((org-agenda-mode-hook
+	   (lambda ()
+	     (org-mac-iCal)))))))
+#+end_src
+
+   A common problem with all-day and multi-day events in org agenda
+   view is that they become separated from timed events and are placed
+   below all =TODO= items. Likewise, additional fields such as
+   =Location:= are orphaned from their parent events. The following
+   hook will ensure that all events are correctly placed in the
+   agenda:
+
+#+begin_src emacs-lisp
+(add-hook 'org-agenda-cleanup-fancy-diary-hook
+	  (lambda ()
+	    (goto-char (point-min))
+	    (save-excursion
+	      (while (re-search-forward "^[a-z]" nil t)
+		(goto-char (match-beginning 0))
+		(insert "0:00-24:00 ")))
+	    (while (re-search-forward "^ [a-z]" nil t)
+	      (goto-char (match-beginning 0))
+	      (save-excursion
+		(re-search-backward "^[0-9]+:[0-9]+-[0-9]+:[0-9]+ " nil t))
+	      (insert (match-string 0)))))
+#+end_src
+
+	     

+ 5 - 3
org-contrib/org-mac-message.org

@@ -2,8 +2,10 @@
 #+OPTIONS:   ^:{} author:nil
 #+STARTUP: odd
 
-  The org-mac-message.el library provides various methods for linking
-  to OS X Mail.app messages from within org-mode.
+[[file:index.org][{Back to Worg's contibutions index}]]
+
+The org-mac-message.el library provides various methods for linking
+to OS X Mail.app messages from within org-mode.
 
 * Installation
   - To load org-mac-message.el by default:
@@ -63,7 +65,7 @@
 #+BEGIN_SRC emacs-lisp
 (defun my-mail-import ()
   (let ((org-mac-mail-account "Gmail"))
-    (org-mac-message-insert-flagged "taskpool.org" "Flagged mail")))   
+    (org-mac-message-insert-flagged "taskpool.org" "Flagged mail")))
 #+END_SRC
 
     This function could then be linked to from an org-mode buffer: