emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Setting org-archive-location
@ 2008-12-06 20:05 David Neu
  2008-12-06 20:28 ` Bernt Hansen
  0 siblings, 1 reply; 5+ messages in thread
From: David Neu @ 2008-12-06 20:05 UTC (permalink / raw)
  To: emacs-orgmode

Hi,	

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?

Many thanks!

Cheers,
David

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting org-archive-location
  2008-12-06 20:05 Setting org-archive-location David Neu
@ 2008-12-06 20:28 ` Bernt Hansen
  2008-12-06 20:34   ` David Neu
  0 siblings, 1 reply; 5+ messages in thread
From: Bernt Hansen @ 2008-12-06 20:28 UTC (permalink / raw)
  To: David Neu; +Cc: emacs-orgmode

"David Neu" <david@davidneu.com> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting org-archive-location
  2008-12-06 20:28 ` Bernt Hansen
@ 2008-12-06 20:34   ` David Neu
  2008-12-07  4:02     ` Bernt Hansen
  2008-12-07 14:28     ` Matthew Lundin
  0 siblings, 2 replies; 5+ messages in thread
From: David Neu @ 2008-12-06 20:34 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

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 <bernt@norang.ca> wrote:
> "David Neu" <david@davidneu.com> 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
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting org-archive-location
  2008-12-06 20:34   ` David Neu
@ 2008-12-07  4:02     ` Bernt Hansen
  2008-12-07 14:28     ` Matthew Lundin
  1 sibling, 0 replies; 5+ messages in thread
From: Bernt Hansen @ 2008-12-07  4:02 UTC (permalink / raw)
  To: David Neu; +Cc: emacs-orgmode

"David Neu" <david@davidneu.com> writes:

> Thanks for that suggestion!

You're welcome :)

>
> 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
>

No I don't.  I don't currently archive by date - I just pile everything
into a single archive by project.

-Bernt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: Setting org-archive-location
  2008-12-06 20:34   ` David Neu
  2008-12-07  4:02     ` Bernt Hansen
@ 2008-12-07 14:28     ` Matthew Lundin
  1 sibling, 0 replies; 5+ messages in thread
From: Matthew Lundin @ 2008-12-07 14:28 UTC (permalink / raw)
  To: David Neu; +Cc: Bernt Hansen, emacs-orgmode


Hi David,

"David Neu" <david@davidneu.com> writes:

> 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
>

One alternative to setting a lot of ARCHIVE properties in your file
would be to rely on sparse tree filtering and property searches in the
archive file to see items that used belonging to particular headlines
in the original file. If you set org-archive-save-context-info to
include olpath, the outline headings will be saved as a property of
the archived subheadling, enabling you to filter by original location
in the tree. 

>>> * Work
>>> ** Finsh DBMS
>>> *** TODO Define schema
>>> *** TODO Write code
>>> ** Implement API
>>> *** TODO Develop prototype
>>>
>>> * Home
>>> ** Clean garage
>>> *** TODO Buy shelves
>>> *** TODO Install shelves

For example if you archived "Clean Garage," it would appear in your
archive file as:

* Clean Garage
  :PROPERTIES:
  :ARCHIVE_OLPATH: Home
  [...]
  :END:

Thus, in your example, you could filter by "Work" or by "Home" in the
archive file. You can also optionally save information about CATEGORY,
tags, file, etc. This would enable you to retain your dynamic archive
file names using setq-org-archive-location, while still having the
power to filter by type of work. Here's what I use:

(setq org-archive-location (concat "~/archive/" (format-time-string \
"%Y") ".org::* " (format-time-string "%B")))

Which currently produces:

~/archive/2008.org::* December

Using sparse trees, I can get a quick chronological overview of the
entire year, filtered for particular types of work.

This may not be what you are looking for, but I thought I'd share this
possibility in case it helps.

Just one more example of the astounding power and functionality of
org!

Best,
Matt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-07 14:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-06 20:05 Setting org-archive-location David Neu
2008-12-06 20:28 ` Bernt Hansen
2008-12-06 20:34   ` David Neu
2008-12-07  4:02     ` Bernt Hansen
2008-12-07 14:28     ` Matthew Lundin

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).