summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-09-12 01:01:18 -0400
committerKyle Meyer <kyle@kyleam.com>2014-09-12 01:01:18 -0400
commit158989de65409042f4933ec2cea118e91a285257 (patch)
treeb15be546f2ed30157eeab5fbd9183c18e077f051 /lisp
parent1b6be9daf60a5e92eb0cf03d946c1478ed8df40c (diff)
downloademacs.d-158989de65409042f4933ec2cea118e91a285257.tar.gz
Add org-open-file-at-point
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-org.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el
index 858b7de..be05b84 100644
--- a/lisp/init-org.el
+++ b/lisp/init-org.el
@@ -38,6 +38,17 @@
(interactive)
(find-file org-default-notes-file))
+(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"))))
+
+(after 'init-buffile
+ (define-key km/file-map "p" 'km/org-open-file-at-point))
+
(setq initial-major-mode 'org-mode)
(define-prefix-command 'km/global-org-map)