From: Michael Heerdegen via "Emacs development discussions." <emacs-devel@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: Dired delete(d) the wrong file!
Date: Fri, 05 Jul 2024 09:11:51 +0200 [thread overview]
Message-ID: <875xtknwi0.fsf@web.de> (raw)
In-Reply-To: 875xtk4cb3.fsf@yahoo.com
Po Lu <luangruo@yahoo.com> writes:
> Yes, that was my point. Something on Dave's system is otherwise than it
> is on the system where Dired was reported to identify the correct file.
Edebugging `insert-directory-clean' reveals that here:
#+begin_src emacs-lisp
(while (< (point) end)
(let ((start (insert-directory-adj-pos
(+ beg (read (current-buffer)))
error-lines))
(end (insert-directory-adj-pos
(+ beg (read (current-buffer)))
error-lines)))
(if (memq (char-after end) '(?\n ?\s))
;; End is followed by \n or by " -> ".
(put-text-property start end 'dired-filename t)
;; It seems that we can't trust ls's output as to
;; byte positions of filenames.
(put-text-property beg (point) 'dired-filename nil)
(end-of-line))))
#+end_src
the loop gets aborted because the (memq (char-after end) '(?\n ?\s)) call,
when using Dave's ls options, returns the slash character that comes after
".":
| bash-5.2:micha:tmp$ ls -alF --dired
| total 72
| drwxr-xr-x 3 micha micha 4096 Jul 5 07:26 ./
| drwxr-xr-x 213 micha micha 61440 Jul 5 07:07 ../
| -rw-rw-r-- 1 micha micha 0 Jul 5 07:25 '07 nov 2395 zz.kk'
| drwxr-xr-x 3 micha micha 4096 Jun 23 2014 src/
| //DIRED// 60 61 112 114 164 183 233 236
| //DIRED-OPTIONS// --quoting-style=shell-escape
and so we throw away that information. 60 and 61 are the positions
before and after the "." directory.
Michael.
prev parent reply other threads:[~2024-07-05 7:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 22:36 Dired delete(d) the wrong file! Dave Goel
2024-07-04 23:35 ` Dave Goel
2024-07-05 1:40 ` Dave Goel
2024-07-05 8:01 ` Tassilo Horn
2024-07-05 1:24 ` Po Lu
2024-07-05 5:43 ` Eli Zaretskii
2024-07-05 5:50 ` Dave Goel
2024-07-05 7:33 ` Eli Zaretskii
2024-07-05 8:06 ` Dave Goel
2024-07-05 8:12 ` Dave Goel
2024-07-05 8:26 ` Dave Goel
2024-07-05 8:39 ` Dave Goel
2024-07-05 11:05 ` Eli Zaretskii
2024-07-05 19:02 ` Dave Goel
2024-07-05 11:00 ` Eli Zaretskii
2024-07-05 9:53 ` Stefan Kangas
2024-07-05 10:52 ` Eli Zaretskii
2024-07-05 23:28 ` Michael Heerdegen via Emacs development discussions.
2024-07-06 6:17 ` Eli Zaretskii
2024-07-05 5:50 ` Po Lu
2024-07-05 7:11 ` Michael Heerdegen via Emacs development discussions. [this message]
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=875xtknwi0.fsf@web.de \
--to=emacs-devel@gnu.org \
--cc=michael_heerdegen@web.de \
/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.