summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/init-org.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el
index a7ffd81..b746733 100644
--- a/lisp/init-org.el
+++ b/lisp/init-org.el
@@ -763,7 +763,10 @@ to be easily overriden.")
(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)))
+ (let ((file (or (and (use-region-p)
+ (buffer-substring-no-properties
+ (region-beginning) (region-end)))
+ (thing-at-point 'filename))))
(if (and file (file-exists-p file))
(org-open-file file)
(user-error "No file at point")))))