emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Problem with archive location


From: Matthew Lundin
Subject: Re: [Orgmode] Problem with archive location
Date: Sun, 11 Jan 2009 10:47:06 -0600
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (darwin)

Hi Carsten,

Matthew Lundin <address@hidden> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]