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

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

Re: inserting date and time at the cursor location


From: kgold
Subject: Re: inserting date and time at the cursor location
Date: 2 Oct 2002 15:45:17 GMT

I don't know about xemacs, but here's the function I use in emacs:

(defun insert-date ()
  "Insert date at the current cursor position in the current buffer."
  (interactive)
  (insert (format-time-string "%d %B %Y ")))

Bonus 1:

I bind it to a key like this:

(define-key esc-map "D" 'insert-date)

Bonus 2:

If you want a time stamp updated automatically every time you write:

; time stamp (Time-stamp: " " in first eight lines of file)

(add-hook 'write-file-hooks 'time-stamp)
(setq time-stamp-active t)
(setq time-stamp-format "%02d %:b %:y %02H:%02M:%02S")

"Guy-Armand Kamendje" <address@hidden> writes:
> 
> Is there a way to let xemacs insert the current date and time at the actual
> cursor location?

-- 
-- 
Ken Goldman   address@hidden   914-784-7646


reply via email to

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