orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

Archiving Timestamp

Open jgollenz opened this issue 3 years ago • 5 comments

Does this feature exist in Emacs orgmode core?

No

Orgmode link

No response

Feature value

Enables users to better comprehend archive files. Sometimes things get archived by accident and a timestamp for the archiving would help find irregularities. It would be an option e.g. org_archiving_timestamp that adds a property ARCHIVED: [timestamp] to every headline upon archiving.

Additional context

No response

jgollenz avatar Jun 26 '22 22:06 jgollenz

I think Emacs Orgmode core does have this kind of feature, if I interpret correctly. Emacs adds a PROPERTIES drawer with some information including a timestamp when archiving a headline. So I guess nvim-orgmode should clone this functionality (maybe you had other things in mind as well)? As an example, below I paste the information Emacs Orgmode includes when archiving a headline I did a while ago (at the top of the file, some personal information removed):

#    -*- mode: org -*-


Archived entries from file /Users/.../test.org


* Name of heading
:PROPERTIES:
:ARCHIVE_TIME: 2022-05-22 Sun 17:56
:ARCHIVE_FILE: ~/.../test.org
:ARCHIVE_CATEGORY: weekly
:ARCHIVE_ITAGS: gtd
:END:
...

cands avatar Jun 28 '22 09:06 cands

When you archive to another file, these gets automatically added.

kristijanhusak avatar Jun 28 '22 09:06 kristijanhusak

these get automatically added

Are they? Because I don't see them in my archive files. Does it depend on a specific org_archive_location or should it be added to any file that is not the org file from which archiving happens?

jgollenz avatar Jun 28 '22 09:06 jgollenz

They should (https://github.com/nvim-orgmode/orgmode/blob/master/lua/orgmode/org/mappings.lua#L54-L59), unless there's a bug I'm not aware of.

kristijanhusak avatar Jun 28 '22 09:06 kristijanhusak

Ok, I do see some in my archive files. But they are very few (7) and I feel like I'm archiving more often. A simple test file from which I archive does not give me those properties either. Apparently they are not the last item in the file, this check makes it exit early.

jgollenz avatar Jun 29 '22 23:06 jgollenz

This issue was happening when headline content ends with 1 or more empty lines. Should be fixed now.

kristijanhusak avatar Nov 26 '22 07:11 kristijanhusak