emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: directory from which attachments are taken
Date: Wed, 06 Sep 2017 10:26:06 +0200	[thread overview]
Message-ID: <873780qllt.fsf@gmx.us> (raw)
In-Reply-To: CAOHcZqPTK_ARQKrY_K-gdNALLXEfMd+2ocExz1hY+OfZUj7NpQ@mail.gmail.com

kevinbanjo <kevinbanjo@gmail.com> 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

      reply	other threads:[~2017-09-06  8:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 22:54 directory from which attachments are taken kevinbanjo
2017-09-06  8:26 ` Rasmus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873780qllt.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).