emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Per-file attachment directories
@ 2011-09-21  9:49 Viktor Rosenfeld
  2011-09-21 16:34 ` Darlan Cavalcante Moreira
  0 siblings, 1 reply; 7+ messages in thread
From: Viktor Rosenfeld @ 2011-09-21  9:49 UTC (permalink / raw)
  To: emacs-orgmode

Hi everybody,

so far I've only used one org file, but it's getting unwieldy and I've
decided to split it up.

I'd also like to split up my attachment directory to reduce clutter.
For example, if I have two org files "personal.org" and "work.org" I
would like attachments to go into automatically created directories
below "~/org/data/personal" and "~/org/data/work". If a file has no
custom attachment directory specified, attachments should be created
below a default path (same as now).

Is this possible?

Thanks,
Viktor

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Per-file attachment directories
  2011-09-21  9:49 Per-file attachment directories Viktor Rosenfeld
@ 2011-09-21 16:34 ` Darlan Cavalcante Moreira
  2011-09-21 18:29   ` Viktor Rosenfeld
  0 siblings, 1 reply; 7+ messages in thread
From: Darlan Cavalcante Moreira @ 2011-09-21 16:34 UTC (permalink / raw)
  To: emacs-orgmode


One way to do this is to use file variables to change the value of
org-attach-directory. This works particularly well when you use just a few
org files as in your case.

For instance, you could put
--8<---------------cut here---------------start------------->8---
# Local Variables:
# org-attach-directory: "~/org/data/personal"
# End:
--8<---------------cut here---------------end--------------->8---
in your personal.org file and 
--8<---------------cut here---------------start------------->8---
# Local Variables:
# org-attach-directory: "~/org/data/work"
# End:
--8<---------------cut here---------------end--------------->8---
in your work.org file.

--
Darlan Cavalcante Moreira

At Wed, 21 Sep 2011 11:49:39 +0200,
Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> 
> Hi everybody,
> 
> so far I've only used one org file, but it's getting unwieldy and I've
> decided to split it up.
> 
> I'd also like to split up my attachment directory to reduce clutter.
> For example, if I have two org files "personal.org" and "work.org" I
> would like attachments to go into automatically created directories
> below "~/org/data/personal" and "~/org/data/work". If a file has no
> custom attachment directory specified, attachments should be created
> below a default path (same as now).
> 
> Is this possible?
> 
> Thanks,
> Viktor
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Per-file attachment directories
  2011-09-21 16:34 ` Darlan Cavalcante Moreira
@ 2011-09-21 18:29   ` Viktor Rosenfeld
  2011-09-22  1:34     ` Darlan Cavalcante Moreira
  0 siblings, 1 reply; 7+ messages in thread
From: Viktor Rosenfeld @ 2011-09-21 18:29 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2226 bytes --]

Hi,

this works for simple files but breaks silently for my org files. I've
narrowed it down to two seemingly unrelated parts and attached two
examples below.

- good1.org contains an entry with two tables. When I visit the file,
  Emacs asks me to evaluate the local variable. In bad1.org the first
  table contains another section with the entry "Rechnungsbeitrag". When
  I visit the file, Emacs does not ask me and I can verify that the
  local variable is not evaluated by attaching something to the task.

- In bad2.org the offending part is a long LOGBOOK drawer. Removing any
  two lines from the drawer makes the example work. In good2.org I've
  removed the first two lines.

If it weren't for those bugs, this would fit my needs exactly!

Cheers,
Viktor

Darlan Cavalcante Moreira wrote:

> 
> One way to do this is to use file variables to change the value of
> org-attach-directory. This works particularly well when you use just a few
> org files as in your case.
> 
> For instance, you could put
> --8<---------------cut here---------------start------------->8---
> # Local Variables:
> # org-attach-directory: "~/org/data/personal"
> # End:
> --8<---------------cut here---------------end--------------->8---
> in your personal.org file and 
> --8<---------------cut here---------------start------------->8---
> # Local Variables:
> # org-attach-directory: "~/org/data/work"
> # End:
> --8<---------------cut here---------------end--------------->8---
> in your work.org file.
> 
> --
> Darlan Cavalcante Moreira
> 
> At Wed, 21 Sep 2011 11:49:39 +0200,
> Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> > 
> > Hi everybody,
> > 
> > so far I've only used one org file, but it's getting unwieldy and I've
> > decided to split it up.
> > 
> > I'd also like to split up my attachment directory to reduce clutter.
> > For example, if I have two org files "personal.org" and "work.org" I
> > would like attachments to go into automatically created directories
> > below "~/org/data/personal" and "~/org/data/work". If a file has no
> > custom attachment directory specified, attachments should be created
> > below a default path (same as now).
> > 
> > Is this possible?
> > 
> > Thanks,
> > Viktor
> > 
> 

[-- Attachment #2: good1.org --]
[-- Type: text/plain, Size: 2945 bytes --]

#+CATEGORY: Wohnung

# Local Variables:
# org-attach-directory: "~/org/data/wohnung"
# End:

* Test
** NOTE Aufschlüsselung der Betriebskosten

#+tblname: betrieb1
|                            |     2005 |     2006 |     2007 |     2008 |     2009 |
|----------------------------+----------+----------+----------+----------+----------|
| Entwässerung               |          |          |          |  3725.60 |  3917.68 |
| Straßenreinigung           |  1163.99 |  1168.92 |  1191.84 |  1173.96 |  2626.57 |
| Müllabfuhr                 | 10433.02 | 11006.65 | 11166.92 | 11292.93 | 11668.12 |
| Hausreinigung              |  1508.41 |  1439.24 |  1364.38 |  3459.56 |  5506.62 |
| Gartenpflege               |  2529.66 |  1922.76 |   381.78 |  1469.48 |   684.05 |
| Strom, Beleuchtung         |  2389.15 |  2704.41 |  2684.32 |  4745.88 |  2405.10 |
| Schornsteinreinigung       |   306.10 |   316.80 |   324.98 |   333.90 |   318.58 |
| Sach- und Haftpflichtvers. |  5906.19 |  6333.32 |  7279.77 |  8684.83 | 10145.18 |
| Sonstige Betriebskosten    |          |          |          |   199.16 |   199.16 |
| Hauswarte                  | 15068.36 | 15390.08 | 15527.03 | 10579.37 |  6334.16 |
| Grundsteuer                | 10413.80 | 10413.80 | 12780.57 | 12780.57 | 29831.12 |
| Kabelnetz                  |  6600.75 |  6596.31 |  6722.16 |  6767.48 |  6809.50 |
|----------------------------+----------+----------+----------+----------+----------|

#+tblname: betrieb2
| Jahr |      EW |     StR |       MA |      HR |      GP |      SB |   SchR |      SHV |    SBK |       HW |       GS |      KN |    Summe | Rechnung |   Anteil |
|------+---------+---------+----------+---------+---------+---------+--------+----------+--------+----------+----------+---------+----------+----------+----------|
| 2005 |         | 1163.99 | 10433.02 | 1508.41 | 2529.66 | 2389.15 | 306.10 |  5906.19 |        | 15068.36 | 10413.80 | 6600.75 | 56319.43 |    75.63 | 0.001343 |
| 2006 |         | 1168.92 | 11006.65 | 1439.24 | 1922.76 | 2704.41 | 316.80 |  6333.32 |        | 15390.08 | 10413.80 | 6596.31 | 57292.29 |   307.36 | 0.005365 |
| 2007 |         | 1191.84 | 11166.92 | 1364.38 |  381.78 | 2684.32 | 324.98 |  7279.77 |        | 15527.03 | 12780.57 | 6722.16 | 59423.75 |   318.22 | 0.005355 |
| 2008 | 3725.60 | 1173.96 | 11292.93 | 3459.56 | 1469.48 | 4745.88 | 333.90 |  8684.83 | 199.16 | 10579.37 | 12780.57 | 6767.48 | 65212.72 |   346.87 | 0.005319 |
| 2009 | 3917.68 | 2626.57 | 11668.12 | 5506.62 |  684.05 | 2405.10 | 318.58 | 10145.18 | 199.16 |  6334.16 | 29831.12 | 6809.50 | 80445.84 |   421.98 | 0.005246 |
#+TBLFM: $14=vsum($2..$13)::$16=$15/$14;%.6f

- EW: Entwässerung
- StR: Straßenreinigung
- MA: Müllabfuhr
- HR: Hausreinigung
- GP: Gartenpflege
- SB: Strom, Beleuchtung
- SchR: Schornsteinreinigung
- SHV: Sach- und Haftpflichtversicherung
- SBK: Sonstige Betriebskosten
- HW: Hauswarte
- GS: Grundsteuer
- KN: Kabelnetz


[-- Attachment #3: bad1.org --]
[-- Type: text/plain, Size: 3031 bytes --]

#+CATEGORY: Wohnung

# Local Variables:
# org-attach-directory: "~/org/data/wohnung"
# End:

* Test
** NOTE Aufschlüsselung der Betriebskosten

#+tblname: betrieb1
|                            |     2005 |     2006 |     2007 |     2008 |     2009 |
|----------------------------+----------+----------+----------+----------+----------|
| Entwässerung               |          |          |          |  3725.60 |  3917.68 |
| Straßenreinigung           |  1163.99 |  1168.92 |  1191.84 |  1173.96 |  2626.57 |
| Müllabfuhr                 | 10433.02 | 11006.65 | 11166.92 | 11292.93 | 11668.12 |
| Hausreinigung              |  1508.41 |  1439.24 |  1364.38 |  3459.56 |  5506.62 |
| Gartenpflege               |  2529.66 |  1922.76 |   381.78 |  1469.48 |   684.05 |
| Strom, Beleuchtung         |  2389.15 |  2704.41 |  2684.32 |  4745.88 |  2405.10 |
| Schornsteinreinigung       |   306.10 |   316.80 |   324.98 |   333.90 |   318.58 |
| Sach- und Haftpflichtvers. |  5906.19 |  6333.32 |  7279.77 |  8684.83 | 10145.18 |
| Sonstige Betriebskosten    |          |          |          |   199.16 |   199.16 |
| Hauswarte                  | 15068.36 | 15390.08 | 15527.03 | 10579.37 |  6334.16 |
| Grundsteuer                | 10413.80 | 10413.80 | 12780.57 | 12780.57 | 29831.12 |
| Kabelnetz                  |  6600.75 |  6596.31 |  6722.16 |  6767.48 |  6809.50 |
|----------------------------+----------+----------+----------+----------+----------|
| Rechungsbetrag             |    75.63 |   307.36 |   318.22 |   346.87 |   421.98 |

#+tblname: betrieb2
| Jahr |      EW |     StR |       MA |      HR |      GP |      SB |   SchR |      SHV |    SBK |       HW |       GS |      KN |    Summe | Rechnung |   Anteil |
|------+---------+---------+----------+---------+---------+---------+--------+----------+--------+----------+----------+---------+----------+----------+----------|
| 2005 |         | 1163.99 | 10433.02 | 1508.41 | 2529.66 | 2389.15 | 306.10 |  5906.19 |        | 15068.36 | 10413.80 | 6600.75 | 56319.43 |    75.63 | 0.001343 |
| 2006 |         | 1168.92 | 11006.65 | 1439.24 | 1922.76 | 2704.41 | 316.80 |  6333.32 |        | 15390.08 | 10413.80 | 6596.31 | 57292.29 |   307.36 | 0.005365 |
| 2007 |         | 1191.84 | 11166.92 | 1364.38 |  381.78 | 2684.32 | 324.98 |  7279.77 |        | 15527.03 | 12780.57 | 6722.16 | 59423.75 |   318.22 | 0.005355 |
| 2008 | 3725.60 | 1173.96 | 11292.93 | 3459.56 | 1469.48 | 4745.88 | 333.90 |  8684.83 | 199.16 | 10579.37 | 12780.57 | 6767.48 | 65212.72 |   346.87 | 0.005319 |
| 2009 | 3917.68 | 2626.57 | 11668.12 | 5506.62 |  684.05 | 2405.10 | 318.58 | 10145.18 | 199.16 |  6334.16 | 29831.12 | 6809.50 | 80445.84 |   421.98 | 0.005246 |
#+TBLFM: $14=vsum($2..$13)::$16=$15/$14;%.6f

- EW: Entwässerung
- StR: Straßenreinigung
- MA: Müllabfuhr
- HR: Hausreinigung
- GP: Gartenpflege
- SB: Strom, Beleuchtung
- SchR: Schornsteinreinigung
- SHV: Sach- und Haftpflichtversicherung
- SBK: Sonstige Betriebskosten
- HW: Hauswarte
- GS: Grundsteuer
- KN: Kabelnetz


[-- Attachment #4: good2.org --]
[-- Type: text/plain, Size: 3011 bytes --]

#+CATEGORY: Wohnung

# Local Variables:
# org-attach-directory: "~/org/data/wohnung"
# End:

* Pflanzenpflege
** ROUTINE Pflanzen gießen
SCHEDULED: <2011-09-24 Sat 07:00 .+4d/7d>
:LOGBOOK:
- State "DONE"       from "ROUTINE"    [2011-09-12 Mon 13:35]
CLOCK: [2011-09-12 Mon 13:33]--[2011-09-12 Mon 13:35] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-09-08 Thu 16:30]
CLOCK: [2011-09-08 Thu 16:28]--[2011-09-08 Thu 16:30] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-09-04 Sun 13:25]
CLOCK: [2011-09-04 Sun 13:21]--[2011-09-04 Sun 13:25] =>  0:04
- State "DONE"       from "ROUTINE"    [2011-08-27 Sat 11:31]
- State "DONE"       from "ROUTINE"    [2011-08-23 Tue 10:29]
- State "DONE"       from "ROUTINE"    [2011-08-19 Fri 09:26]
- State "DONE"       from "ROUTINE"    [2011-08-15 Mon 00:31]
CLOCK: [2011-08-15 Mon 00:30]--[2011-08-15 Mon 00:31] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-08-11 Thu 15:09]
CLOCK: [2011-08-11 Thu 15:02]--[2011-08-11 Thu 15:05] =>  0:03
- State "DONE"       from "ROUTINE"    [2011-08-07 Sun 22:15]
CLOCK: [2011-08-07 Sun 22:14]--[2011-08-07 Sun 22:15] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-08-01 Mon 09:26]
- State "DONE"       from "ROUTINE"    [2011-07-28 Thu 10:07]
CLOCK: [2011-07-28 Thu 10:05]--[2011-07-28 Thu 10:07] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-07-24 Sun 22:10]
CLOCK: [2011-07-24 Sun 22:05]--[2011-07-24 Sun 22:07] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-07-20 Wed 08:01]
CLOCK: [2011-07-20 Wed 07:57]--[2011-07-20 Wed 07:59] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-07-16 Sat 12:15]
CLOCK: [2011-07-16 Sat 12:15]--[2011-07-16 Sat 12:15] =>  0:00
- State "DONE"       from "ROUTINE"    [2011-07-05 Tue 19:46]
CLOCK: [2011-07-05 Tue 19:44]--[2011-07-05 Tue 19:46] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-06-29 Wed 00:02]
CLOCK: [2011-06-29 Wed 00:01]--[2011-06-29 Wed 00:02] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-06-25 Sat 05:22]
CLOCK: [2011-06-25 Sat 05:21]--[2011-06-25 Sat 05:22] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-06-21 Tue 08:10]
- State "DONE"       from "ROUTINE"    [2011-06-17 Fri 19:03]
CLOCK: [2011-06-17 Fri 19:03]--[2011-06-17 Fri 19:03] =>  0:00
- State "DONE"       from "ROUTINE"    [2011-06-13 Mon 18:08]
CLOCK: [2011-06-13 Mon 18:07]--[2011-06-13 Mon 18:08] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-06-09 Thu 19:00]
CLOCK: [2011-06-09 Thu 18:59]--[2011-06-09 Thu 19:00] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-06-05 Sun 17:17]
CLOCK: [2011-06-05 Sun 17:16]--[2011-06-05 Sun 17:17] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-05-28 Sat 15:31]
CLOCK: [2011-05-28 Sat 15:30]--[2011-05-28 Sat 15:31] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-05-19 Thu 10:40]
- State "DONE"       from "ROUTINE"    [2011-05-15 Sun 11:27]
- State "DONE"       from "ROUTINE"    [2011-05-11 Wed 09:44]
:END:
:PROPERTIES:
:STYLE: habit
:LAST_REPEAT: [2011-09-20 Tue 13:49]
:END:

[-- Attachment #5: bad2.org --]
[-- Type: text/plain, Size: 3136 bytes --]

#+CATEGORY: Wohnung

# Local Variables:
# org-attach-directory: "~/org/data/wohnung"
# End:

* Pflanzenpflege
** ROUTINE Pflanzen gießen
SCHEDULED: <2011-09-24 Sat 07:00 .+4d/7d>
:LOGBOOK:
- State "DONE"       from "ROUTINE"    [2011-09-20 Tue 13:49]
CLOCK: [2011-09-20 Tue 13:46]--[2011-09-20 Tue 13:49] =>  0:03
- State "DONE"       from "ROUTINE"    [2011-09-12 Mon 13:35]
CLOCK: [2011-09-12 Mon 13:33]--[2011-09-12 Mon 13:35] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-09-08 Thu 16:30]
CLOCK: [2011-09-08 Thu 16:28]--[2011-09-08 Thu 16:30] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-09-04 Sun 13:25]
CLOCK: [2011-09-04 Sun 13:21]--[2011-09-04 Sun 13:25] =>  0:04
- State "DONE"       from "ROUTINE"    [2011-08-27 Sat 11:31]
- State "DONE"       from "ROUTINE"    [2011-08-23 Tue 10:29]
- State "DONE"       from "ROUTINE"    [2011-08-19 Fri 09:26]
- State "DONE"       from "ROUTINE"    [2011-08-15 Mon 00:31]
CLOCK: [2011-08-15 Mon 00:30]--[2011-08-15 Mon 00:31] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-08-11 Thu 15:09]
CLOCK: [2011-08-11 Thu 15:02]--[2011-08-11 Thu 15:05] =>  0:03
- State "DONE"       from "ROUTINE"    [2011-08-07 Sun 22:15]
CLOCK: [2011-08-07 Sun 22:14]--[2011-08-07 Sun 22:15] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-08-01 Mon 09:26]
- State "DONE"       from "ROUTINE"    [2011-07-28 Thu 10:07]
CLOCK: [2011-07-28 Thu 10:05]--[2011-07-28 Thu 10:07] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-07-24 Sun 22:10]
CLOCK: [2011-07-24 Sun 22:05]--[2011-07-24 Sun 22:07] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-07-20 Wed 08:01]
CLOCK: [2011-07-20 Wed 07:57]--[2011-07-20 Wed 07:59] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-07-16 Sat 12:15]
CLOCK: [2011-07-16 Sat 12:15]--[2011-07-16 Sat 12:15] =>  0:00
- State "DONE"       from "ROUTINE"    [2011-07-05 Tue 19:46]
CLOCK: [2011-07-05 Tue 19:44]--[2011-07-05 Tue 19:46] =>  0:02
- State "DONE"       from "ROUTINE"    [2011-06-29 Wed 00:02]
CLOCK: [2011-06-29 Wed 00:01]--[2011-06-29 Wed 00:02] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-06-25 Sat 05:22]
CLOCK: [2011-06-25 Sat 05:21]--[2011-06-25 Sat 05:22] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-06-21 Tue 08:10]
- State "DONE"       from "ROUTINE"    [2011-06-17 Fri 19:03]
CLOCK: [2011-06-17 Fri 19:03]--[2011-06-17 Fri 19:03] =>  0:00
- State "DONE"       from "ROUTINE"    [2011-06-13 Mon 18:08]
CLOCK: [2011-06-13 Mon 18:07]--[2011-06-13 Mon 18:08] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-06-09 Thu 19:00]
CLOCK: [2011-06-09 Thu 18:59]--[2011-06-09 Thu 19:00] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-06-05 Sun 17:17]
CLOCK: [2011-06-05 Sun 17:16]--[2011-06-05 Sun 17:17] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-05-28 Sat 15:31]
CLOCK: [2011-05-28 Sat 15:30]--[2011-05-28 Sat 15:31] =>  0:01
- State "DONE"       from "ROUTINE"    [2011-05-19 Thu 10:40]
- State "DONE"       from "ROUTINE"    [2011-05-15 Sun 11:27]
- State "DONE"       from "ROUTINE"    [2011-05-11 Wed 09:44]
:END:
:PROPERTIES:
:STYLE: habit
:LAST_REPEAT: [2011-09-20 Tue 13:49]
:END:

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Per-file attachment directories
  2011-09-21 18:29   ` Viktor Rosenfeld
@ 2011-09-22  1:34     ` Darlan Cavalcante Moreira
  2011-09-22  7:08       ` Nick Dokos
  2011-09-22  7:32       ` Viktor Rosenfeld
  0 siblings, 2 replies; 7+ messages in thread
From: Darlan Cavalcante Moreira @ 2011-09-22  1:34 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira, emacs-orgmode


I tested here and it didn't work for the bad files as you said. However,
putting the "Local Variables" at the end of the file worked. In fact, I
have always written local variables like this at the end of the file,
although I don't remember if this was because of a restriction of just
because I'm used to.

A good tip is to put them inside a "* File Local Variables" heading so that
they don't stay inside another heading. You can set the noexport tag to
avoid exporting this heading.

Also, you can use the function add-file-local-variable to add a new local
variable. Notice how this function put the local variables at the end of
the file.

--
Darlan Cavalcante Moreira

At Wed, 21 Sep 2011 20:29:25 +0200,
Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> 
> Hi,
> 
> this works for simple files but breaks silently for my org files. I've
> narrowed it down to two seemingly unrelated parts and attached two
> examples below.
> 
> - good1.org contains an entry with two tables. When I visit the file,
>   Emacs asks me to evaluate the local variable. In bad1.org the first
>   table contains another section with the entry "Rechnungsbeitrag". When
>   I visit the file, Emacs does not ask me and I can verify that the
>   local variable is not evaluated by attaching something to the task.
> 
> - In bad2.org the offending part is a long LOGBOOK drawer. Removing any
>   two lines from the drawer makes the example work. In good2.org I've
>   removed the first two lines.
> 
> If it weren't for those bugs, this would fit my needs exactly!
> 
> Cheers,
> Viktor
> 
> Darlan Cavalcante Moreira wrote:
> 
> > 
> > One way to do this is to use file variables to change the value of
> > org-attach-directory. This works particularly well when you use just a few
> > org files as in your case.
> > 
> > For instance, you could put
> > --8<---------------cut here---------------start------------->8---
> > # Local Variables:
> > # org-attach-directory: "~/org/data/personal"
> > # End:
> > --8<---------------cut here---------------end--------------->8---
> > in your personal.org file and 
> > --8<---------------cut here---------------start------------->8---
> > # Local Variables:
> > # org-attach-directory: "~/org/data/work"
> > # End:
> > --8<---------------cut here---------------end--------------->8---
> > in your work.org file.
> > 
> > --
> > Darlan Cavalcante Moreira
> > 
> > At Wed, 21 Sep 2011 11:49:39 +0200,
> > Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> > > 
> > > Hi everybody,
> > > 
> > > so far I've only used one org file, but it's getting unwieldy and I've
> > > decided to split it up.
> > > 
> > > I'd also like to split up my attachment directory to reduce clutter.
> > > For example, if I have two org files "personal.org" and "work.org" I
> > > would like attachments to go into automatically created directories
> > > below "~/org/data/personal" and "~/org/data/work". If a file has no
> > > custom attachment directory specified, attachments should be created
> > > below a default path (same as now).
> > > 
> > > Is this possible?
> > > 
> > > Thanks,
> > > Viktor
> > > 
> > 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Per-file attachment directories
  2011-09-22  1:34     ` Darlan Cavalcante Moreira
@ 2011-09-22  7:08       ` Nick Dokos
  2011-09-22  9:47         ` Viktor Rosenfeld
  2011-09-22  7:32       ` Viktor Rosenfeld
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2011-09-22  7:08 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira; +Cc: nicholas.dokos, emacs-orgmode

Darlan Cavalcante Moreira <darcamo@gmail.com> wrote:

> 
> I tested here and it didn't work for the bad files as you said. However,
> putting the "Local Variables" at the end of the file worked. In fact, I
> have always written local variables like this at the end of the file,
> although I don't remember if this was because of a restriction of just
> because I'm used to.
> 

There is a restriction (see section 53.3.4.1,  "Specifying File Variables",
in the emacs manual):

,----
|    Instead of using a `-*-' line, you can define file local variables
| using a "local variables list" near the end of the file.  The start of
| the local variables list should be no more than 3000 characters from
| the end of the file, and must be on the last page if the file is
| divided into pages.
`----

Nick


> A good tip is to put them inside a "* File Local Variables" heading so that
> they don't stay inside another heading. You can set the noexport tag to
> avoid exporting this heading.
> 
> Also, you can use the function add-file-local-variable to add a new local
> variable. Notice how this function put the local variables at the end of
> the file.
> 
> --
> Darlan Cavalcante Moreira
> 
> At Wed, 21 Sep 2011 20:29:25 +0200,
> Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> > 
> > Hi,
> > 
> > this works for simple files but breaks silently for my org files. I've
> > narrowed it down to two seemingly unrelated parts and attached two
> > examples below.
> > 
> > - good1.org contains an entry with two tables. When I visit the file,
> >   Emacs asks me to evaluate the local variable. In bad1.org the first
> >   table contains another section with the entry "Rechnungsbeitrag". When
> >   I visit the file, Emacs does not ask me and I can verify that the
> >   local variable is not evaluated by attaching something to the task.
> > 
> > - In bad2.org the offending part is a long LOGBOOK drawer. Removing any
> >   two lines from the drawer makes the example work. In good2.org I've
> >   removed the first two lines.
> > 
> > If it weren't for those bugs, this would fit my needs exactly!
> > 
> > Cheers,
> > Viktor
> > 
> > Darlan Cavalcante Moreira wrote:
> > 
> > > 
> > > One way to do this is to use file variables to change the value of
> > > org-attach-directory. This works particularly well when you use just a few
> > > org files as in your case.
> > > 
> > > For instance, you could put
> > > --8<---------------cut here---------------start------------->8---
> > > # Local Variables:
> > > # org-attach-directory: "~/org/data/personal"
> > > # End:
> > > --8<---------------cut here---------------end--------------->8---
> > > in your personal.org file and 
> > > --8<---------------cut here---------------start------------->8---
> > > # Local Variables:
> > > # org-attach-directory: "~/org/data/work"
> > > # End:
> > > --8<---------------cut here---------------end--------------->8---
> > > in your work.org file.
> > > 
> > > --
> > > Darlan Cavalcante Moreira
> > > 
> > > At Wed, 21 Sep 2011 11:49:39 +0200,
> > > Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> > > > 
> > > > Hi everybody,
> > > > 
> > > > so far I've only used one org file, but it's getting unwieldy and I've
> > > > decided to split it up.
> > > > 
> > > > I'd also like to split up my attachment directory to reduce clutter.
> > > > For example, if I have two org files "personal.org" and "work.org" I
> > > > would like attachments to go into automatically created directories
> > > > below "~/org/data/personal" and "~/org/data/work". If a file has no
> > > > custom attachment directory specified, attachments should be created
> > > > below a default path (same as now).
> > > > 
> > > > Is this possible?
> > > > 
> > > > Thanks,
> > > > Viktor
> > > > 
> > > 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Per-file attachment directories
  2011-09-22  1:34     ` Darlan Cavalcante Moreira
  2011-09-22  7:08       ` Nick Dokos
@ 2011-09-22  7:32       ` Viktor Rosenfeld
  1 sibling, 0 replies; 7+ messages in thread
From: Viktor Rosenfeld @ 2011-09-22  7:32 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira; +Cc: emacs-orgmode

Hi,

putting the definition at the end of the file appears to work. At least
for two org files of mine which didn't work before. But it's still a
bug that definitions at the beginning are silently ignored for seemingly
unrelated parts, isn't it? I'll post a bug report to the mailing list.

Anyway, thanks for your help!

Cheers,
Viktor

Darlan Cavalcante Moreira wrote:

> 
> I tested here and it didn't work for the bad files as you said. However,
> putting the "Local Variables" at the end of the file worked. In fact, I
> have always written local variables like this at the end of the file,
> although I don't remember if this was because of a restriction of just
> because I'm used to.
> 
> A good tip is to put them inside a "* File Local Variables" heading so that
> they don't stay inside another heading. You can set the noexport tag to
> avoid exporting this heading.
> 
> Also, you can use the function add-file-local-variable to add a new local
> variable. Notice how this function put the local variables at the end of
> the file.
> 
> --
> Darlan Cavalcante Moreira
> 
> At Wed, 21 Sep 2011 20:29:25 +0200,
> Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> > 
> > Hi,
> > 
> > this works for simple files but breaks silently for my org files. I've
> > narrowed it down to two seemingly unrelated parts and attached two
> > examples below.
> > 
> > - good1.org contains an entry with two tables. When I visit the file,
> >   Emacs asks me to evaluate the local variable. In bad1.org the first
> >   table contains another section with the entry "Rechnungsbeitrag". When
> >   I visit the file, Emacs does not ask me and I can verify that the
> >   local variable is not evaluated by attaching something to the task.
> > 
> > - In bad2.org the offending part is a long LOGBOOK drawer. Removing any
> >   two lines from the drawer makes the example work. In good2.org I've
> >   removed the first two lines.
> > 
> > If it weren't for those bugs, this would fit my needs exactly!
> > 
> > Cheers,
> > Viktor
> > 
> > Darlan Cavalcante Moreira wrote:
> > 
> > > 
> > > One way to do this is to use file variables to change the value of
> > > org-attach-directory. This works particularly well when you use just a few
> > > org files as in your case.
> > > 
> > > For instance, you could put
> > > --8<---------------cut here---------------start------------->8---
> > > # Local Variables:
> > > # org-attach-directory: "~/org/data/personal"
> > > # End:
> > > --8<---------------cut here---------------end--------------->8---
> > > in your personal.org file and 
> > > --8<---------------cut here---------------start------------->8---
> > > # Local Variables:
> > > # org-attach-directory: "~/org/data/work"
> > > # End:
> > > --8<---------------cut here---------------end--------------->8---
> > > in your work.org file.
> > > 
> > > --
> > > Darlan Cavalcante Moreira
> > > 
> > > At Wed, 21 Sep 2011 11:49:39 +0200,
> > > Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> > > > 
> > > > Hi everybody,
> > > > 
> > > > so far I've only used one org file, but it's getting unwieldy and I've
> > > > decided to split it up.
> > > > 
> > > > I'd also like to split up my attachment directory to reduce clutter.
> > > > For example, if I have two org files "personal.org" and "work.org" I
> > > > would like attachments to go into automatically created directories
> > > > below "~/org/data/personal" and "~/org/data/work". If a file has no
> > > > custom attachment directory specified, attachments should be created
> > > > below a default path (same as now).
> > > > 
> > > > Is this possible?
> > > > 
> > > > Thanks,
> > > > Viktor
> > > > 
> > > 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Per-file attachment directories
  2011-09-22  7:08       ` Nick Dokos
@ 2011-09-22  9:47         ` Viktor Rosenfeld
  0 siblings, 0 replies; 7+ messages in thread
From: Viktor Rosenfeld @ 2011-09-22  9:47 UTC (permalink / raw)
  To: emacs-orgmode

Hi Nick,

thanks for the info. That explains the weird behavior I noticed. I
didn't know that local variables were a general Emacs feature.

Cheers,
Viktor

Nick Dokos wrote:

> Darlan Cavalcante Moreira <darcamo@gmail.com> wrote:
> 
> > 
> > I tested here and it didn't work for the bad files as you said. However,
> > putting the "Local Variables" at the end of the file worked. In fact, I
> > have always written local variables like this at the end of the file,
> > although I don't remember if this was because of a restriction of just
> > because I'm used to.
> > 
> 
> There is a restriction (see section 53.3.4.1,  "Specifying File Variables",
> in the emacs manual):
> 
> ,----
> |    Instead of using a `-*-' line, you can define file local variables
> | using a "local variables list" near the end of the file.  The start of
> | the local variables list should be no more than 3000 characters from
> | the end of the file, and must be on the last page if the file is
> | divided into pages.
> `----
> 
> Nick
> 
> 
> > A good tip is to put them inside a "* File Local Variables" heading so that
> > they don't stay inside another heading. You can set the noexport tag to
> > avoid exporting this heading.
> > 
> > Also, you can use the function add-file-local-variable to add a new local
> > variable. Notice how this function put the local variables at the end of
> > the file.
> > 
> > --
> > Darlan Cavalcante Moreira
> > 
> > At Wed, 21 Sep 2011 20:29:25 +0200,
> > Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> > > 
> > > Hi,
> > > 
> > > this works for simple files but breaks silently for my org files. I've
> > > narrowed it down to two seemingly unrelated parts and attached two
> > > examples below.
> > > 
> > > - good1.org contains an entry with two tables. When I visit the file,
> > >   Emacs asks me to evaluate the local variable. In bad1.org the first
> > >   table contains another section with the entry "Rechnungsbeitrag". When
> > >   I visit the file, Emacs does not ask me and I can verify that the
> > >   local variable is not evaluated by attaching something to the task.
> > > 
> > > - In bad2.org the offending part is a long LOGBOOK drawer. Removing any
> > >   two lines from the drawer makes the example work. In good2.org I've
> > >   removed the first two lines.
> > > 
> > > If it weren't for those bugs, this would fit my needs exactly!
> > > 
> > > Cheers,
> > > Viktor
> > > 
> > > Darlan Cavalcante Moreira wrote:
> > > 
> > > > 
> > > > One way to do this is to use file variables to change the value of
> > > > org-attach-directory. This works particularly well when you use just a few
> > > > org files as in your case.
> > > > 
> > > > For instance, you could put
> > > > --8<---------------cut here---------------start------------->8---
> > > > # Local Variables:
> > > > # org-attach-directory: "~/org/data/personal"
> > > > # End:
> > > > --8<---------------cut here---------------end--------------->8---
> > > > in your personal.org file and 
> > > > --8<---------------cut here---------------start------------->8---
> > > > # Local Variables:
> > > > # org-attach-directory: "~/org/data/work"
> > > > # End:
> > > > --8<---------------cut here---------------end--------------->8---
> > > > in your work.org file.
> > > > 
> > > > --
> > > > Darlan Cavalcante Moreira
> > > > 
> > > > At Wed, 21 Sep 2011 11:49:39 +0200,
> > > > Viktor Rosenfeld <listuser36@googlemail.com> wrote:
> > > > > 
> > > > > Hi everybody,
> > > > > 
> > > > > so far I've only used one org file, but it's getting unwieldy and I've
> > > > > decided to split it up.
> > > > > 
> > > > > I'd also like to split up my attachment directory to reduce clutter.
> > > > > For example, if I have two org files "personal.org" and "work.org" I
> > > > > would like attachments to go into automatically created directories
> > > > > below "~/org/data/personal" and "~/org/data/work". If a file has no
> > > > > custom attachment directory specified, attachments should be created
> > > > > below a default path (same as now).
> > > > > 
> > > > > Is this possible?
> > > > > 
> > > > > Thanks,
> > > > > Viktor
> > > > > 
> > > > 
> > 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-09-22  9:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-21  9:49 Per-file attachment directories Viktor Rosenfeld
2011-09-21 16:34 ` Darlan Cavalcante Moreira
2011-09-21 18:29   ` Viktor Rosenfeld
2011-09-22  1:34     ` Darlan Cavalcante Moreira
2011-09-22  7:08       ` Nick Dokos
2011-09-22  9:47         ` Viktor Rosenfeld
2011-09-22  7:32       ` Viktor Rosenfeld

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