From mboxrd@z Thu Jan 1 00:00:00 1970 From: Allen Li Subject: [PATCH] Respect org-attach-commit everywhere Date: Sat, 17 Jun 2017 02:34:02 -0700 Message-ID: <87o9tnlzzp.fsf@felesatra.moe> References: <87zid7m1kb.fsf@felesatra.moe> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMA7Q-0007Uy-DW for emacs-orgmode@gnu.org; Sat, 17 Jun 2017 05:34:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMA7M-0003LS-Fh for emacs-orgmode@gnu.org; Sat, 17 Jun 2017 05:34:12 -0400 Received: from solmarta.felesatra.moe ([198.199.111.162]:49059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMA7M-0003L6-95 for emacs-orgmode@gnu.org; Sat, 17 Jun 2017 05:34:08 -0400 Received: from localhost (c-73-70-42-168.hsd1.ca.comcast.net [73.70.42.168]) by solmarta.felesatra.moe (Postfix) with ESMTPSA id A59D2FFD8F for ; Sat, 17 Jun 2017 05:34:03 -0400 (EDT) In-Reply-To: <87zid7m1kb.fsf@felesatra.moe> (message from Allen Li on Sat, 17 Jun 2017 02:00:04 -0700) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable TINYCHANGE * 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 =2D-- lisp/org-attach.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/org-attach.el b/lisp/org-attach.el index 8093527ae..bfd7106b0 100644 =2D-- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -459,7 +459,8 @@ The attachment is created as an Emacs buffer." (unless (file-exists-p file) (error "No such attachment: %s" file)) (delete-file file) =2D (org-attach-commit))) + (when org-attach-commit + (org-attach-commit)))) =20 (defun org-attach-delete-all (&optional force) "Delete all attachments from the current task. @@ -475,14 +476,16 @@ A safer way is to open the directory in dired and del= ete from there." (y-or-n-p "Are you sure you want to remove all attachments of this entr= y? "))) (shell-command (format "rm -fr %s" attach-dir)) (message "Attachment directory removed") =2D (org-attach-commit) + (when org-attach-commit + (org-attach-commit)) (org-attach-untag)))) =20 (defun org-attach-sync () "Synchronize the current tasks with its attachments. This can be used after files have been added externally." (interactive) =2D (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))) =2D-=20 2.13.1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEAkb34K/14xrPgzDtUictAFsrdacFAllE94oACgkQUictAFsr dafyzggAryeyXA/zwlo29wqrhVstLL+EFkaxSAD5IXgOFSr5eqMIPvn4EN+rkAcZ ja174WKbIfVxpJwNrPh/HMe5etdf0EHTSxyI1xEku+4ZcY9U0I8fGH4y9NkS7sqT yu/GCNwGLJZ8XR8Um9+/DXFwKCEhWqY4XX/a1/d9UUAQ66k0PxnbgJ2uD0WGjRiE UrOC9z8gIZz7hj8GRI22AvSuQQVg4F02vsWOX50c6oeo1WgWgAYaN6L0MMy/DNRu AtFDQ5ueo1AgPe3dCCk/M6R9T56CCbw2J4GKi8afOTEs0cpf5H1aGfz6rTxS8ayQ rjrzd8OAPIBgAZ36pg0W9wMPGqgFgA== =DEVX -----END PGP SIGNATURE----- --=-=-=--