浏览代码

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.
Marco Wahl 7 年之前
父节点
当前提交
a49ac98f3f
共有 1 个文件被更改,包括 1 次插入16 次删除
  1. 1 16
      lisp/org-attach.el

+ 1 - 16
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))