Function: org-attach-delete-one
org-attach-delete-one is an interactive and byte-compiled function
defined in org-attach.el.gz.
Signature
(org-attach-delete-one &optional ATTACHMENT)
Documentation
Delete a single ATTACHMENT.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-attach.el.gz
(defun org-attach-delete-one (&optional attachment)
"Delete a single ATTACHMENT."
(interactive)
(let* ((attach-dir (org-attach-dir))
(files (org-attach-file-list attach-dir))
(attachment (or attachment
(completing-read
"Delete attachment: "
(mapcar (lambda (f)
(list (file-name-nondirectory f)))
files)))))
(setq attachment (expand-file-name attachment attach-dir))
(unless (file-exists-p attachment)
(error "No such attachment: %s" attachment))
(delete-file attachment)
(run-hook-with-args 'org-attach-after-change-hook attach-dir)))