Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea/Adding "past" notes #15

Closed
svnsbck opened this issue Jun 16, 2022 · 9 comments
Closed

Idea/Adding "past" notes #15

svnsbck opened this issue Jun 16, 2022 · 9 comments

Comments

@svnsbck
Copy link

svnsbck commented Jun 16, 2022

Hi Prot,
I was just wondering if it would be useful to have an option to add notes/journal entries from the past, ie creating/renaming files with a past date.

Idea here would be for example if I were to enter for a journal entry from the 1st of January, but do it today, the title would be the "right" day, but the time-stamp/identifier would be today's. Of course this can be changed after the fact, but I wonder wether it would make sense to have such an option during the creation of the note.

@protesilaos
Copy link
Owner

I wonder wether it would make sense to have such an option during the creation of the note

It does make sense and I will make it happen. Just need to think how best to accomplish it. More to follow.

protesilaos added a commit that referenced this issue Jun 16, 2022
Thanks to user svnsbck for suggesting the idea in issue 15 over at the
GitHub repo: <#15>.
@protesilaos
Copy link
Owner

Just added the denote-date command. It wasn't easy as Denote was designed around the assumption that the time is always the current one. I think I tested everything, but please test it as much as you can as well.

Thank you!

The commit:

  commit d5b62c4e58d7898ab77926ea23ea94834c281999
  Author: Protesilaos Stavrou <info@protesilaos.com>
  Date:   Thu Jun 16 12:09:33 2022 +0300
  
      Add denote-date command (notes for past date)
      
      Thanks to user svnsbck for suggesting the idea in issue 15 over at the
      GitHub repo: <https://github.com/protesilaos/denote/issues/15>.
  
   README.org |  30 +++++++++++++----
   denote.el  | 107 +++++++++++++++++++++++++++++++++++++++++++++++++------------
   2 files changed, 110 insertions(+), 27 deletions(-)

@svnsbck
Copy link
Author

svnsbck commented Jun 16, 2022

Nice! I have tested this with "normal" notes and there it does seem to work as expected.

I have then tried to incorporate this into the journal-workflow, but only with limited success. :-)

(defun my-old-journal () "Create a journal entry with a past date" (interactive) (let ((denote-directory "~/Documents/journal/")) (denote (denote--date-prompt) ; ask for date (denote--title-prompt) ;Ask for title "journal")))
I tried placing the date-prompt at different places, without success either.
I had the feeling that it should work, but didn't Needless to say I'm missing something obvious here.

@protesilaos
Copy link
Owner

Nice! I have tested this with "normal" notes and there it does seem to work as expected.

Very well!

I have then tried to incorporate this into the journal-workflow, but only with limited success. :-)

No worries! I was planning to expand the manual.

This one asks for a date and a title:

(defun my-denote-journal-with-date (date title)
  "Ask for DATE and TITLE to write a journal entry.

Read the doc string of `denote-date' on what a valid DATE is."
  (interactive
   (list
    (denote--date-prompt)
    (denote--title-prompt)))
  (when-let ((d (denote--valid-date date))
             (id (format-time-string denote--id-format d))
             ((denote--barf-duplicate-id id)))
    (denote--prepare-note title "journal" nil d id)))

And this one just for a date:

(defun my-denote-journal-with-date (date)
  "Ask for DATE to write a journal entry.

Read the doc string of `denote-date' on what a valid DATE input is.

The title of the note is something like Tuesday 17 June 2020,
though you can modify the `format-time-string' specifiers as
described in its doc string."
  (interactive (list (denote--date-prompt)))
  (when-let ((d (denote--valid-date date))
             (id (format-time-string denote--id-format d))
             ((denote--barf-duplicate-id id)))
    (denote--prepare-note
     (format-time-string "%A %e %B %Y" d)
     "journal" nil d id)))

protesilaos added a commit that referenced this issue Jun 17, 2022
Thanks to svnsbck for the discussion on issue 15 over at the GitHub
mirror: <#15>.
@protesilaos
Copy link
Owner

Also expanded the manual. Please let me know if you need some extra tweak but are not sure how to do it.

I will now close this issue. Thanks again!

@svnsbck
Copy link
Author

svnsbck commented Jun 17, 2022

Oh, that is great. Thanks a lot.

@protesilaos
Copy link
Owner

You are welcome!

By the way, in the manual's Acknowledgements I reference your screen name as that is all I see here. Maybe I can add the full name instead?

@svnsbck
Copy link
Author

svnsbck commented Jun 17, 2022

Absolutely! As you just say it I figured that I have not set this up :-) . My bad, just changed that. But it would Sven Seebeck, just in case things don't update here. Thanks a lot!

protesilaos added a commit that referenced this issue Jun 17, 2022
I prefer to use names instead of handles:
<#15 (comment)>.
@protesilaos
Copy link
Owner

Done! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants