Hi Tim,

 

First you must make sure to allow property inheritance. That can be done by setting org-attach-use-inheritance to t. Then add the DIR property to a property block for the file, or using a property keyword. I.e. either this:

 

#+begin_src org

  :PROPERTIES:

  :DIR:      ~/.foo/data

  :END:

#+end_src

 

#+begin_src org

  ,#+PROPERTY DIR ~/.foo/data

#+end_src

 

Running org-attach with option s will give you a prompt that will set DIR for you. If you invoke that before first headline it should result in a DIR property that applies for the whole buffer (when org-attach-use-inheritance is set to t that is). Note that property blocks before first headline is a new feature for version 9.4 and currently only exist in the master branch.

 

Regards

Gustav

 

From: Emacs-orgmode <emacs-orgmode-bounces+gustav=whil.se@gnu.org> On Behalf Of Tim Visher
Sent: den 5 mars 2020 16:28
To: Emacs Org Mode mailing list <emacs-orgmode@gnu.org>
Subject: File Scoped Properties?

 

Hello,

 

I'm trying to get org-attach to use a different data directory for a particular file.

 

My understanding is that this is controlled by `org-attach-id-dir` by default but can be overridden at the file or entry level by use of the `DIR` property. I can successfully override it at the entry level by adding `DIR` to the entries properties but I can't figure out how to set it for all entries in the file.

 

I tried:

 

```

#+DIR: ~/.foo/data

```

 

as the first line of the file.

 

I _am_ able to get it to work by adding a file local variable like

 

```
# Local Variables:
# org-attach-id-dir: "~/.foo/data"
# End:
```

 

but then whenever I open the file it tells me it's possibly not safe to set that.

 

Any ideas?

 

--

In Christ,

Timmy V.

https://blog.twonegatives.com
https://five.sentenc.es