From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: directory from which attachments are taken Date: Wed, 06 Sep 2017 10:26:06 +0200 Message-ID: <873780qllt.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpVfc-0006lt-6b for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 04:26:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpVfY-00024z-65 for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 04:26:48 -0400 Received: from [195.159.176.226] (port=42229 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpVfX-00024X-Ut for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 04:26:44 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dpVfF-0005jQ-1N for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 10:26:25 +0200 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 kevinbanjo writes: > I'm downloading files into my "~/Downloads" directory and attaching them to > an org file in "~/Private/org" and every time it tries to look in the > latter for the attachment and I have to navigate back to the former. Is > there a setting where I can direct it where to initially look for the files > to attach or a setting where it will just keep the last place I attached a > file and just use that as the initial value? You could probably do something like this, though I haven’t tested it extensively. (defun rasmus/org-attach (orig-fun &rest args) "Change dir of the shell to buffer's `default-directory'." (let ((default-directory "~/Downloads")) (apply orig-fun args))) (advice-add #'org-attach :around #'rasmus/org-attach) -- Sådan en god dansk lagereddike kan man slet ikke bruge mere