diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-08-11 01:19:50 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-08-11 01:19:50 -0400 |
commit | 9a825577040ff0f5b469eeff36eea3d031639193 (patch) | |
tree | 867a574382b1906f3c41a9419e3d34a932bdc32b /lisp | |
parent | aa70c4d2407c1d0a2934ac378715ff73c426431a (diff) | |
download | emacs.d-9a825577040ff0f5b469eeff36eea3d031639193.tar.gz |
dired-jump-file-at-point: Use region if active
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-files.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/init-files.el b/lisp/init-files.el index 1f8e846..104ca44 100644 --- a/lisp/init-files.el +++ b/lisp/init-files.el @@ -46,7 +46,10 @@ (defun km/dired-jump-file-at-point () "Run `dired-jump' on file at point." (interactive) - (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)) (dired-jump 'other-window (expand-file-name file)) (user-error "No file at point")))) |