From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kgold@watson.ibm.com (kgold) Newsgroups: gmane.emacs.help Subject: Re: inserting date and time at the cursor location Date: 2 Oct 2002 15:45:17 GMT Organization: IBM T.J. Watson Research Center Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <3d9aee7f$0$15412$3b214f66@aconews.univie.ac.at> NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1033707772 18153 127.0.0.1 (4 Oct 2002 05:02:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 4 Oct 2002 05:02:52 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17xKby-0004iW-00 for ; Fri, 04 Oct 2002 07:02:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17xKcL-00008z-00; Fri, 04 Oct 2002 01:03:13 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!logbridge.uoregon.edu!uunet!sea.uu.net!ash.uu.net!news.chips.ibm.com!newsfeed.btv.ibm.com!news.btv.ibm.com!kgold Original-Newsgroups: comp.emacs.xemacs,gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: alpha.watson.ibm.com Original-X-Trace: news.btv.ibm.com 1033573517 20324 9.2.16.245 (2 Oct 2002 15:45:17 GMT) Original-X-Complaints-To: news@btv.ibm.com Original-NNTP-Posting-Date: 2 Oct 2002 15:45:17 GMT X-Newsreader: xrn 9.01 Originator: kgold@watson.ibm.com Original-Xref: nntp.stanford.edu comp.emacs.xemacs:68180 gnu.emacs.help:105647 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2216 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2216 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" writes: > > Is there a way to let xemacs insert the current date and time at the actual > cursor location? -- -- Ken Goldman kgold@watson.ibm.com 914-784-7646