diff options
author | Marco Wahl <marcowahlsoft@gmail.com> | 2017-11-15 12:21:18 +0100 |
---|---|---|
committer | Marco Wahl <marcowahlsoft@gmail.com> | 2017-11-15 12:21:18 +0100 |
commit | a49ac98f3f697d4dda416d08a71bd38273193fbf (patch) | |
tree | eec626e2058f54670c1ca4c1d8aa151b67d7ad16 | |
parent | 615b1470315edb7b3fc40c4f34ebe5a3b31c37b1 (diff) | |
download | org-mode-a49ac98f3f697d4dda416d08a71bd38273193fbf.tar.gz |
org-attach: Refactor. Replace self made with available function.
* lisp/org-attach.el (org-attach-dired-marked-files-or-file-at-cursor-in-dired)
(org-attach-dired-marked-files-in-dired): Removed. Use
`dired-get-marked-files' instead.
-rw-r--r-- | lisp/org-attach.el | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lisp/org-attach.el b/lisp/org-attach.el index 8973dde..8709367 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -599,27 +599,12 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default taken from (setq method (or method org-attach-method)) (mapc (lambda (file) (org-attach-attach file nil method)) files)) -(defun org-attach-dired-marked-files-in-dired () - "Return list of marked files in dired." - (cl-assert (eq 'dired-mode major-mode)) - (delq nil - (mapcar - (lambda (f) (if (file-directory-p f) nil f)) ;; don't attach directories - (nreverse (dired-map-over-marks (dired-get-filename) nil))))) - -(defun org-attach-dired-marked-files-or-file-at-cursor-in-dired () - "Return list of marked files in dired or file at cursor as one -element list. Else return nil." - (cl-assert (eq 'dired-mode major-mode)) - (or (org-attach-dired-marked-files-in-dired) - (list (dired-get-filename 'no-dir t)))) - (defun org-attach-dired-attach-to-next-best-subtree (files) "Attach FILES marked or current file in dired to subtree in other window. Precondition: Point must be in a dired buffer. Idea taken from `gnus-dired-attach'." (interactive - (list (org-attach-dired-marked-files-or-file-at-cursor-in-dired))) + (list (dired-get-marked-files))) (unless (eq major-mode 'dired-mode) (user-error "This command must be triggered in a dired buffer.")) (let ((start-win (selected-window)) |