emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Cletip Cletip <clement020302@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: Org-attach for a directory
Date: Wed, 08 Jun 2022 10:32:29 +0000	[thread overview]
Message-ID: <8735gfla2q.fsf@posteo.net> (raw)
In-Reply-To: <CAPHku6PMXHiW9vPM9TYROKyisj0HDVutnO3FvU2MEBcm+XYJgQ@mail.gmail.com> (Cletip Cletip's message of "Wed, 8 Jun 2022 11:59:35 +0200")


Cletip Cletip writes:

> My question is in the object : can we attach a directory to a heading?
> If yes, how, if not, why. Can we solve the problem?

I have in my init the following modification to the org-attach-attach
function so that I can copy a directory. I have replaced the line

((eq method 'cp) (copy-file file attach-file))

with this:

((eq method 'cp) (if (file-directory-p file) 
		     (copy-directory file attach-file)
		   (copy-file file attach-file)))

You can override the old function with advice-add:

(advice-add 'org-attach-attach :override 'my-new-org-attach-attach)

> Subsidiary question:
> Can we use org-attach as a filesystem? 
> Thanks in advance for your future answers

Can you please elaborate more? In my case, I use org-attach almost as a
replacement for my folder system (ie org nodes have come to replace
directories, and many nodes have a folder attached); I access the nodes
via org-ql/helm-org-ql (https://github.com/alphapapa/org-ql). It's very

Best regards,

Juan Manuel 

  parent reply	other threads:[~2022-06-08 10:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08  9:59 Org-attach for a directory Cletip Cletip
2022-06-08 10:27 ` Fraga, Eric
2022-06-08 19:48   ` Cletip Cletip
2022-06-09  9:37     ` [PATCH] " Ihor Radchenko
2022-07-21 11:24       ` Ihor Radchenko
2022-07-21 13:51         ` Cletip Cletip
2022-06-08 10:32 ` Juan Manuel Macías [this message]
     [not found]   ` <CAPHku6O3RojzhaSu3d2pWfnE8x7N_9WAfjCupHyKcxNyD-i=ew@mail.gmail.com>
2022-06-09 10:11     ` Juan Manuel Macías

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:

  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=8735gfla2q.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=clement020302@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* 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


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