From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Lundin Subject: Re: Problem with archive location Date: Sun, 11 Jan 2009 10:47:06 -0600 Message-ID: References: <4AE25A1C-2836-4F23-8BE2-E43551C38CA8@uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LM3Sx-0005un-Vz for emacs-orgmode@gnu.org; Sun, 11 Jan 2009 11:47:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LM3Sx-0005ua-0t for emacs-orgmode@gnu.org; Sun, 11 Jan 2009 11:47:11 -0500 Received: from [199.232.76.173] (port=57340 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LM3Sw-0005uX-Ry for emacs-orgmode@gnu.org; Sun, 11 Jan 2009 11:47:10 -0500 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:52107) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LM3Sw-0008Ke-G2 for emacs-orgmode@gnu.org; Sun, 11 Jan 2009 11:47:10 -0500 In-Reply-To: (Matthew Lundin's message of "Sun\, 11 Jan 2009 09\:28\:23 -0600") 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: Matthew Lundin Cc: emacs-orgmode@gnu.org Hi Carsten, Matthew Lundin writes: > > I had one more question/request concerning archives. > Would it perhaps be possible to enable the file name substitution > (i.e., "%s") after the double semi-colon, so that the file name can > be used as a headline within the archive file? Sorry to follow up with one more post. Though I confess that I'm on shaky ground here, I seem to have been able to accomplish the desired behavior (i.e., a single yearly archive file with headings showing the original file name) by advising the function org-archive-subtree. ,---- | (setq org-archive-location (concat "~/archive/" (format-time-string "%Y") ".org::")) | | (defadvice org-archive-subtree (around my-org-archive-subtree-around) | (let ((org-archive-location (concat "~/archive/" (format-time-string "%Y") ".org::* "(buffer-name)))) | ad-do-it)) | | (ad-activate 'org-archive-subtree) `---- If anyone sees anything blatantly wrong or hopelessly naive about this setup, feel free to let me know. If it looks O.K., then please feel free to disregard my previous request about changing the behavior of org-archive-location. Best, Matt