diff options
author | John Foerch <jjfoerch@earthlink.net> | 2016-02-10 17:37:03 -0500 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2016-02-14 17:56:18 +0100 |
commit | ff98903015d80541ddc19598a0b73a0baa849894 (patch) | |
tree | 206092797daeee5fe2b70e07966445e483816d89 | |
parent | bb3dca06a5308cba894a647d814952fb336c0902 (diff) | |
download | org-mode-ff98903015d80541ddc19598a0b73a0baa849894.tar.gz |
org-attach: Make use of git optional
* lisp/org-attach.el (org-attach-commit): New variable.
(org-attach-attach): Use new variable.
TINYCHANGE
-rw-r--r-- | etc/ORG-NEWS | 3 | ||||
-rw-r--r-- | lisp/org-attach.el | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index fba5f6e..6322ad2 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -209,6 +209,9 @@ an :indent parameter, much like the one in the clock table. On the other hand, stars no longer appear in an ITEM field. *** Preview LaTeX snippets in buffers not visiting files +*** New option ~org-attach-commit~ +When non-nil, commit attachments with git, assuming the document is in +a git repository. ** New functions *** ~org-next-line-empty-p~ It replaces the deprecated ~next~ argument to ~org-previous-line-empty-p~. diff --git a/lisp/org-attach.el b/lisp/org-attach.el index 15d4841..ebea435 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -55,6 +55,14 @@ where the Org file lives." :group 'org-attach :type 'directory) +(defcustom org-attach-commit t + "If non-nil commit attachments with git. +This is only done if the Org file is in a git repository." + :group 'org-attach + :type 'boolean + :version "25.1" + :package-version '(Org . "9.0")) + (defcustom org-attach-git-annex-cutoff (* 32 1024) "If non-nil, files larger than this will be annexed instead of stored." :group 'org-attach @@ -373,7 +381,8 @@ METHOD may be `cp', `mv', `ln', or `lns' default taken from ((eq method 'cp) (copy-file file fname)) ((eq method 'ln) (add-name-to-file file fname)) ((eq method 'lns) (make-symbolic-link file fname))) - (org-attach-commit) + (when org-attach-commit + (org-attach-commit)) (org-attach-tag) (cond ((eq org-attach-store-link-p 'attached) (org-attach-store-link fname)) |