unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* writing ledger mode, date picker
@ 2015-11-07 20:30 jenia.ivlev
  2015-11-07 21:18 ` jenia.ivlev
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: jenia.ivlev @ 2015-11-07 20:30 UTC (permalink / raw)
  To: help-gnu-emacs

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




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

end of thread, other threads:[~2015-11-10  1:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-07 20:30 writing ledger mode, date picker jenia.ivlev
2015-11-07 21:18 ` jenia.ivlev
2015-11-07 23:49   ` Emanuel Berg
2015-11-08 19:25     ` jenia.ivlev
2015-11-08 22:38       ` Emanuel Berg
2015-11-09  2:42       ` Yuri Khan
2015-11-09  3:45         ` Emanuel Berg
2015-11-09  4:35           ` jenia.ivlev
2015-11-08  0:47 ` Drew Adams
2015-11-08 19:37   ` jenia.ivlev
2015-11-09  5:39 ` jenia.ivlev
2015-11-10  1:15   ` Emanuel Berg
2015-11-10  1:22   ` Emanuel Berg

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