I want to write a mode for ledger. The first thing I want to do is to be able to insert date stamps. There is a very nice mode in Emacs called calendar
. I want to be able to select a date within it.
How do I register a call-back or something that will be executed when the user has select a date (by pressing enter or any other way that calendar mode already uses).
org-read-date
-- user selects date on calendar and the date is automatically inserted and the calendar buffer closes.calendar
and some other function that will allow me to simply read the user's selection.(require 'org) (org-read-date)
in your*Scratch*
buffer and it works no matter what major-mode that buffer is in. It is only necessary torequire
a library one time per session, and can be placed at the top of the library you are building.