summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-06-12 01:18:42 -0400
committerKyle Meyer <kyle@kyleam.com>2015-06-12 01:18:42 -0400
commit3f6259886af723b281c138a6ce79bf4ffae22789 (patch)
tree0de9c7c5d3d0b7e45a4905adee4a924a7dbf09ea /lisp
parentb98a78b34ae3d0686ebf2c9581db77c43314fc82 (diff)
downloademacs.d-3f6259886af723b281c138a6ce79bf4ffae22789.tar.gz
org-open-file-at-point: Support Org links
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-org.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el
index 99f55ef..2eb4995 100644
--- a/lisp/init-org.el
+++ b/lisp/init-org.el
@@ -799,10 +799,13 @@ to be easily overriden.")
(defun km/org-open-file-at-point ()
"Open file at point with `org-open-file'."
(interactive)
- (let ((file (thing-at-point 'filename)))
- (if (and file (file-exists-p file))
- (org-open-file file)
- (user-error "No file at point"))))
+ (if (and (derived-mode-p 'org-mode)
+ (org-element-lineage (org-element-context) '(link) t))
+ (org-open-at-point)
+ (let ((file (thing-at-point 'filename)))
+ (if (and file (file-exists-p file))
+ (org-open-file file)
+ (user-error "No file at point")))))
(defun km/org-open-file ()
"Interactive version of `org-open-file'."