From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lars Hansen Newsgroups: gmane.emacs.bugs Subject: Re: Bug in copy-file Date: Fri, 31 Jan 2003 08:36:45 +0100 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3E3A278D.905@math.ku.dk> References: <3E39533D.3090509@math.ku.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1043998544 3375 80.91.224.249 (31 Jan 2003 07:35:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 31 Jan 2003 07:35:44 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18eViB-0000sJ-00 for ; Fri, 31 Jan 2003 08:35:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18eVja-0004KF-00 for gnu-bug-gnu-emacs@m.gmane.org; Fri, 31 Jan 2003 02:37:10 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18eVjH-0003pP-00 for bug-gnu-emacs@gnu.org; Fri, 31 Jan 2003 02:36:51 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18eVj3-0003Xr-00 for bug-gnu-emacs@gnu.org; Fri, 31 Jan 2003 02:36:38 -0500 Original-Received: from [62.84.220.10] (helo=mail.dantel.dk) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18eVip-0003DT-00 for bug-gnu-emacs@gnu.org; Fri, 31 Jan 2003 02:36:24 -0500 Original-Received: from math.ku.dk [62.84.221.46] by mail.dantel.dk with ESMTP (SMTPD32-7.13) id A8484F8024E; Fri, 31 Jan 2003 08:39:52 +0100 User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en Original-To: Andreas Schwab In-Reply-To: X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4360 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4360 Andreas Schwab wrote: >Lars Hansen writes: > >|> A bug has been introduced since Emacs 21.2. >|> A "!" has been added where it should not be. >|> As a consequence the keep-time parameter functions >|> opposite of what is intended. The patch below >|> should fix the problem. > >Why do you think so? The use of keep-time is correct according to the >doc string. > >Andreas. > Maybe I am misreading the code or the doc string. I read them like this: Doc string says: Fourth arg KEEP-TIME non-nil means give the new file the same last-modified time as the old one. But when keep_time is non-nil, NILP (keep_time) is false, so !NILP (keep_time) is true. Thus the code following if (NILP (keep_time)) is entered. In this code it reads EMACS_GET_TIME (now); and if (set_file_times (filename, now, now)) so the time is set to now, not kept. Am I wrong? By the way, it is easy to test: Just do eg: (copy-file "junk" "keep" t t) (copy-file "junk" "new" t nil) Lars