From 313a6938101c868c5633fa82e6acea87486277dd Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 8 Jul 2020 16:51:29 +0100 Subject: org-pdfview and related cleanups --- org/jao-org-links.el | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'org/jao-org-links.el') diff --git a/org/jao-org-links.el b/org/jao-org-links.el index 4f8d606..fcb0825 100644 --- a/org/jao-org-links.el +++ b/org/jao-org-links.el @@ -1,9 +1,25 @@ (require 'jao-org-utils) -(require 'jao-devon) +(require 'jao-org-pdfview) -(autoload 'jao-as-safari-doc "jao-applescript.el") +(jao-when-darwin + (require 'jao-devon) + + (autoload 'jao-as-safari-doc "jao-applescript.el") + + (defun jao-org-insert-devon-link () + (interactive) + (insert (jao-devon-selection))) + + (defun jao-org-insert-safari-link () + (interactive) + (let ((ln (jao-as-safari-doc))) + (when ln (jao-org-insert-link (car ln) (cdr ln))))) + + (org-add-link-type "x-devonthink-item" 'jao-devon-open 'identity) + + (define-key org-mode-map "\C-cd" 'jao-org-insert-devon-link) + (define-key org-mode-map "\C-cs" 'jao-org-insert-safari-link)) -;; doc links (defvar jao-org--sink-dir "./") (defun jao-org-follow-doc (link) @@ -19,13 +35,6 @@ (shell-command (format "mv %s %s" real-file dest-path)))) (browse-url (format "file://%s" (expand-file-name dest-path))))) -;; devon links -(org-add-link-type "x-devonthink-item" 'jao-devon-open 'identity) - -(defun jao-org-insert-devon-link () - (interactive) - (insert (jao-devon-selection))) - (defsubst jao-org--title->file (title) (concat (mapconcat 'downcase (split-string title nil t) "-") ".pdf")) @@ -37,10 +46,4 @@ (org-add-link-type "doc" 'jao-org-follow-doc 'identity) (setq jao-org--sink-dir (file-name-as-directory sink-dir))) -(defun jao-org-insert-safari-link () - (interactive) - (let ((ln (jao-as-safari-doc))) - (when ln (jao-org-insert-link (car ln) (cdr ln))))) - - (provide 'jao-org-links) -- cgit v1.2.3