all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tomas Nordin <tomasn@posteo.net>
To: Nicolas Gimenez <n.gimenez66@gmail.com>, 40140@debbugs.gnu.org
Subject: bug#40140: 26.3; Renaming a directory with an external tool
Date: Sat, 21 Mar 2020 15:08:32 +0100	[thread overview]
Message-ID: <87y2rtls0v.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <8b3ce871-8b21-41aa-1633-36a032b0028c@gmail.com>

Hello Nicolas

Nicolas Gimenez <n.gimenez66@gmail.com> 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





  reply	other threads:[~2020-03-21 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 22:53 bug#40140: 26.3; Renaming a directory with an external tool Nicolas Gimenez
2020-03-21 14:08 ` Tomas Nordin [this message]
2021-06-14 14:25   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2rtls0v.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me \
    --to=tomasn@posteo.net \
    --cc=40140@debbugs.gnu.org \
    --cc=n.gimenez66@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.