From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Dired delete(d) the wrong file! Date: Fri, 05 Jul 2024 13:52:25 +0300 Message-ID: <86bk3c6rh2.fsf@gnu.org> References: <86r0c875s4.fsf@gnu.org> <86h6d470oh.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8318"; mail-complaints-to="usenet@ciao.gmane.io" Cc: deego3@gmail.com, luangruo@yahoo.com, emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 05 12:53:27 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sPgZC-0001wW-2j for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Jul 2024 12:53:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPgYK-0000MP-EV; Fri, 05 Jul 2024 06:52:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPgYH-0000KG-9X for emacs-devel@gnu.org; Fri, 05 Jul 2024 06:52:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPgYG-0004SE-Oz; Fri, 05 Jul 2024 06:52:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=iS2APg53c45opLcBDfNxKZ6ocm7tTArov2ggUlir2Vs=; b=aNUJUbg0bZnC H4+sxZKcEof8d73XkdoLWYbJ2kJkAJoSc1VfIWiAIVc5py+nlbfEqQs6DFL01Ju86NSqguq/sdJDJ 3H0tEPDRbEBLqj8eGV0wEfNpAb09DmJwmp0BbBzg4yJf863E5dmIPv61HzmYKU0z//qw1C0cOv0TD VOwvil4Uu7ZdJ0K5wq5CuXHRypbf1eD0W0OgrzksQjO/xmqxvMsqcK/vwE5Z9cfqzhkYszmiT9cyV aKB0h/lALRLiOPSkNUq1NLgNwIG+TasY7jeTrwrB7VRUJ9wUSk0/Jt5wMajg9kSgvtSmJ3ZjDISdd 6UQx/UJr376D6iU0UZH3gg==; In-Reply-To: (message from Stefan Kangas on Fri, 5 Jul 2024 09:53:05 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321388 Archived-At: > From: Stefan Kangas > Date: Fri, 5 Jul 2024 09:53:05 +0000 > Cc: luangruo@yahoo.com, emacs-devel@gnu.org > > Eli Zaretskii writes: > > > diff --git a/lisp/files.el b/lisp/files.el > > index 042b8e2..c518273 100644 > > --- a/lisp/files.el > > +++ b/lisp/files.el > > @@ -8087,8 +8087,8 @@ insert-directory-clean > > (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 " -> ". > > + (if (memq (char-after end) '(?\n ?\s ?/ ?* ?@ ?% ?= ?|)) > > + ;; End is followed by \n or by output of -F. > > (put-text-property start end 'dired-filename t) > > ;; It seems that we can't trust ls's output as to > > ;; byte positions of filenames. > > > > It would be useful to have a test for this, BTW. I agree. Patches welcome. Note that the problem does not exist if ls-lisp is used, so the test should specifically test the configuration where that is not so.