From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: Inserting a timestamp in a file Date: Fri, 30 Jan 2009 23:15:10 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1233380472 17196 80.91.229.12 (31 Jan 2009 05:41:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 Jan 2009 05:41:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 31 06:42:25 2009 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.50) id 1LT8cZ-0004er-Do for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Jan 2009 06:42:23 +0100 Original-Received: from localhost ([127.0.0.1]:44766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LT8bH-0000Nh-1U for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Jan 2009 00:41:03 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!news.glorb.com!news2.glorb.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.sysmatrix.net!news.sysmatrix.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Fri, 30 Jan 2009 23:15:06 -0600 User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 24 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 12.73.132.132 Original-X-Trace: sv3-4LLpo6mHHfTj11H7BQjKjlOBYwEEXnbMyUNzcIF4Y4jC3TyiOsTR1WgqZ3MVqJZipNMy+gdSMzPMgIj!wgzbIanCHYCR/JOWxNXPGcNbzdstRpMoKXpj5W2Mg55FgF6LHpUkw9WMZE82bh88WPzrXMpr8/t1!bAVLdQuP+lGN3gIQFZePOIYJ9NzCZ9M= Original-X-Complaints-To: abuse@sysmatrix.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Original-Xref: news.stanford.edu gnu.emacs.help:166468 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:61789 Archived-At: Fred Picher wrote: > Hello, > > Is there a way to insert a timestamp at a precise place in a file, eg. is there a function that does this ? > > Thanks. > This has to go in one of the first eight lines of the file ;; Time-stamp: "" then this (or equivalent code) in your .emacs: (add-hook 'write-file-hooks 'time-stamp) I suppose you could copy it programatically anywhere else in the file if you needed to, say at a bookmark. That would have to be done again everytime you saved. What's the usefulness of putting the time stamp at an arbitrary place? A save saves the whole file. Ed