diff options
author | Alan Schmitt <alan.schmitt@polytechnique.org> | 2014-06-04 11:47:09 +0200 |
---|---|---|
committer | Alan Schmitt <alan.schmitt@polytechnique.org> | 2014-06-07 09:34:35 +0200 |
commit | 73bada5d84fc22dd024bc3ca4feefccf299f46d0 (patch) | |
tree | 989c8d387f2c70ccf03ebeab402ce953b1b1d616 | |
parent | 6fb033c791b94b28d052ad77d83e53b36c02bfd6 (diff) | |
download | org-mode-73bada5d84fc22dd024bc3ca4feefccf299f46d0.tar.gz |
org-mac-link.el: Tweak AppleScript to grab Mail.app messages
* contrib/lisp/org-mac-link.el (org-as-get-selected-mail): Make sure
no extra new line is present in the string returned from the
AppleScript.
* contrib/lisp/org-mac-link.el (org-mac-message-get-links): Get rid of
the enclosing quotes before splitting the string.
-rw-r--r-- | contrib/lisp/org-mac-link.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el index d1687e0..2eafa1b 100644 --- a/contrib/lisp/org-mac-link.el +++ b/contrib/lisp/org-mac-link.el @@ -8,6 +8,7 @@ ;; John Wiegley <johnw@gnu.org> ;; Christopher Suckling <suckling at gmail dot com> ;; Daniil Frumin <difrumin@gmail.com> +;; Alan Schmitt <alan.schmitt@polytechnique.org> ;; ;; ;; Version: 1.1 @@ -727,7 +728,10 @@ This will use the command `open' with the message URL." "repeat with theMessage in theSelection\n" "set theID to message id of theMessage\n" "set theSubject to subject of theMessage\n" - "set theLink to \"message://\" & theID & \"::split::\" & theSubject & \"\n\"\n" + "set theLink to \"message://\" & theID & \"::split::\" & theSubject\n" + "if (theLinkList is not equal to {}) then\n" + "set theLink to \"\n\" & theLink\n" + "end if\n" "copy theLink to end of theLinkList\n" "end repeat\n" "return theLinkList as string\n" @@ -801,7 +805,7 @@ The Org-syntax text will be pushed to the kill ring, and also returned." (link-list (mapcar (lambda (x) (if (string-match "\\`\"\\(.*\\)\"\\'" x) (setq x (match-string 1 x))) x) - (split-string as-link-list "[\r\n]+"))) + (split-string (substring as-link-list 1 -1) "[\r\n]+"))) split-link URL description orglink orglink-insert rtn orglink-list) (while link-list (setq split-link (split-string (pop link-list) "::split::")) |