diff options
author | Kyle Meyer <kyle@kyleam.com> | 2014-05-13 20:38:44 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2014-05-13 20:38:44 -0400 |
commit | 762e7868031cf8a90fb81217c4b877b0d178d4d4 (patch) | |
tree | f84eadabda1e75fd38e72eb33da4bcacb6f71a07 /lisp | |
parent | debbf36e46914ee9e2b75e3c648e043f4d5b1a27 (diff) | |
download | emacs.d-762e7868031cf8a90fb81217c4b877b0d178d4d4.tar.gz |
km/org-open-dired-file: Handle marked files
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-dired.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/init-dired.el b/lisp/init-dired.el index 9c52a36..63f5a98 100644 --- a/lisp/init-dired.el +++ b/lisp/init-dired.el @@ -48,12 +48,16 @@ ;; This overrides the binding for `list-directory'. (global-set-key (kbd "C-x C-d") 'km/dired-switch-to-buffer) -(defun km/org-open-dired-file () +(defun km/org-open-dired-marked-files () (interactive) - (org-open-file (dired-get-filename))) + (let* ((files (dired-get-marked-files)) + (num-files (length files))) + (when (or (< num-files 5) + (yes-or-no-p (format "Open %s files?" num-files))) + (-each files 'org-open-file)))) (eval-after-load 'org ;; This overrides `dired-find-file', which is also bound to "f". - '(define-key dired-mode-map "e" 'km/org-open-dired-file)) + '(define-key dired-mode-map "e" 'km/org-open-dired-marked-files)) (provide 'init-dired) |