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

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

Re: writing ledger mode, date picker


From: Emanuel Berg
Subject: Re: writing ledger mode, date picker
Date: Mon, 09 Nov 2015 04:45:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Yuri Khan <yuri.v.khan@gmail.com> writes:

> You want to ask a user to select a date on the
> calendar and then insert that date into a buffer.

Aha, that is what the OP wants to do!

Then what I provided should be modified somewhat - see
the code below.

The problem is, `calendar-cursor-to-date' only gives
me dates in February 1970... So what is that, Diane
Keaton and Mariel Hemingway?

Maybe the OP has better luck (?) with that!

(require 'calendar)

(defun calendar-cursor-date-into-asti ()
  (interactive)
  (let*((date (calendar-cursor-to-date))
        (date-string (format-time-string "%Y-%m-%d\n" date))
        (buffer (get-buffer-create "asti")) )
    (with-current-buffer
        buffer (insert date-string) )))

(define-key calendar-mode-map "\r" 'calendar-cursor-date-into-asti)

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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