From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Visher Newsgroups: gmane.emacs.help Subject: Re: Insert date and Time Date: Thu, 25 Feb 2010 09:41:48 -0500 Message-ID: References: <27714370.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1267109165 20851 80.91.229.12 (25 Feb 2010 14:46:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Feb 2010 14:46:05 +0000 (UTC) Cc: Help-gnu-emacs@gnu.org To: Tugello Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 25 15:46:01 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NkeyW-0003yY-Tc for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Feb 2010 15:46:01 +0100 Original-Received: from localhost ([127.0.0.1]:35137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkeyW-0000AP-D2 for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Feb 2010 09:46:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nkeuv-0006ZN-Gj for help-gnu-emacs@gnu.org; Thu, 25 Feb 2010 09:42:17 -0500 Original-Received: from [140.186.70.92] (port=48229 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nkeur-0006YX-8T for Help-gnu-emacs@gnu.org; Thu, 25 Feb 2010 09:42:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nkeun-0005Ct-C9 for Help-gnu-emacs@gnu.org; Thu, 25 Feb 2010 09:42:13 -0500 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:60786) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nkeun-0005Cd-9W for Help-gnu-emacs@gnu.org; Thu, 25 Feb 2010 09:42:09 -0500 Original-Received: by gyd10 with SMTP id 10so1932109gyd.0 for ; Thu, 25 Feb 2010 06:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=0An/hAedyoB327X8mKTa9XNrDlxMgvUm3QSAJhERqSQ=; b=dWuTpnlNzXgMkM/msHwq/OvnbQNrt/8V+bbpUDnyHZ01LS70TKJjll8SYOF6c4NlWk V201gccrdbmkzjih1Tvhoon6FXauJYOF/jVldA2gTaNpqkpl0qzBpT9TYpVFdbaQPvxc SttC2XNMh/hvcrtb9bDACykFzHux5kPfpNOmQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=YWMsjqv1xGyDI0qUHSEXQLzrm19U/vqoiWxh/a65seQ5Ad2YyMc5OUFYfHMAX02HW+ FC4dYou+KmLF8t3D121Rt8HB5Zr699q+EpR1IABaVVYXm20nr9y5SSDnAFxx4i7IrkfB zVygcFrBDf+mahHZVtfWCQzEheHcsrK6Xlad4= Original-Received: by 10.101.134.39 with SMTP id l39mr1187746ann.130.1267108928227; Thu, 25 Feb 2010 06:42:08 -0800 (PST) In-Reply-To: <27714370.post@talk.nabble.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72129 Archived-At: On Thu, Feb 25, 2010 at 3:29 AM, Tugello wrote: > good morning to all,I'm newbie with emacs > my question is about how to insert current date and time, using a short key > combination instead to write they completely . > someone ave any suggestion ? > thanks in advance I use this function to insert a time stamp at point: (defun insert-time-stamp () "Inserts a time stamp 'YYYY-MM-DD HH:MM AM/PM'" (interactive) (insert (format-time-string "%Y-%m-%d - %I:%M %p"))) I just call that via `M-x insert-time-stamp` unless a higher level function calls it. You could call it with a short cut though with something like (global-set-key (kbd "") 'insert-time-stamp) if you wanted. You'll need to evaluate those in your scratch buffer to get them in the current emacs session. Paste them in and then `M-x eval-buffer`. If you want them in all emacs sessions, put them in your .emacs file. `C-h r m Init File RET`. Also, [Yegge's .emacs file](http://steve.yegge.googlepages.com/my-dot-emacs-file) is worth a read. Hope that helps. -- In Christ, Timmy V. http://burningones.com/ http://five.sentenc.es/ - Spend less time on e-mail