From 9b8a96cbb309a15de39e0498eb0d22b8f3f3446f Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 14 Apr 2020 03:22:29 -0400 Subject: [PATCH] Add org handler for 'pdf:' link --- .emacs.d/init.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index ca77c74..df4d3ce 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -256,7 +256,14 @@ :config (org-babel-do-load-languages 'org-babel-load-languages - '((ipython . t))))) + '((ipython . t)))) + + (defun org-link--open-pdf (path) + (let ((path-parts (split-string path "::"))) + (apply 'call-process "evince" nil 0 nil (car path-parts) + (when (cadr path-parts) (list "--page-index" (cadr path-parts)))))) + + (org-link-set-parameters "pdf" :follow 'org-link--open-pdf)) (use-package windmove :demand :config