From: kgold@watson.ibm.com (kgold)
Subject: Re: inserting date and time at the cursor location
Date: 2 Oct 2002 15:45:17 GMT [thread overview]
Message-ID: <anf4ad$jr4$1@news.btv.ibm.com> (raw)
In-Reply-To: 3d9aee7f$0$15412$3b214f66@aconews.univie.ac.at
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" <kguy@gmx.at> 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
next prev parent reply other threads:[~2002-10-02 15:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-02 13:03 inserting date and time at the cursor location Guy-Armand Kamendje
2002-10-02 15:30 ` Jesper Harder
2002-10-02 15:37 ` David Kastrup
2002-10-03 2:52 ` Clemens Fischer
2002-10-03 4:13 ` ftrw
2002-10-03 10:44 ` Reiner Steib
2002-10-11 12:14 ` Mario Lang
2002-10-13 14:25 ` A. Tsakiris
2002-10-02 15:45 ` kgold [this message]
2002-10-04 4:46 ` ken
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='anf4ad$jr4$1@news.btv.ibm.com' \
--to=kgold@watson.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).