summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorAndreas Politz <politza@hochschule-trier.de>2018-04-28 17:24:50 +0200
committerAndreas Politz <politza@hochschule-trier.de>2018-04-28 17:27:59 +0200
commit5209f620c85e6c7c23e96768ebae6b5c6f79f3e1 (patch)
tree0d90d3fa7626f9c24930ffabcfe1c8d27477a53d /lisp
parent50a5297b82e26cfd52f6c00645ddc1057099d6a7 (diff)
Improve opening of URI links with Org
Diffstat (limited to 'lisp')
-rw-r--r--lisp/pdf-links.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/pdf-links.el b/lisp/pdf-links.el
index 1d69db2..24baa3c 100644
--- a/lisp/pdf-links.el
+++ b/lisp/pdf-links.el
@@ -27,6 +27,7 @@
(require 'pdf-cache)
(require 'pdf-isearch)
(require 'let-alist)
+(require 'org)
;;; Code:
@@ -81,7 +82,7 @@ reading links."
(>= x 0))))))
(defcustom pdf-links-browse-uri-function
- 'org-open-link-from-string
+ 'pdf-links-browse-uri-default
"The function for handling uri links.
This function should accept one argument, the URI to follow, and
@@ -361,8 +362,15 @@ See `pdf-links-action-perform' for the interface."
m))
matches)))
-(provide 'pdf-links)
+(defun pdf-links-browse-uri-default (uri)
+ "Open the string URI using Org.
+Wraps the URI in \[\[ ... \]\] and calls `org-open-link-from-string'
+on the resulting string."
+ (cl-check-type uri string)
+ (message "Opening `%s' with Org" uri)
+ (org-open-link-from-string (format "[[%s]]" uri)))
+(provide 'pdf-links)
;;; pdf-links.el ends here