From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uwe Siart Newsgroups: gmane.emacs.help Subject: Re: Insert date and Time Date: Tue, 02 Mar 2010 09:40:07 +0100 Organization: Technische =?iso-8859-1?Q?Universit=E4t_M=FCnchen?= Message-ID: <871vg35d7c.fsf@siart.de> References: <27714370.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1267519511 7676 80.91.229.12 (2 Mar 2010 08:45:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 2 Mar 2010 08:45:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 02 09:45:07 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 1NmNj1-0001YT-2C for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Mar 2010 09:45:07 +0100 Original-Received: from localhost ([127.0.0.1]:51121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmNix-0006XM-4O for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Mar 2010 03:45:03 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!goblin1!goblin.stu.neva.ru!newsfeed.straub-nv.de!weretis.net!feeder2.news.weretis.net!news-peer.in.tum.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 15 Original-NNTP-Posting-Host: pegasus.hft.e-technik.tu-muenchen.de Original-X-Trace: news.in.tum.de 1267519207 17947 129.187.140.137 (2 Mar 2010 08:40:07 GMT) Original-X-Complaints-To: usenet@in.tum.de Original-NNTP-Posting-Date: Tue, 2 Mar 2010 08:40:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (windows-nt) Cancel-Lock: sha1:LQmImEAP8DI1su1WDM0r1S8CIkM= Original-Xref: news.stanford.edu gnu.emacs.help:177253 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:72293 Archived-At: Tim Visher writes: > 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"))) Nice gimmick. To make it perfect I'd like insert-time-stamp to replace region (if there is a region). How to achieve this? (insert "string") does not replace region but inserts at point. -- Uwe