From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David Neu" Subject: Re: Setting org-archive-location Date: Sat, 6 Dec 2008 15:34:34 -0500 Message-ID: References: <87prk5rqtz.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L93rJ-0003WQ-TN for emacs-orgmode@gnu.org; Sat, 06 Dec 2008 15:34:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L93rI-0003Vd-5J for emacs-orgmode@gnu.org; Sat, 06 Dec 2008 15:34:37 -0500 Received: from [199.232.76.173] (port=51734 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L93rH-0003VN-Re for emacs-orgmode@gnu.org; Sat, 06 Dec 2008 15:34:35 -0500 Received: from wf-out-1314.google.com ([209.85.200.168]:32100) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L93rH-0001hv-Bq for emacs-orgmode@gnu.org; Sat, 06 Dec 2008 15:34:35 -0500 Received: by wf-out-1314.google.com with SMTP id 28so531606wfc.24 for ; Sat, 06 Dec 2008 12:34:34 -0800 (PST) In-Reply-To: <87prk5rqtz.fsf@gollum.intra.norang.ca> Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org Hi Bernt, Thanks for that suggestion! Do you know if there is any way to avoid hardcoding the month and year I used in my example, i.e. :ARCHIVE: %s-2008-12-archive.org::* Work Cheers, David On Sat, Dec 6, 2008 at 3:28 PM, Bernt Hansen wrote: > "David Neu" writes: > >> Is there any way to get the second part of the org-archive-location >> variable, i.e. the part after the colon that corresponds to headline, >> to be the headline under which an subtree lies. For example, consider >> >> * Work >> ** Finsh DBMS >> *** TODO Define schema >> *** TODO Write code >> ** Implement API >> *** TODO Develop prototype >> >> * Home >> ** Clean garage >> *** TODO Buy shelves >> *** TODO Install shelves >> >> For "Finish DBMS", and "Implement API", you might want to have >> >> (setq org-archive-location (format-time-string >> "%%s-%Y-%m-archive.org::* Work" (current-time))) >> >> but for "Clean garage", you would then want >> >> (setq org-archive-location (format-time-string >> "%%s-%Y-%m-archive.org::* Home" (current-time))) >> >> Is there any way to achieve this behavior? > > Set a property under the level 1 headings with the archive location you > want > > ,---- > | * Work > | :PROPERTIES: > | :ARCHIVE: %s_archive::* Work > | :END: > | ** Finish DBMS > | ... > | * Home > | :PROPERTIES: > | :ARCHIVE: %s_archive::* Home > | :END: > | ** Clean garage > | ... > `---- > > -Bernt > >