From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: [PATCH] org-attach.el: Fetch attachments from git annex Date: Tue, 26 Jan 2016 12:34:50 -0500 Message-ID: <87io2gb5xh.fsf@kyleam.com> References: <568b532e.d111620a.b25a8.ffffbb7c@mx.google.com> <87poxg8s22.fsf@kyleam.com> <568c6aaa.c345620a.7f4da.6359@mx.google.com> <56a5b193.ca77420a.1551e.667c@mx.google.com> <87lh7dz79f.fsf@gmx.us> <56a70513.6861420a.33633.5843@mx.google.com> <87egd4u6tq.fsf@kyleam.com> <56a7a139.885d620a.6b777.576d@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO7W8-0003de-KR for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 12:35:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO7W4-0000uq-JZ for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 12:35:00 -0500 Received: from pb-smtp0.int.icgroup.com ([208.72.237.35]:51081 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO7W4-0000ud-DC for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 12:34:56 -0500 In-Reply-To: <56a7a139.885d620a.6b777.576d@mx.google.com> (Erik Hetzner's message of "Tue, 26 Jan 2016 08:39:20 -0800") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Erik Hetzner Cc: emacs-orgmode@gnu.org Erik Hetzner writes: > Kyle Meyer wrote: >> s/if/when/ > > I=E2=80=99m sorry, you said this before, but I=E2=80=99ve always used =3D= if=3D except in the case > where I=E2=80=99d otherwise need =3Dprogn=3D. Is the principle here that = =3Dwhen=3D should be > used when there is no else block? Yes, for an 'if' without an 'else', I'd prefer to use 'when', especially with a 'then' that isn't executed for its return value. But it's not a strong preference. [...] >> > - (mapcar #'list files) nil t)))) >> > - (org-open-file (expand-file-name file attach-dir) in-emacs))) >> > + (mapcar #'list files) nil t))) >> > + (path (expand-file-name file attach-dir))) >> > + (org-attach-annex-get-maybe path) >> > + (org-open-file path in-emacs))) >>=20 >> I think it's a mistake to always run git annex get and to remove the >> message, because this process can hang if all the repos with the file >> are unavailable. >>=20 >> This is also one of the reasons why I think there should be an option to >> turn off automatic fetching. Users should be able to stop org-attach >> from trying to make connections. > > I have to admit I am reluctant to add another option to org-mode. What do= you > think about a y-or-n-p if the file needs fetching that will ask if the us= er > would like to get the file from git annex? I think a y-or-n-p prompt would be fine. It also has the advantage that it would make it clear that any hanging is from the 'git annex get' call. --=20 Kyle