nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3.04k stars 134 forks source link

Archiving Timestamp #355

Closed jgollenz closed 1 year ago

jgollenz commented 2 years ago

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

cands commented 2 years ago

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:
...
kristijanhusak commented 2 years ago

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

jgollenz commented 2 years ago

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?

kristijanhusak commented 2 years ago

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.

jgollenz commented 2 years ago

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.

kristijanhusak commented 1 year ago

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