summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Li <darkfeline@felesatra.moe>2017-06-17 02:34:02 -0700
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-06-17 16:16:27 +0200
commitb9b921716ba1d2a564bb9443427dfb21bb609e05 (patch)
tree4bfd849fbc80795d193620ded27a771aad049c42
parent39351d0d14d3e059d5b997c9a0ff7cfae7ceedb4 (diff)
downloadorg-mode-b9b921716ba1d2a564bb9443427dfb21bb609e05.tar.gz
org-attach: Respect org-attach-commit everywhere
* lisp/org-attach.el (org-attach-delete-one): Respect org-attach-commit (org-attach-delete-all): Respect org-attach-commit (org-attach-sync): Respect org-attach-commit TINYCHANGE
-rw-r--r--lisp/org-attach.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 75157a1..a026eee 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -441,7 +441,8 @@ The attachment is created as an Emacs buffer."
(unless (file-exists-p file)
(error "No such attachment: %s" file))
(delete-file file)
- (org-attach-commit)))
+ (when org-attach-commit
+ (org-attach-commit))))
(defun org-attach-delete-all (&optional force)
"Delete all attachments from the current task.
@@ -457,14 +458,16 @@ A safer way is to open the directory in dired and delete from there."
(y-or-n-p "Are you sure you want to remove all attachments of this entry? ")))
(shell-command (format "rm -fr %s" attach-dir))
(message "Attachment directory removed")
- (org-attach-commit)
+ (when org-attach-commit
+ (org-attach-commit))
(org-attach-untag))))
(defun org-attach-sync ()
"Synchronize the current tasks with its attachments.
This can be used after files have been added externally."
(interactive)
- (org-attach-commit)
+ (when org-attach-commit
+ (org-attach-commit))
(when (and org-attach-file-list-property (not org-attach-inherited))
(org-entry-delete (point) org-attach-file-list-property))
(let ((attach-dir (org-attach-dir)))