From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#39057: 27.0.60; copy-file interactive VS from lisp disagreement Date: Fri, 10 Jan 2020 12:55:59 +0100 (CET) Message-ID: References: <87eew8z6js.fsf@calancha-pc.dy.bbexcite.jp> <837e1zagqh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="210394"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Alpine 2.21 (LSU 202 2017-01-01) Cc: Tino Calancha , 39057@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 10 12:59:39 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ipsul-000b6k-VB for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jan 2020 12:57:20 +0100 Original-Received: from localhost ([::1]:44510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipsuj-0006j0-W6 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Jan 2020 06:57:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48553) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipsuX-0006ia-PA for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 06:57:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipsuV-0005MK-9J for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 06:57:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47759) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipsuT-0005Ka-NI for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 06:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ipsuT-000223-Mp for bug-gnu-emacs@gnu.org; Fri, 10 Jan 2020 06:57:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Jan 2020 11:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39057 X-GNU-PR-Package: emacs Original-Received: via spool by 39057-submit@debbugs.gnu.org id=B39057.15786573757751 (code B ref 39057); Fri, 10 Jan 2020 11:57:01 +0000 Original-Received: (at 39057) by debbugs.gnu.org; 10 Jan 2020 11:56:15 +0000 Original-Received: from localhost ([127.0.0.1]:53732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipsti-00020w-MT for submit@debbugs.gnu.org; Fri, 10 Jan 2020 06:56:14 -0500 Original-Received: from mail-wr1-f48.google.com ([209.85.221.48]:39367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipstg-00020j-Gd for 39057@debbugs.gnu.org; Fri, 10 Jan 2020 06:56:12 -0500 Original-Received: by mail-wr1-f48.google.com with SMTP id y11so1537228wrt.6 for <39057@debbugs.gnu.org>; Fri, 10 Jan 2020 03:56:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=JoezD2FJLSrsj4yqzisPAdlJpxpTfiJhITDFM0M6CKM=; b=U+d5EDA7BvJ9a8N3LX1pi+6BFObo43/O+Nxin299OF4wZzQohh9rIevfBzhNl6mbqO bPQ2r+I0vix4cOCtAqCHFUlYN3TTbNN4nS3uvfVeren4xRgUe+z+jhCR0+6N84zWqoy2 RADTpvFB3vC+EKJ7Gd+AmS6niY5axnwqVZFkde0R6R+LE5beu5cuOqfOqGWCfaQ7ZBl+ rbDQHjf9wqP6CXArdzrdqHyx0qBVRdAn9ePlBcoBgZUQyku2OnNYPgEHDZd9KB2Pc7dO vCB6TBXxRqg8y376ErB06hfsx14Sfcz/kr4xkqS4BChabWVNTqYmdz2DLscora9+hZiF XDcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=JoezD2FJLSrsj4yqzisPAdlJpxpTfiJhITDFM0M6CKM=; b=GsKLGKszkUOHhplcvA/cI4GBkfxzOo7hvQPS6LjhnI9q2hlVwgeh1r1ebJLYAHRd5N 0Jj5NdrQgCk7EllCWgJLID9tROaYzkYxKJoI6OLqZSuMiETshbXDGNZF/sz3xckcP77h FfGfch80nRlPvcWmdx1TTt23Gw5MWrR6NQ936J/R1RmCKFj44DfDxif4O8alBsaP/s1v cb57v4uBc/DVx0Cl9Z/xvIuNeJTI5lrKF2fUutHcpuVCiCQ3HBq8uRhRDM5WKYOxwQfW avU44aTJJXwJcnIGik7twO7hCXl4/T74BYoGOBLgFG8QIZTtxHZsbTXsnnOERQhAEW3P MQCA== X-Gm-Message-State: APjAAAXQ4BTioZv2LpsnJThnSKC+KQKrkxGZRd67KTG9b2znJclJpwgO Kv9lEpASRHZovfU9pEEXAh4= X-Google-Smtp-Source: APXvYqwE2jnvjF7PPNLThOGLFmPmVTCONj/pdzZszCaEx12kkSoKorsNiHWz2zBQ926n/mmqVO70ZQ== X-Received: by 2002:a5d:4d0e:: with SMTP id z14mr3086697wrt.208.1578657366292; Fri, 10 Jan 2020 03:56:06 -0800 (PST) Original-Received: from dhcp154.suse.cz (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id g9sm1962402wro.67.2020.01.10.03.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 03:56:05 -0800 (PST) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@dhcp154.suse.cz In-Reply-To: <837e1zagqh.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:174435 Archived-At: > I cannot reproduce this, so there must be more here than meets the > eye > So please step through the code and tell where it fails and why. It seems NEWNAME, i.e., the second argument seeing by `copy-file' might be different when called interactively; this is true even if the user introduces the same value. I have printed out newname before the line newname = expand_cp_target (file, newname); at src/fileio.c I) M-: (copy-file "/tmp/foo" "~/") RET ;; it shows "~/" as expected II) M-x: copy-file RET /tmp/foo RET ~/ RET ;; it shows "~" (the '/' is missing) Apparentely, this was unnoticed because before Emacs 26 we were using predicate `file-directory-p` M-: (file-directory-p "~") RET => t After commit 'Fix race with rename-file etc. with dir NEWNAME' (01c885f21f343045783eb9ad1ff5f9b83d6cd789) we use `directory-name-p`, and the issue is revealed. (directory-name-p "~") => nil Since you cannot reproduce the issue, it might be platform dependent. I am able to reproduce it in this nice site, which runs Emacs 26.3 in a linux machine: https://repl.it/languages/elisp M-! touch /tmp/foo RET M-x copy-file RET /tmp/foo RET RET ;; received prompt ;; FILE /home/runner already exists; copy to it anyway? (yes or no) ;; Eval following forms from the *ielm* buffer (file-exists-p "~/foo") RET => nil (copy-file "/tmp/foo" "~/") => nil (file-exists-p "~/foo") RET => t