unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48659: Escapes are deleted after executing "dired-toggle-read-only" in *Find* buffer
@ 2021-05-25 20:40 Rodrigo Morales
  2021-05-26 12:14 ` Eli Zaretskii
  2021-05-29 13:39 ` Andreas Schwab
  0 siblings, 2 replies; 24+ messages in thread
From: Rodrigo Morales @ 2021-05-25 20:40 UTC (permalink / raw)
  To: 48659


* 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.





^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2021-05-29 23:09 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-25 20:40 bug#48659: Escapes are deleted after executing "dired-toggle-read-only" in *Find* buffer Rodrigo Morales
2021-05-26 12:14 ` 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

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).