unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Adding timestamp entry to diary with insert-day command?
@ 2024-10-07 12:48 Marc Coquand
  2024-10-08 22:37 ` Michael Heerdegen
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Coquand @ 2024-10-07 12:48 UTC (permalink / raw)
  To: help-gnu-emacs

Heya,

I have began using diary, and quite like the simple format.

I'd like to change the default insert-day entry format, and add a
timestamp as well since all my entries are time-stamped.

Is there a way to do so?

Bonus question: Is it also possible to use org-capture to insert diary
entries with a timestamp included?

Sincerely,
Marc



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

* Re: Adding timestamp entry to diary with insert-day command?
  2024-10-07 12:48 Adding timestamp entry to diary with insert-day command? Marc Coquand
@ 2024-10-08 22:37 ` Michael Heerdegen
  2024-10-09 18:20   ` Marc Coquand
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Heerdegen @ 2024-10-08 22:37 UTC (permalink / raw)
  To: Marc Coquand; +Cc: help-gnu-emacs

Marc Coquand <marc@mccd.space> writes:

> I have began using diary, and quite like the simple format.
>
> I'd like to change the default insert-day entry format, and add a
> timestamp as well since all my entries are time-stamped.

How would that look like in your diary file in the end?

> Is there a way to do so?

I think you would define your own function, a variant of
`diary-insert-entry', and use that instead of `diary-insert-entry'.  I
guess you would make the first argument of `diary-make-entry' to include
your time stamp.

> Bonus question: Is it also possible to use org-capture to insert diary
> entries with a timestamp included?

Into the _diary_?  org-capture relies on org-mode (it uses a narrowed
version of the org buffer of the target org file for input).  Getting
that work would be that kind of hack where it is very likely that you'll
regret it later.  Unless I misunderstood what you have in mind,
honestly, I would not try to marry those concepts.


Michael.



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

* Re: Adding timestamp entry to diary with insert-day command?
  2024-10-08 22:37 ` Michael Heerdegen
@ 2024-10-09 18:20   ` Marc Coquand
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Coquand @ 2024-10-09 18:20 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

Hey!

I was hoping that I could do it by modifying the diary-insert-entry
command. I didn't know how to do that, but I managed to build a capture
template that works.

Capture templates can store in plain text format, and you can also add a
template that prints the date in a specific date format, so I could
simply set the capture-template to the following:

org-capture-templates
	'(("l" "Log" plain (file "~/diary-file")
	   "%<%d %b %Y %H:%M> %?"
	   :prepend t))

The capture template sets up the following the following format:

08 Oct 2024 13:46 YOUR TEXT HERE

Which is what I wanted. :)

- Marc







Michael Heerdegen <michael_heerdegen@web.de> writes:

> Marc Coquand <marc@mccd.space> writes:
>
>> I have began using diary, and quite like the simple format.
>>
>> I'd like to change the default insert-day entry format, and add a
>> timestamp as well since all my entries are time-stamped.
>
> How would that look like in your diary file in the end?
>
>> Is there a way to do so?
>
> I think you would define your own function, a variant of
> `diary-insert-entry', and use that instead of `diary-insert-entry'.  I
> guess you would make the first argument of `diary-make-entry' to include
> your time stamp.
>
>> Bonus question: Is it also possible to use org-capture to insert diary
>> entries with a timestamp included?
>
> Into the _diary_?  org-capture relies on org-mode (it uses a narrowed
> version of the org buffer of the target org file for input).  Getting
> that work would be that kind of hack where it is very likely that you'll
> regret it later.  Unless I misunderstood what you have in mind,
> honestly, I would not try to marry those concepts.
>
>
> Michael.




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

end of thread, other threads:[~2024-10-09 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 12:48 Adding timestamp entry to diary with insert-day command? Marc Coquand
2024-10-08 22:37 ` Michael Heerdegen
2024-10-09 18:20   ` Marc Coquand

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