From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Fix git-annex-get call in org-attach Date: Sun, 25 Mar 2018 22:22:16 -0500 Message-ID: <87605jr05z.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0IiF-00018E-CR for emacs-orgmode@gnu.org; Sun, 25 Mar 2018 23:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0IiC-0001Uy-3p for emacs-orgmode@gnu.org; Sun, 25 Mar 2018 23:22:23 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:52723) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f0IiB-0001U2-Rv for emacs-orgmode@gnu.org; Sun, 25 Mar 2018 23:22:20 -0400 Received: from archair (c-73-246-123-194.hsd1.il.comcast.net [73.246.123.194]) by mail.messagingengine.com (Postfix) with ESMTPA id 9ABA4103D3 for ; Sun, 25 Mar 2018 23:22:17 -0400 (EDT) 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: Org Mode --=-=-= Content-Type: text/plain I've attached a patch that fixes a minor issue in org-attach related to git annex. Basically, it ensures that a shell command is called from within the git-annex repository (i.e., the org-attach-directory). Otherwise, the command results in an error because it is called in the incorrect directory. Best, Matt --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-default-directory-for-git-annex-checks.patch >From 6158eee0a36f41d90e78ae59df3cfac03f291157 Mon Sep 17 00:00:00 2001 From: Matt Lundin Date: Sun, 25 Mar 2018 22:11:09 -0500 Subject: [PATCH] Fix default directory for git-annex checks * lisp/org-attach.el: (org-attach-annex-get-maybe) Ensure shell command that checks whether a git-annex file exists is called from within the git-annex repository. Otherwise, it will result in an error. --- lisp/org-attach.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-attach.el b/lisp/org-attach.el index fdf652822..192815f4f 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -320,7 +320,8 @@ the ATTACH_DIR property) their own attachment directory." (defun org-attach-annex-get-maybe (path) "Call git annex get PATH (via shell) if using git annex. Signals an error if the file content is not available and it was not retrieved." - (let ((path-relative (file-relative-name path))) + (let* ((default-directory (expand-file-name org-attach-directory)) + (path-relative (file-relative-name path))) (when (and (org-attach-use-annex) (not (string-equal -- 2.16.2 --=-=-=--