emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-attach-commit not respected everywhere [9.0.8 (9.0.8-elpa @ /home/mir/.emacs.d/elpa/org-20170606/)]
@ 2017-06-17  9:00 Allen Li
  2017-06-17  9:34 ` [PATCH] Respect org-attach-commit everywhere Allen Li
  0 siblings, 1 reply; 3+ messages in thread
From: Allen Li @ 2017-06-17  9:00 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]


There are multiple places in org-attach.el where org-attach-commit isn't
respected.  This means that while adding a new attachment will respect
the user setting and not make Git commits, various other commands will.

Emacs  : GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.10)
 of 2017-04-22
Package: Org mode version 9.0.8 (9.0.8-elpa @ /home/mir/.emacs.d/elpa/org-20170606/)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Respect org-attach-commit everywhere
  2017-06-17  9:00 Bug: org-attach-commit not respected everywhere [9.0.8 (9.0.8-elpa @ /home/mir/.emacs.d/elpa/org-20170606/)] Allen Li
@ 2017-06-17  9:34 ` Allen Li
  2017-06-17 14:24   ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Allen Li @ 2017-06-17  9:34 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]


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
---
 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
--- 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)
-    (org-attach-commit)))
+    (when org-attach-commit
+      (org-attach-commit))))
 
 (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 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)))
-- 
2.13.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Respect org-attach-commit everywhere
  2017-06-17  9:34 ` [PATCH] Respect org-attach-commit everywhere Allen Li
@ 2017-06-17 14:24   ` Nicolas Goaziou
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2017-06-17 14:24 UTC (permalink / raw)
  To: Allen Li; +Cc: emacs-orgmode

Hello,

Allen Li <darkfeline@felesatra.moe> writes:

> 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

Applied. Thank you.

If you plan to provide more patches, please consider signing FSF papers!


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-17 14:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-17  9:00 Bug: org-attach-commit not respected everywhere [9.0.8 (9.0.8-elpa @ /home/mir/.emacs.d/elpa/org-20170606/)] Allen Li
2017-06-17  9:34 ` [PATCH] Respect org-attach-commit everywhere Allen Li
2017-06-17 14:24   ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).