Hi,
I would like to add autoload cookies for commands in org-mac-link.el, so
I don't have to autoload them manually in my init.el.
>From 5e00fa82001b57051770f0e4854e03ece39cc68d Mon Sep 17 00:00:00 2001
From: Chunyang Xu
Date: Wed, 16 Nov 2016 21:30:13 +0800
Subject: [PATCH] org-mac-link: Add autoload cookies for all commands
---
contrib/lisp/org-mac-link.el | 27 +++
1 file changed, 27 insertions(+)
diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el
index ae2def3..f8a44c7 100644
--- a/contrib/lisp/org-mac-link.el
+++ b/contrib/lisp/org-mac-link.el
@@ -233,6 +233,7 @@
(setq return (shell-command-to-string cmd))
(concat "\"" (org-trim return) "\""
+;;;###autoload
(defun org-mac-grab-link ()
"Prompt for an application to grab a link from.
When done, go grab the link, and insert it at point."
@@ -340,11 +341,13 @@ The links are of the form ::split::."
"return links as string\n"
(car (split-string result "[\r\n]+" t
+;;;###autoload
(defun org-mac-firefox-get-frontmost-url ()
(interactive)
(message "Applescript: Getting Firefox url...")
(org-mac-paste-applescript-links (org-as-mac-firefox-get-frontmost-url)))
+;;;###autoload
(defun org-mac-firefox-insert-frontmost-url ()
(interactive)
(insert (org-mac-firefox-get-frontmost-url)))
@@ -378,11 +381,13 @@ The links are of the form ::split::."
(replace-regexp-in-string
"\s+-\s+Vimperator" "" (car (split-string result "[\r\n]+" t)
+;;;###autoload
(defun org-mac-vimperator-get-frontmost-url ()
(interactive)
(message "Applescript: Getting Vimperator url...")
(org-mac-paste-applescript-links (org-as-mac-vimperator-get-frontmost-url)))
+;;;###autoload
(defun org-mac-vimperator-insert-frontmost-url ()
(interactive)
(insert (org-mac-vimperator-get-frontmost-url)))
@@ -408,11 +413,13 @@ The links are of the form ::split::."
(replace-regexp-in-string
"^\"\\|\"$" "" (car (split-string result "[\r\n]+" t)
+;;;###autoload
(defun org-mac-chrome-get-frontmost-url ()
(interactive)
(message "Applescript: Getting Chrome url...")
(org-mac-paste-applescript-links (org-as-mac-chrome-get-frontmost-url)))
+;;;###autoload
(defun org-mac-chrome-insert-frontmost-url ()
(interactive)
(insert (org-mac-chrome-get-frontmost-url)))
@@ -430,12 +437,14 @@ The links are of the form ::split::."
" return theUrl & \"::split::\" & theName & \"\n\"\n"
"end tell\n")))
+;;;###autoload
(defun org-mac-safari-get-frontmost-url ()
(interactive)
(message "Applescript: Getting Safari url...")
(org-mac-paste-applescript-links
(org-as-mac-safari-get-frontmost-url)))
+;;;###autoload
(defun org-mac-safari-insert-frontmost-url ()
(interactive)
(insert (org-mac-safari-get-frontmost-url)))
@@ -461,11 +470,13 @@ The links are of the form ::split::."
" return theLinkList as string\n"
"end tell")))
+;;;###autoload
(defun org-mac-together-get-selected ()
(interactive)
(message "Applescript: Getting Togther items...")
(org-mac-paste-applescript-links (as-get-selected-together-items)))
+;;;###autoload
(defun org-mac-together-insert-selected ()
(interactive)
(insert (org-mac-together-get-selected)))
@@ -486,11 +497,13 @@ The links are of the form ::split::."
" return links as string\n"
"end tell\n")))
+;;;###autoload
(defun org-mac-finder-item-get-selected ()
(interactive)
(message "Applescript: Getting Finder items...")
(org-mac-paste-applescript-links (as-get-selected-finder-items)))
+;;;###autoload
(defun org-mac-finder-insert-selected ()
(interactive)
(insert (org-mac-finder-item-get-selected)))
@@ -516,11 +529,13 @@ The links are of the form ::split::."
" return links as string\n"
"end tell\n")))
+;;;###autoload
(defun org-mac-addressbook-item-get-selected ()
(interactive)
(message "Applescript: Getting Address Book items...")
(org-mac-paste-applescript-links (as-get-selected-addressbook-items)))
+;;;###autoload
(defun org-mac-addressbook-insert-selected ()
(interactive)
(insert (org-mac-addressbook-item-get-selected)))
@@ -572,11 +587,13 @@ The links are of the form ::split::."
"end tell\n"
"return theLink as string\n")))
+;;;###autoload
(defun org-mac-skim-get-page ()
(interactive)
(message "Applescript: Getting Skim page link...")
(org-mac-paste-applescript-links (as-get-skim-page-link)))
+;;;###autoload
(defun org-mac-skim-insert-page ()
(interactive)
(insert (org-mac-skim-get-page)))
@@ -623,11 +640,13 @@ The links are of the form ::split::."
"set theResult to \"acrobat:\" & thePath & \"::\" & thePage & \"::split::\" & theTitle & \", p.\" & theLabel\n"
"return theResult as string\n")))
+;;;###autoload
(defun org-mac-acrobat-get-page ()
(interactive)
(message "Applescript: Getting Acrobat page link...")