From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Tomas Nordin Newsgroups: gmane.emacs.bugs Subject: bug#40140: 26.3; Renaming a directory with an external tool Date: Sat, 21 Mar 2020 15:08:32 +0100 Message-ID: <87y2rtls0v.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> References: <8b3ce871-8b21-41aa-1633-36a032b0028c@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="7506"; mail-complaints-to="usenet@ciao.gmane.io" To: Nicolas Gimenez , 40140@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 21 15:09:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jFeoL-0001p8-Pm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Mar 2020 15:09:13 +0100 Original-Received: from localhost ([::1]:36984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFeoK-0008By-SO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Mar 2020 10:09:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54362) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFeoB-0008Bs-LX for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2020 10:09:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFeoA-0001i8-Ku for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2020 10:09:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41771) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jFeoA-0001hy-7l for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2020 10:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jFeoA-0000A3-2e for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2020 10:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tomas Nordin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Mar 2020 14:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40140 X-GNU-PR-Package: emacs Original-Received: via spool by 40140-submit@debbugs.gnu.org id=B40140.1584799723582 (code B ref 40140); Sat, 21 Mar 2020 14:09:02 +0000 Original-Received: (at 40140) by debbugs.gnu.org; 21 Mar 2020 14:08:43 +0000 Original-Received: from localhost ([127.0.0.1]:47744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFenr-00009K-6H for submit@debbugs.gnu.org; Sat, 21 Mar 2020 10:08:43 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:51159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFeno-000090-Fe for 40140@debbugs.gnu.org; Sat, 21 Mar 2020 10:08:41 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id F39DA2400FE for <40140@debbugs.gnu.org>; Sat, 21 Mar 2020 15:08:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1584799714; bh=QoGFlEnktu/KDCFCoHLTo2Vjwtl5n2HMuzbeOzLzCX8=; h=From:To:Subject:Date:From; b=oIkyGJvQIhsONG9/xcAlvFAhCVC8/zV997DSKojZJGXfBG5aT8W2fe5t0dQbA8pRf /oAlgTCXqmL5+jcBt0LQ2Uup7hWwE0CzKQWlgsnSnDmxe/pkpzKdOGR6sz1e8TIcI3 UmB2aftLRi1g4q7Lztd3l8fLuVvzaM3mF8irJ71uqaMWgw+H2I7n4/rRH3OhjUkNzh v4FXT/6pryj/nSUkR3pBhsYbFBrCJ0hK8m7pbq51+otyQybFe8GhpIRNd/KjYgqYR+ wM7gFdOV7jrz44BT6S0PUUfuTanH/ffghrAEhAynbuxShgs2O90ZM9XxiAB/XoY0ZE 1oPHxBBViDYcw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 48l2YY215Vz9rxP; Sat, 21 Mar 2020 15:08:33 +0100 (CET) In-Reply-To: <8b3ce871-8b21-41aa-1633-36a032b0028c@gmail.com> 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.io gmane.emacs.bugs:177596 Archived-At: Hello Nicolas Nicolas Gimenez writes: > Hi! > > > Right after renaming a directory with an external tool when Emacs is > visiting a file in that directory, Emacs doesn't change the open file > buffers directory association. > > It would probably be better to open a prompt where one can navigate to a > new target directory. > > > Steps to reproduce: > > 1) Create file and directory > '/home/nicolas/elixir_learn/mastery/test/support/tmp/test.ex' within > Spacemacs. > > 2) Edit file, still from Spacemacs add dummy info. Save file. > > 3) Save file > '/home/nicolas/elixir_learn/mastery/test/support/tmp/test.ex from Spacemacs > > 4) Switch to bash in an external terminal and run: "mv > /home/nicolas/elixir_learn/mastery/test/support/tmp > /home/nicolas/elixir_learn/mastery/test/support/tmp2". (Emacs still open > in another OS's frame.) > > 5) Get back to Emacs. Attempt to write file from Emacs, minibuffer in > the bottom shows: "Please answer y or n. Directory > '/home/nicolas/elixir_learn/mastery/test/support/tmp/' does not exist; > create? (y or n)" If you try this experiment with any other text editor I think you will see similar effects. I tried with gedit and vim and got the corresponding effects. Using Emacs in this case I would do C-x C-w and then navigate to the existing directory, then one with the new name tmp2. Then I will have to allow over-writing the copy of test.ex on disc in tmp2. I think the text editor cannot assume that the buffer holding test.ex is to be associated with the file in the new directory. The buffer-file association is broken by the external renaming of the directory. Best regards -- Tomas