help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

writing ledger mode, date picker


From: jenia.ivlev
Subject: writing ledger mode, date picker
Date: Sat, 07 Nov 2015 15:30:48 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

I want to insert a date in the current buffer.

I know the function `calendar-cursor-to-date` that when invoked
gives back the date at which the cursor is.

But how do I get that info back to my program?


Here is what I go so far:

(defun insert-new-entry ()
   (interactive)
   (save-excursion
      (goto-char (point-max))
      ;;next comes mostly pseudocode except *calendar-cursor-to-date*

      (calendar)
      (let ((x (bind-key (kdb "enter) 'calendar-mode calendar-cursor-to-date)))
              (insert x))))


So in english it's:

1. go to the last location in the buffer
2. open calendar
3. store in x whatever is returned where enter is pressed
4. insert it into buffer.


The problem is step 3. How do I store into x whatever is returned from
`calendar-cursor-to-date`?

Thanks




reply via email to

[Prev in Thread] Current Thread [Next in Thread]