unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 34915@debbugs.gnu.org
Subject: bug#34915: 27.0.50; Wdired regression with ls -F
Date: Fri, 26 Apr 2019 14:56:57 +0100	[thread overview]
Message-ID: <87d0l8hnti.fsf@tcd.ie> (raw)
In-Reply-To: <87sgu6f0zp.fsf@gmx.net> (Stephen Berman's message of "Thu, 25 Apr 2019 19:28:26 +0200")

[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]

Stephen Berman <stephen.berman@gmx.net> writes:

> On Fri, 12 Apr 2019 15:06:18 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:
>
>> On Fri, 12 Apr 2019 13:58:25 +0100 "Basil L. Contovounesios" <contovob@tcd.ie> wrote:
>>
>>> Stephen Berman <stephen.berman@gmx.net> writes:
>>>
>>>> On Tue, 19 Mar 2019 13:43:16 +0000 "Basil L. Contovounesios"
>>>> <contovob@tcd.ie> wrote:
>>>>
>>>>> It seems like Wdired thinks the indicators added by ls (one of */=>@|)
>>>>> are part of the file name now.
>>>>
>>>> This is indeed due to my changes.  The patch below appears to fix the
>>>> problem, but I'm not sure how robust it is (I was also, and remain,
>>>> unsure about my handling of symlinks in the previous patch, but I
>>>> haven't found time to look at it more closely; at least I haven't seen
>>>> any bug reports about it so far).
>>>
>>> I can confirm your patch fixes the issue, thanks!
>>
>> Thanks for testing.  If there are no objections within a few days, I'll
>> push it to master.
>
> I didn't expect "a few days" to become almost two weeks, but I've
> finally pushed the fix to master as commit 6d8e0fc5aa.  I slightly
> changed the patch to account for using either the short or long form of
> the indicator switch, and I added a test.

Thanks.  I noticed an opportunity for a tiny bit of reuse:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: classify.diff --]
[-- Type: text/x-diff, Size: 1842 bytes --]

diff --git a/lisp/dired.el b/lisp/dired.el
index 63082fe392..3050a4bd2d 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1261,6 +1261,10 @@ dired-switches-recursive-p
   "Return non-nil if the string SWITCHES contains -R or --recursive."
   (dired-check-switches switches "R" "recursive"))
 
+(defun dired-switches-classify-p (switches)
+  "Return non-nil if the string SWITCHES contains -F or --classify."
+  (dired-check-switches switches "F" "classify"))
+
 (defun dired-insert-directory (dir switches &optional file-list wildcard hdr)
   "Insert a directory listing of DIR, Dired style.
 Use SWITCHES to make the listings.
@@ -2588,7 +2592,7 @@ dired-move-to-end-of-filename
   (if (get-text-property (point) 'dired-filename)
       (goto-char (next-single-property-change (point) 'dired-filename))
     (let ((opoint (point))
-          (used-F (dired-check-switches dired-actual-switches "F" "classify"))
+          (used-F (dired-switches-classify-p dired-actual-switches))
           (eol (line-end-position))
           (hidden (dired--hidden-p))
           file-type executable symlink)
diff --git a/lisp/wdired.el b/lisp/wdired.el
index d2a298bd25..1e9c7f6c5a 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -626,8 +626,7 @@ wdired--restore-dired-filename-prop
                          ;; or "classify", don't treat appended
                          ;; indicator characters as part of the file
                          ;; name (bug#34915).
-                         (and (dired-check-switches dired-actual-switches
-                                                    "F" "classify")
+                         (and (dired-switches-classify-p dired-actual-switches)
                               (re-search-forward "[*/@|=>]$" lep t)))
                         (goto-char (match-beginning 0))
                       lep))

[-- Attachment #3: Type: text/plain, Size: 269 bytes --]


Which makes me wonder: is there no Dired function that
wdired--restore-dired-filename-prop can reuse for finding the boundaries
of a file name?  Is dired-move-to-end-of-filename not suitable?  It
seems to perform similar checks for symlinks and --classify.

-- 
Basil

  reply	other threads:[~2019-04-26 13:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 13:43 bug#34915: 27.0.50; Wdired regression with ls -F Basil L. Contovounesios
2019-04-12 12:23 ` Stephen Berman
2019-04-12 12:58   ` Basil L. Contovounesios
2019-04-12 13:06     ` Stephen Berman
2019-04-25 17:28       ` Stephen Berman
2019-04-26 13:56         ` Basil L. Contovounesios [this message]
2019-04-26 16:07           ` Stephen Berman
2019-04-26 16:20             ` Basil L. Contovounesios
2019-04-26 13:57         ` Basil L. Contovounesios
2019-05-30 19:51 ` Ken Brown
2019-06-26 16:28   ` Ken Brown
2019-06-26 16:57     ` Stephen Berman
2019-12-30 19:38 ` Mattias Engdegård
2020-09-20 18:14   ` Lars Ingebrigtsen
2020-09-21  9:42     ` Mattias Engdegård

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=87d0l8hnti.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=34915@debbugs.gnu.org \
    --cc=stephen.berman@gmx.net \
    /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).