emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Lundin <mdl@imapmail.org>
To: Matthew Lundin <mdl@imapmail.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Problem with archive location
Date: Sun, 11 Jan 2009 10:47:06 -0600	[thread overview]
Message-ID: <m2y6xh3i45.fsf@fastmail.fm> (raw)
In-Reply-To: <m28wph9814.fsf@fastmail.fm> (Matthew Lundin's message of "Sun\, 11 Jan 2009 09\:28\:23 -0600")


Hi Carsten,

Matthew Lundin <mdl@imapmail.org> 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	other threads:[~2009-01-11 16:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-10 17:55 Problem with archive location Matthew Lundin
2009-01-10 20:57 ` Carsten Dominik
2009-01-11 15:08   ` Matthew Lundin
2009-01-11 15:28     ` Matthew Lundin
2009-01-11 16:47       ` Matthew Lundin [this message]
2009-01-13  7:40     ` Carsten Dominik
2009-01-13 11:47       ` Matthew Lundin
2009-01-17  7:58     ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2y6xh3i45.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).