From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] fix goto-line Date: Fri, 29 Jul 2011 09:45:13 -0700 Organization: UCLA Computer Science Department Message-ID: <4E32E399.8000402@cs.ucla.edu> References: <874o26muk2.fsf@gnu.org> <8762ml5odm.fsf@mail.jurta.org> <8762mlglnt.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1311957930 32409 80.91.229.12 (29 Jul 2011 16:45:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 29 Jul 2011 16:45:30 +0000 (UTC) Cc: Juanma Barranquero , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 29 18:45:26 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QmqBd-0003gA-Bh for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2011 18:45:21 +0200 Original-Received: from localhost ([::1]:57726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmqBd-0002Ln-0Q for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2011 12:45:21 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmqBb-0002LU-A1 for emacs-devel@gnu.org; Fri, 29 Jul 2011 12:45:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QmqBZ-0007Bb-32 for emacs-devel@gnu.org; Fri, 29 Jul 2011 12:45:19 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:35259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmqBY-0007B1-M8 for emacs-devel@gnu.org; Fri, 29 Jul 2011 12:45:16 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 899E039E8105; Fri, 29 Jul 2011 09:45:14 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HhimhjnrnsGt; Fri, 29 Jul 2011 09:45:14 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 071F239E80CF; Fri, 29 Jul 2011 09:45:14 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 In-Reply-To: <8762mlglnt.fsf@mail.jurta.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142494 Archived-At: On 07/29/11 08:28, Juri Linkov wrote: > I'd like to fix this regression with the following patch. Thanks, could you please open up a bug report for this on debbugs.gnu.org? That'd be a better place to discuss this anyway. > + (if (eq op-symbol 'touch) > + (format-time-string "%Y%m%d%H%M.%S" (current-time)))) I don't know what the overall problem is here, but I can see two issues with this proposed patch. First, presumably it invokes (current-time) at one point, and then, later, uses that saved current-time to do the 'touch'. But that's not quite right; it's the equivalent of the shell command touch --date="$(date)" file whereas surely what is wanted is the equivalent of touch file The latter command avoids some race conditions, because it uses the time at the point of the 'touch', not at the point of the invocation of 'date' (or of 'current-time'). The second issue is minor, and perhaps fixing the first issue will make it irrelevant, but here it is anyway: the "(current-time)" can be omitted in the above code, as it's the default for that argument of format-time-string.