diff options
author | Tim Visher <tim.visher@gmail.com> | 2020-03-03 09:14:44 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2020-03-05 23:24:14 -0500 |
commit | 70c1eec55962f0311af3ba3b483985496c4cdcf4 (patch) | |
tree | e8f617c033ca4d3160bf15e6eb8954d7c4527edb | |
parent | 7454d201895f1b52e04c7a406fde211f4b00e878 (diff) | |
download | org-mode-70c1eec55962f0311af3ba3b483985496c4cdcf4.tar.gz |
org-attach.el: Use `force' arg everywhere in `org-attach-delete-all'
* lisp/org-attach.el (org-attach-delete-all): Use `force' arg
throughout function.
`org-attach-delete-all` advertised a `force` option but passing it
only forced its way past the initial "Really remove all…" query. This
was unexpected and not properly documented.
This extends the use of the `force` argument to the `delete-directory`
call and documents its meaning in the docstring.
TINYCHANGE
-rw-r--r-- | lisp/org-attach.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/org-attach.el b/lisp/org-attach.el index f26aee7..6d5e5ba 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -568,13 +568,18 @@ The attachment is created as an Emacs buffer." (defun org-attach-delete-all (&optional force) "Delete all attachments from the current outline node. This actually deletes the entire attachment directory. -A safer way is to open the directory in dired and delete from there." +A safer way is to open the directory in dired and delete from there. + +With prefix argument FORCE, directory will be recursively deleted +with no prompts." (interactive "P") (let ((attach-dir (org-attach-dir))) (when (and attach-dir (or force (yes-or-no-p "Really remove all attachments of this entry? "))) - (delete-directory attach-dir (yes-or-no-p "Recursive?") t) + (delete-directory attach-dir + (or force (yes-or-no-p "Recursive?")) + t) (message "Attachment directory removed") (run-hook-with-args 'org-attach-after-change-hook attach-dir) (org-attach-untag)))) |