emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-attach-directory
@ 2015-10-10 14:00 John J Foerch
  0 siblings, 0 replies; only message in thread
From: John J Foerch @ 2015-10-10 14:00 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I have a collection of org files in a git repository, and am using
git-annex for attachments.  I had an idea for a feature related to
org-attach-directory that would improve the usability of git-annex in a
case like this.

Since all attachments from all org files in the repo go into the same
data directory, there isn't a simple way to operate on the attachments
related to a single org file in bulk.  For instance, if one wants to
git-annex-get all of the attachments for one org file, but not others,
one must git-annex-get each file individually.

One solution would be for each org file to live in its own subdirectory,
thus each org file would have its own data directory:

    org-file: org/work/work.org
    attachemts-in: org/work/data/

I don't especially like this solution because it adds a lot of
unnecessary structure to the repo.

Another solution would be for each org file to have its own data
directory alongside it:

    org-file: org/work.org
    attachments-in: org/work.org.data/

I don't especially like this one either because it makes a mess of the
repository root.

The solution I like best is to store attachments in data/, but to
introduce a subdirectory per org file:

    org-file: org/work.org
    attachments-in: org/data/work.org/

It keeps the repository root uncluttered, but attachments are grouped by
the file that owns them, so can be operated on in bulk by git-annex or
other tools.

I can set up this configuration with org-mode-hook, but I liked the idea
so well that I wanted to pass it along as something that org-mode might
want to provide itself as an option.  Perhaps org-mode could check for
the existence of data/{filename} and when it exists, set the local value
of org-attach-directory to that instead of to "data/".  If it were
automatic like this, then org files that used this feature would remain
portable.  Perhaps a file-local variable or an org directive would be a
better option.

Any thoughts?

Thank you,

John Foerch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-10 14:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-10 14:00 org-attach-directory John J Foerch

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).