1 ;;; org-mac-link.el --- Grab links and url from various mac
2 ;; Application and insert them as links into org-mode documents
4 ;; Copyright (c) 2010-2013 Free Software Foundation, Inc.
7 ;; Anthony Lander <anthony.lander@gmail.com>
8 ;; John Wiegley <johnw@gnu.org>
9 ;; Christopher Suckling <suckling at gmail dot com>
10 ;; Daniil Frumin <difrumin@gmail.com>
14 ;; Keywords: org, mac, hyperlink
16 ;; This file is not part of GNU Emacs.
18 ;; This program is free software; you can redistribute it and/or modify
19 ;; it under the terms of the GNU General Public License as published by
20 ;; the Free Software Foundation; either version 3, or (at your option)
23 ;; This program is distributed in the hope that it will be useful,
24 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;; GNU General Public License for more details.
28 ;; You should have received a copy of the GNU General Public License
29 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
33 ;; This code allows you to grab either the current selected items, or
34 ;; the frontmost url in various mac appliations, and insert them as
35 ;; hyperlinks into the current org-mode document at point.
37 ;; This code is heavily based on, and indeed incorporates,
38 ;; org-mac-message.el written by John Wiegley and Christopher
41 ;; Detailed comments for each application interface are inlined with
42 ;; the code. Here is a brief overview of how the code interacts with
45 ;; Finder.app - grab links to the selected files in the frontmost window
46 ;; Mail.app - grab links to the selected messages in the message list
47 ;; AddressBook.app - Grab links to the selected addressbook Cards
48 ;; Firefox.app - Grab the url of the frontmost tab in the frontmost window
49 ;; Vimperator/Firefox.app - Grab the url of the frontmost tab in the frontmost window
50 ;; Safari.app - Grab the url of the frontmost tab in the frontmost window
51 ;; Google Chrome.app - Grab the url of the frontmost tab in the frontmost window
52 ;; Together.app - Grab links to the selected items in the library list
53 ;; Skim.app - Grab a link to the selected page in the topmost pdf document
58 ;; add (require 'org-mac-link) to your .emacs, and optionally bind a
59 ;; key to activate the link grabber menu, like this:
61 ;; (add-hook 'org-mode-hook (lambda ()
62 ;; (define-key org-mode-map (kbd "C-c g") 'org-mac-grab-link)))
66 ;; Type C-c g (or whatever key you defined, as above), or type M-x
67 ;; org-mac-grab-link RET to activate the link grabber. This will present
68 ;; you with a menu to choose an application from which to grab a link
69 ;; to insert at point. You may also type C-g to abort.
73 ;; You may customize which applications appear in the grab menu by
74 ;; customizing the group `org-mac-link'. Changes take effect
82 (defgroup org-mac-link nil
83 "Options concerning grabbing links from external Mac
84 applications and inserting them in org documents"
88 (defcustom org-mac-grab-Finder-app-p t
89 "Enable menu option [F]inder to grab links from the Finder"
90 :tag
"Grab Finder.app links"
94 (defcustom org-mac-grab-Mail-app-p t
95 "Enable menu option [m]ail to grab links from Mail.app"
96 :tag
"Grab Mail.app links"
100 (defcustom org-mac-grab-Addressbook-app-p t
101 "Enable menu option [a]ddressbook to grab links from AddressBook.app"
102 :tag
"Grab AddressBook.app links"
106 (defcustom org-mac-grab-Safari-app-p t
107 "Enable menu option [s]afari to grab links from Safari.app"
108 :tag
"Grab Safari.app links"
112 (defcustom org-mac-grab-Firefox-app-p t
113 "Enable menu option [f]irefox to grab links from Firefox.app"
114 :tag
"Grab Firefox.app links"
118 (defcustom org-mac-grab-Firefox
+Vimperator-p nil
119 "Enable menu option [v]imperator to grab links from Firefox.app running the Vimperator plugin"
120 :tag
"Grab Vimperator/Firefox.app links"
124 (defcustom org-mac-grab-Chrome-app-p t
125 "Enable menu option [f]irefox to grab links from Google Chrome.app"
126 :tag
"Grab Google Chrome.app links"
130 (defcustom org-mac-grab-Together-app-p nil
131 "Enable menu option [t]ogether to grab links from Together.app"
132 :tag
"Grab Together.app links"
136 (defcustom org-mac-grab-Skim-app-p
137 (< 0 (length (shell-command-to-string
138 "mdfind kMDItemCFBundleIdentifier == 'net.sourceforge.skim-app.skim'")))
139 "Enable menu option [S]kim to grab page links from Skim.app"
140 :tag
"Grab Skim.app page links"
144 (defcustom org-mac-Skim-highlight-selection-p nil
145 "Highlight (using notes) the selection (if present) when grabbing the a link from Skim.app"
146 :tag
"Highlight selection in Skim.app"
150 (defgroup org-mac-flagged-mail nil
151 "Options concerning linking to flagged Mail.app messages."
155 (defcustom org-mac-mail-account
"customize"
156 "The Mail.app account in which to search for flagged messages."
157 :group
'org-mac-flagged-mail
161 ;; In mac.c, removed in Emacs 23.
162 (declare-function do-applescript
"org-mac-message" (script))
163 (unless (fboundp 'do-applescript
)
164 ;; Need to fake this using shell-command-to-string
165 (defun do-applescript (script)
166 (let (start cmd return
)
167 (while (string-match "\n" script
)
168 (setq script
(replace-match "\r" t t script
)))
169 (while (string-match "'" script start
)
170 (setq start
(+ 2 (match-beginning 0))
171 script
(replace-match "\\'" t t script
)))
172 (setq cmd
(concat "osascript -e '" script
"'"))
173 (setq return
(shell-command-to-string cmd
))
174 (concat "\"" (org-trim return
) "\""))))
177 (defun org-mac-grab-link ()
178 "Prompt the user for an application to grab a link from, then go grab the link, and insert it at point"
180 (let* ((descriptors `(("F" "inder" org-mac-finder-insert-selected
,org-mac-grab-Finder-app-p
)
181 ("m" "ail" org-mac-message-insert-selected
,org-mac-grab-Mail-app-p
)
182 ("a" "ddressbook" org-mac-addressbook-insert-selected
,org-mac-grab-Addressbook-app-p
)
183 ("s" "afari" org-mac-safari-insert-frontmost-url
,org-mac-grab-Safari-app-p
)
184 ("f" "irefox" org-mac-firefox-insert-frontmost-url
,org-mac-grab-Firefox-app-p
)
185 ("v" "imperator" org-mac-vimperator-insert-frontmost-url
,org-mac-grab-Firefox
+Vimperator-p
)
186 ("c" "hrome" org-mac-chrome-insert-frontmost-url
,org-mac-grab-Chrome-app-p
)
187 ("t" "ogether" org-mac-together-insert-selected
,org-mac-grab-Together-app-p
)
188 ("S" "kim" org-mac-skim-insert-page
,org-mac-grab-Skim-app-p
)))
189 (menu-string (make-string 0 ?x
))
192 ;; Create the menu string for the keymap
193 (mapc '(lambda (descriptor)
194 (when (elt descriptor
3)
195 (setf menu-string
(concat menu-string
"[" (elt descriptor
0) "]" (elt descriptor
1) " "))))
197 (setf (elt menu-string
(- (length menu-string
) 1)) ?
:)
199 ;; Prompt the user, and grab the link
200 (message menu-string
)
201 (setq input
(read-char-exclusive))
202 (mapc '(lambda (descriptor)
203 (let ((key (elt (elt descriptor
0) 0))
204 (active (elt descriptor
3))
205 (grab-function (elt descriptor
2)))
206 (when (and active
(eq input key
))
207 (call-interactively grab-function
))))
210 (defun org-mac-paste-applescript-links (as-link-list)
211 "Paste in a list of links from an applescript handler. The
212 links are of the form <link>::split::<name>"
215 (lambda (x) (if (string-match "\\`\"\\(.*\\)\"\\'" x
) (setq x
(match-string 1 x
))) x
)
216 (split-string as-link-list
"[\r\n]+")))
217 split-link URL description orglink orglink-insert rtn orglink-list
)
219 (setq split-link
(split-string (pop link-list
) "::split::"))
220 (setq URL
(car split-link
))
221 (setq description
(cadr split-link
))
222 (when (not (string= URL
""))
223 (setq orglink
(org-make-link-string URL description
))
224 (push orglink orglink-list
)))
225 (setq rtn
(mapconcat 'identity orglink-list
"\n"))
231 ;; Handle links from Firefox.app
233 ;; This code allows you to grab the current active url from the main
234 ;; Firefox.app window, and insert it as a link into an org-mode
235 ;; document. Unfortunately, firefox does not expose an applescript
236 ;; dictionary, so this is necessarily introduces some limitations.
238 ;; The applescript to grab the url from Firefox.app uses the System
239 ;; Events application to give focus to the firefox application, select
240 ;; the contents of the url bar, and copy it. It then uses the title of
241 ;; the window as the text of the link. There is no way to grab links
242 ;; from other open tabs, and further, if there is more than one window
243 ;; open, it is not clear which one will be used (though emperically it
244 ;; seems that it is always the last active window).
246 (defun org-as-mac-firefox-get-frontmost-url ()
247 (let ((result (do-applescript
249 "set oldClipboard to the clipboard\n"
250 "set frontmostApplication to path to frontmost application\n"
251 "tell application \"Firefox\"\n"
254 " tell application \"System Events\"\n"
255 " keystroke \"l\" using {command down}\n"
256 " keystroke \"a\" using {command down}\n"
257 " keystroke \"c\" using {command down}\n"
260 " set theUrl to the clipboard\n"
261 " set the clipboard to oldClipboard\n"
262 " set theResult to (get theUrl) & \"::split::\" & (get name of window 1)\n"
264 "activate application (frontmostApplication as text)\n"
266 "copy theResult to the end of links\n"
267 "return links as string\n"))))
268 (car (split-string result
"[\r\n]+" t
))))
270 (defun org-mac-firefox-get-frontmost-url ()
272 (message "Applescript: Getting Firefox url...")
273 (let* ((url-and-title (org-as-mac-firefox-get-frontmost-url))
274 (split-link (split-string url-and-title
"::split::"))
275 (URL (car split-link
))
276 (description (cadr split-link
))
278 (when (not (string= URL
""))
279 (setq org-link
(org-make-link-string URL description
)))
283 (defun org-mac-firefox-insert-frontmost-url ()
285 (insert (org-mac-firefox-get-frontmost-url)))
288 ;; Handle links from Google Firefox.app running the Vimperator extension
289 ;; Grab the frontmost url from Firefox+Vimperator. Same limitations are
292 (defun org-as-mac-vimperator-get-frontmost-url ()
293 (let ((result (do-applescript
295 "set oldClipboard to the clipboard\n"
296 "set frontmostApplication to path to frontmost application\n"
297 "tell application \"Firefox\"\n"
300 " tell application \"System Events\"\n"
304 " set theUrl to the clipboard\n"
305 " set the clipboard to oldClipboard\n"
306 " set theResult to (get theUrl) & \"::split::\" & (get name of window 1)\n"
308 "activate application (frontmostApplication as text)\n"
310 "copy theResult to the end of links\n"
311 "return links as string\n"))))
312 (replace-regexp-in-string "\s+-\s+Vimperator" "" (car (split-string result
"[\r\n]+" t
)))))
315 (defun org-mac-vimperator-get-frontmost-url ()
317 (message "Applescript: Getting Vimperator url...")
318 (let* ((url-and-title (org-as-mac-vimperator-get-frontmost-url))
319 (split-link (split-string url-and-title
"::split::"))
320 (URL (car split-link
))
321 (description (cadr split-link
))
323 (when (not (string= URL
""))
324 (setq org-link
(org-make-link-string URL description
)))
328 (defun org-mac-vimperator-insert-frontmost-url ()
330 (insert (org-mac-vimperator-get-frontmost-url)))
333 ;; Handle links from Google Chrome.app
334 ;; Grab the frontmost url from Google Chrome. Same limitations as
335 ;; Firefox because Chrome doesn't publish an Applescript dictionary
337 (defun org-as-mac-chrome-get-frontmost-url ()
338 (let ((result (do-applescript
340 "set oldClipboard to the clipboard\n"
341 "set frontmostApplication to path to frontmost application\n"
342 "tell application \"Google Chrome\"\n"
345 " tell application \"System Events\"\n"
346 " keystroke \"l\" using command down\n"
347 " keystroke \"c\" using command down\n"
350 " set theUrl to the clipboard\n"
351 " set the clipboard to oldClipboard\n"
352 " set theResult to (get theUrl) & \"::split::\" & (get name of window 1)\n"
354 "activate application (frontmostApplication as text)\n"
356 "copy theResult to the end of links\n"
357 "return links as string\n"))))
358 (car (split-string result
"[\r\n]+" t
))))
360 (defun org-mac-chrome-get-frontmost-url ()
362 (message "Applescript: Getting Chrome url...")
363 (let* ((url-and-title (org-as-mac-chrome-get-frontmost-url))
364 (split-link (split-string url-and-title
"::split::"))
365 (URL (car split-link
))
366 (description (cadr split-link
))
368 (when (not (string= URL
""))
369 (setq org-link
(org-make-link-string URL description
)))
373 (defun org-mac-chrome-insert-frontmost-url ()
375 (insert (org-mac-chrome-get-frontmost-url)))
378 ;; Handle links from Safari.app
379 ;; Grab the frontmost url from Safari.
381 (defun org-as-mac-safari-get-frontmost-url ()
382 (let ((result (do-applescript
384 "tell application \"Safari\"\n"
385 " set theUrl to URL of document 1\n"
386 " set theName to the name of the document 1\n"
387 " return theUrl & \"::split::\" & theName & \"\n\"\n"
389 (car (split-string result
"[\r\n]+" t
))))
391 (defun org-mac-safari-get-frontmost-url ()
393 (message "Applescript: Getting Safari url...")
394 (let* ((url-and-title (org-as-mac-safari-get-frontmost-url))
395 (split-link (split-string url-and-title
"::split::"))
396 (URL (car split-link
))
397 (description (cadr split-link
))
399 (when (not (string= URL
""))
400 (setq org-link
(org-make-link-string URL description
)))
404 (defun org-mac-safari-insert-frontmost-url ()
406 (insert (org-mac-safari-get-frontmost-url)))
411 ;; Handle links from together.app
415 (org-add-link-type "x-together-item" 'org-mac-together-item-open
)
417 (defun org-mac-together-item-open (uid)
418 "Open the given uid, which is a reference to an item in Together"
419 (shell-command (concat "open -a Together \"x-together-item:" uid
"\"")))
421 (defun as-get-selected-together-items ()
424 "tell application \"Together\"\n"
425 " set theLinkList to {}\n"
426 " set theSelection to selected items\n"
427 " repeat with theItem in theSelection\n"
428 " set theLink to (get item link of theItem) & \"::split::\" & (get name of theItem) & \"\n\"\n"
429 " copy theLink to end of theLinkList\n"
431 " return theLinkList as string\n"
434 (defun org-mac-together-get-selected ()
436 (message "Applescript: Getting Togther items...")
437 (org-mac-paste-applescript-links (as-get-selected-together-items)))
439 (defun org-mac-together-insert-selected ()
441 (insert (org-mac-together-get-selected)))
446 ;; Handle links from Finder.app
450 (defun as-get-selected-finder-items ()
453 "tell application \"Finder\"\n"
454 " set theSelection to the selection\n"
456 " repeat with theItem in theSelection\n"
457 " set theLink to \"file://\" & (POSIX path of (theItem as string)) & \"::split::\" & (get the name of theItem) & \"\n\"\n"
458 " copy theLink to the end of links\n"
460 " return links as string\n"
463 (defun org-mac-finder-item-get-selected ()
465 (message "Applescript: Getting Finder items...")
466 (org-mac-paste-applescript-links (as-get-selected-finder-items)))
468 (defun org-mac-finder-insert-selected ()
470 (insert (org-mac-finder-item-get-selected)))
475 ;; Handle links from AddressBook.app
479 (org-add-link-type "addressbook" 'org-mac-addressbook-item-open
)
481 (defun org-mac-addressbook-item-open (uid)
482 "Open the given uid, which is a reference to an item in Together"
483 (shell-command (concat "open \"addressbook:" uid
"\"")))
485 (defun as-get-selected-addressbook-items ()
488 "tell application \"Address Book\"\n"
489 " set theSelection to the selection\n"
491 " repeat with theItem in theSelection\n"
492 " set theLink to \"addressbook://\" & (the id of theItem) & \"::split::\" & (the name of theItem) & \"\n\"\n"
493 " copy theLink to the end of links\n"
495 " return links as string\n"
498 (defun org-mac-addressbook-item-get-selected ()
500 (message "Applescript: Getting Address Book items...")
501 (org-mac-paste-applescript-links (as-get-selected-addressbook-items)))
503 (defun org-mac-addressbook-insert-selected ()
505 (insert (org-mac-addressbook-item-get-selected)))
509 ;; Handle links from Skim.app
511 ;; Original code & idea by Christopher Suckling (org-mac-protocol)
513 (org-add-link-type "skim" 'org-mac-skim-open
)
515 (defun org-mac-skim-open (uri)
516 "Visit page of pdf in Skim"
517 (let* ((page (when (string-match "::\\(.+\\)\\'" uri
)
518 (match-string 1 uri
)))
519 (document (substring uri
0 (match-beginning 0))))
522 "tell application \"Skim\"\n"
524 "set theDoc to \"" document
"\"\n"
525 "set thePage to " page
"\n"
527 "go document 1 to page thePage of document 1\n"
531 (defun as-get-skim-page-link ()
534 "tell application \"Skim\"\n"
535 "set theDoc to front document\n"
536 "set theTitle to (name of theDoc)\n"
537 "set thePath to (path of theDoc)\n"
538 "set thePage to (get index for current page of theDoc)\n"
539 "set theSelection to selection of theDoc\n"
540 "set theContent to contents of (get text for theSelection)\n"
541 "if theContent is missing value then\n"
542 " set theContent to theTitle & \", p. \" & thePage\n"
543 (when org-mac-Skim-highlight-selection-p
547 " set theNote to make note with properties {type:highlight note, selection:theSelection}\n"
548 " set text of theNote to (get text for theSelection)\n"
551 "set theLink to \"skim://\" & thePath & \"::\" & thePage & "
552 "\"::split::\" & theContent\n"
554 "return theLink as string\n")))
556 (defun org-mac-skim-get-page ()
558 (message "Applescript: Getting Skim page link...")
559 (let* ((link-and-descr (as-get-skim-page-link))
560 (split-link (split-string link-and-descr
"::split::"))
561 (link (car split-link
))
562 (description (cadr split-link
))
564 (when (not (string= link
""))
565 (setq org-link
(org-make-link-string link description
)))
569 (defun org-mac-skim-insert-page ()
571 (insert (org-mac-skim-get-page)))
577 ;; Handle links from Mail.app
580 (org-add-link-type "message" 'org-mac-message-open
)
582 (defun org-mac-message-open (message-id)
583 "Visit the message with the given MESSAGE-ID.
584 This will use the command `open' with the message URL."
585 (start-process (concat "open message:" message-id
) nil
586 "open" (concat "message://<" (substring message-id
2) ">")))
588 (defun org-as-get-selected-mail ()
589 "AppleScript to create links to selected messages in Mail.app."
592 "tell application \"Mail\"\n"
593 "set theLinkList to {}\n"
594 "set theSelection to selection\n"
595 "repeat with theMessage in theSelection\n"
596 "set theID to message id of theMessage\n"
597 "set theSubject to subject of theMessage\n"
598 "set theLink to \"message://\" & theID & \"::split::\" & theSubject & \"\n\"\n"
599 "copy theLink to end of theLinkList\n"
601 "return theLinkList as string\n"
604 (defun org-as-get-flagged-mail ()
605 "AppleScript to create links to flagged messages in Mail.app."
608 ;; Is Growl installed?
609 "tell application \"System Events\"\n"
610 "set growlHelpers to the name of every process whose creator type contains \"GRRR\"\n"
611 "if (count of growlHelpers) > 0 then\n"
612 "set growlHelperApp to item 1 of growlHelpers\n"
614 "set growlHelperApp to \"\"\n"
619 "tell application \"Mail\"\n"
620 "set theMailboxes to every mailbox of account \"" org-mac-mail-account
"\"\n"
621 "set theLinkList to {}\n"
622 "repeat with aMailbox in theMailboxes\n"
623 "set theSelection to (every message in aMailbox whose flagged status = true)\n"
624 "repeat with theMessage in theSelection\n"
625 "set theID to message id of theMessage\n"
626 "set theSubject to subject of theMessage\n"
627 "set theLink to \"message://\" & theID & \"::split::\" & theSubject & \"\n\"\n"
628 "copy theLink to end of theLinkList\n"
630 ;; Report progress through Growl
631 ;; This "double tell" idiom is described in detail at
632 ;; http://macscripter.net/viewtopic.php?id=24570 The
633 ;; script compiler needs static knowledge of the
634 ;; growlHelperApp. Hmm, since we're compiling
635 ;; on-the-fly here, this is likely to be way less
636 ;; portable than I'd hoped. It'll work when the name
637 ;; is still "GrowlHelperApp", though.
638 "if growlHelperApp is not \"\" then\n"
639 "tell application \"GrowlHelperApp\"\n"
640 "tell application growlHelperApp\n"
641 "set the allNotificationsList to {\"FlaggedMail\"}\n"
642 "set the enabledNotificationsList to allNotificationsList\n"
643 "register as application \"FlaggedMail\" all notifications allNotificationsList default notifications enabledNotificationsList icon of application \"Mail\"\n"
644 "notify with name \"FlaggedMail\" title \"Importing flagged message\" description theSubject application name \"FlaggedMail\"\n"
650 "return theLinkList as string\n"
653 (defun org-mac-message-get-links (&optional select-or-flag
)
654 "Create links to the messages currently selected or flagged in Mail.app.
655 This will use AppleScript to get the message-id and the subject of the
656 messages in Mail.app and make a link out of it.
657 When SELECT-OR-FLAG is \"s\", get the selected messages (this is also
658 the default). When SELECT-OR-FLAG is \"f\", get the flagged messages.
659 The Org-syntax text will be pushed to the kill ring, and also returned."
660 (interactive "sLink to (s)elected or (f)lagged messages: ")
661 (setq select-or-flag
(or select-or-flag
"s"))
662 (message "AppleScript: searching mailboxes...")
664 (if (string= select-or-flag
"s")
665 (org-as-get-selected-mail)
666 (if (string= select-or-flag
"f")
667 (org-as-get-flagged-mail)
668 (error "Please select \"s\" or \"f\""))))
671 (lambda (x) (if (string-match "\\`\"\\(.*\\)\"\\'" x
) (setq x
(match-string 1 x
))) x
)
672 (split-string as-link-list
"[\r\n]+")))
673 split-link URL description orglink orglink-insert rtn orglink-list
)
675 (setq split-link
(split-string (pop link-list
) "::split::"))
676 (setq URL
(car split-link
))
677 (setq description
(cadr split-link
))
678 (when (not (string= URL
""))
679 (setq orglink
(org-make-link-string URL description
))
680 (push orglink orglink-list
)))
681 (setq rtn
(mapconcat 'identity orglink-list
"\n"))
685 (defun org-mac-message-insert-selected ()
686 "Insert a link to the messages currently selected in Mail.app.
687 This will use AppleScript to get the message-id and the subject of the
688 active mail in Mail.app and make a link out of it."
690 (insert (org-mac-message-get-links "s")))
692 ;; The following line is for backward compatibility
693 (defalias 'org-mac-message-insert-link
'org-mac-message-insert-selected
)
695 (defun org-mac-message-insert-flagged (org-buffer org-heading
)
696 "Asks for an org buffer and a heading within it, and replace message links.
697 If heading exists, delete all message:// links within heading's first
698 level. If heading doesn't exist, create it at point-max. Insert
699 list of message:// links to flagged mail after heading."
700 (interactive "bBuffer in which to insert links: \nsHeading after which to insert links: ")
701 (with-current-buffer org-buffer
702 (goto-char (point-min))
703 (let ((isearch-forward t
)
704 (message-re "\\[\\[\\(message:\\)\\([^]]+\\)\\]\\(\\[\\([^]]+\\)\\]\\)?\\]"))
705 (if (org-goto-local-search-headings org-heading nil t
)
709 (while (re-search-forward
710 message-re
(save-excursion (outline-next-heading)) t
)
711 (delete-region (match-beginning 0) (match-end 0)))
712 (insert "\n" (org-mac-message-get-links "f")))
713 (flush-lines "^$" (point) (outline-next-heading)))
714 (insert "\n" (org-mac-message-get-links "f")))
715 (goto-char (point-max))
717 (org-insert-heading nil t
)
718 (insert org-heading
"\n" (org-mac-message-get-links "f"))))))
721 (provide 'org-mac-link
)
723 ;;; org-mac-link.el ends here