emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Gyro Funch" <gyromagnetic@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re[2]: set source directory for org-attach
Date: Mon, 30 Nov 2020 14:14:09 +0000	[thread overview]
Message-ID: <em7a4d8a17-6d4c-4f95-bbd3-db801c73650f@fribl-m4800> (raw)
In-Reply-To: <87lfejzlk8.fsf@localhost>

Thank you, Ihor.

That is very helpful.

Kind regards,
gyro


------ Original Message ------
From: "Ihor Radchenko" <yantar92@gmail.com>
To: "gyro funch" <gyromagnetic@gmail.com>; emacs-orgmode@gnu.org
Sent: 11/29/2020 6:21:27 PM
Subject: Re: set source directory for org-attach

>gyro funch <gyromagnetic@gmail.com> writes:
>>  I am probably missing something obvious, but is there a way to set the
>>  default source directory for attachments?
>
>Not by default. I am using the following advice (requires helm and f.el):
>
>(defvar yant/org-attach-default-source "~/Downloads/"
>   "Default directory to attach the files from.")
>
>(define-advice org-attach-attach (:around (oldfun files &rest args) start-from-default-directory)
>   "Look for new attachments from `yant/org-attach-default-source' directory instead of `default-directory'."
>   (interactive
>    (list
>     (mapcar #'directory-file-name (helm-read-file-name "File to keep as an attachment:"
>						       :initial-input (or (progn
>									    (require 'dired-aux)
>									    (dired-dwim-target-directory))
>									  (and yant/org-attach-default-source
>									       (f-slash yant/org-attach-default-source))
>									  default-directory)
>						       :marked-candidates t))
>     current-prefix-arg
>     nil))
>   (unless (listp files) (setq files (list files)))
>   (mapc (lambda (file) (apply oldfun file args)) files))
>
>Best,
>Ihor



      reply	other threads:[~2020-11-30 14:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-28 17:04 set source directory for org-attach gyro funch
2020-11-30  0:40 ` David Rogers
2020-11-30  1:21 ` Ihor Radchenko
2020-11-30 14:14   ` Gyro Funch [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=em7a4d8a17-6d4c-4f95-bbd3-db801c73650f@fribl-m4800 \
    --to=gyromagnetic@gmail.com \
    --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).