From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viktor Rosenfeld Subject: Re: Per-file attachment directories Date: Thu, 22 Sep 2011 11:47:27 +0200 Message-ID: <20110922094727.GA5529@kenny.fritz.box> References: <20110921094939.GA1018@client199-150.wlan.hu-berlin.de> <4e7a121a.0109640a.5a6b.2e19@mx.google.com> <20110921182925.GA6055@kenny.fritz.box> <4e7a90c4.4216ec0a.3475.fffff114@mx.google.com> <14099.1316675288@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6fsT-0007zY-8Z for emacs-orgmode@gnu.org; Thu, 22 Sep 2011 05:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6fsR-0003eQ-O3 for emacs-orgmode@gnu.org; Thu, 22 Sep 2011 05:47:33 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:63650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6fsR-0003eJ-Ee for emacs-orgmode@gnu.org; Thu, 22 Sep 2011 05:47:31 -0400 Received: by bkbzs2 with SMTP id zs2so2826696bkb.0 for ; Thu, 22 Sep 2011 02:47:30 -0700 (PDT) Content-Disposition: inline In-Reply-To: <14099.1316675288@alphaville.dokosmarshall.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 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 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 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 > > > > > > > > > > > >