diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-08-12 23:51:25 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-08-12 23:51:25 -0400 |
commit | c53dea0426c895b0693f4deeb75c4579b668d212 (patch) | |
tree | 33c0985f6af879752d5060f92e415c6f2d76ee74 /lisp | |
parent | fedaee2f352affbb0bb3c5aa057bccaa12a16a0b (diff) | |
download | emacs.d-c53dea0426c895b0693f4deeb75c4579b668d212.tar.gz |
org-open-file-at-point: Recognize region
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-org.el | 5 |
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"))))) |