From: Rodrigo Morales <moralesrodrigo1100@gmail.com>
To: 48659@debbugs.gnu.org
Subject: bug#48659: Escapes are deleted after executing "dired-toggle-read-only" in *Find* buffer
Date: Tue, 25 May 2021 15:40:21 -0500 [thread overview]
Message-ID: <87mtsi35u2.fsf@gmail.com> (raw)
* The context
By default, when executing =find-dired=, spaces are escaped (see below)
#+BEGIN_EXAMPLE
/home/thisisme/e/:
find . \( -type f \) -ls
29754046 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:25 a/bar\ bar.txt
29753703 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:25 a/foo\ foo.txt
29754079 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:25 b/bar\ bar.txt
29754078 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:25 b/foo\ foo.txt
find finished at Tue May 25 15:25:42
#+END_EXAMPLE
This happens because that's the default behavior of =find= when we
execute it in the command-line.
#+begin_src bash
find . \( -type f \) -ls
#+end_src
#+RESULTS:
#+begin_example
29754078 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:25 ./b/foo\ foo.txt
29754079 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:25 ./b/bar\ bar.txt
29753703 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:25 ./a/foo\ foo.txt
29754046 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:25 ./a/bar\ bar.txt
#+end_example
* The issue
This is causing =dired-toggle-read-only= to remove spaces after
finishing editing the buffer. I would consider this a bug, but let me
explain this further so that we all can determine whether this is a bug
or not.
* Minimal reproducible example
Let's suppose we have this directory
#+begin_src bash
mkdir {a,b} && touch {a,b}/{foo\ foo,bar\ bar}.txt
#+end_src
#+begin_src bash
tree -a --noreport
#+end_src
#+RESULTS:
#+begin_example
.
├── a
│ ├── bar bar.txt
│ └── foo foo.txt
└── b
├── bar bar.txt
└── foo foo.txt
#+end_example
Let's execute =find-dired= and let's list the files (i.e. =-type
f=). The buffer =*Find*= would show the following
#+begin_example
/home/thisisme/e/:
find . \( -type f \) -ls
29754046 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:30 a/bar\ bar.txt
29753703 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:30 a/foo\ foo.txt
29754079 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:30 b/bar\ bar.txt
29754078 0 -rw-r--r-- 1 thisisme thisisme 0 May 25 15:30 b/foo\ foo.txt
find finished at Tue May 25 15:30:49
#+end_example
Now, let's toggle a =dired-toggle-read-only= and edit any name (I
appended =test= after the =a/barbar.txt= file).
Now, see what =tree= reports.
#+begin_src bash
tree -a --noreport
#+end_src
#+RESULTS:
#+begin_example
.
├── a
│ ├── barbar.txt-test
│ └── foofoo.txt
└── b
├── barbar.txt
└── foofoo.txt
#+end_example
As you could see, spaces were removed from filenames and I think that
this happens because =find-file= show spaces as escaped characters.
next reply other threads:[~2021-05-25 20:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 20:40 Rodrigo Morales [this message]
2021-05-26 12:14 ` bug#48659: Escapes are deleted after executing "dired-toggle-read-only" in *Find* buffer Eli Zaretskii
2021-05-26 15:16 ` Rodrigo Morales
2021-05-26 17:18 ` Eli Zaretskii
[not found] ` <871r9tdp99.fsf@gmail.com>
2021-05-27 7:04 ` Eli Zaretskii
2021-05-29 6:29 ` Arthur Miller
2021-05-27 9:14 ` Robert Pluim
2021-05-27 9:34 ` Eli Zaretskii
2021-05-27 13:50 ` Michael Heerdegen
2021-05-27 14:01 ` Michael Heerdegen
2021-05-27 14:04 ` Eli Zaretskii
2021-05-27 14:16 ` Michael Heerdegen
2021-05-27 14:48 ` Andreas Schwab
2021-05-27 15:04 ` Andreas Schwab
2021-05-27 15:31 ` Michael Heerdegen
2021-05-27 15:38 ` Andreas Schwab
2021-05-27 15:47 ` Michael Heerdegen
2021-05-27 15:57 ` Andreas Schwab
2021-05-27 15:56 ` Andreas Schwab
2021-05-27 18:49 ` Michael Heerdegen
2021-05-27 19:11 ` Andreas Schwab
2021-05-27 20:38 ` Michael Heerdegen
2021-05-29 13:39 ` Andreas Schwab
2021-05-29 23:09 ` Michael Heerdegen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mtsi35u2.fsf@gmail.com \
--to=moralesrodrigo1100@gmail.com \
--cc=48659@debbugs.gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).