[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix goto-line

From: Paul Eggert
Subject: Re: [PATCH] fix goto-line
Date: Fri, 29 Jul 2011 09:45:13 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110617 Thunderbird/3.1.11

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]