From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#34915: 27.0.50; Wdired regression with ls -F Date: Fri, 26 Apr 2019 14:57:53 +0100 Message-ID: <87bm0shnry.fsf@tcd.ie> References: <871s33ugi3.fsf@tcd.ie> <87sguncsz9.fsf@gmx.net> <87d0lrcrda.fsf@tcd.ie> <87ftqncr05.fsf@rub.de> <87sgu6f0zp.fsf@gmx.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="68528"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34915@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 26 15:59:23 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hK1Nr-000HgZ-1I for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Apr 2019 15:59:23 +0200 Original-Received: from localhost ([127.0.0.1]:47529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK1Nq-0003FH-3p for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Apr 2019 09:59:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK1NX-000389-BZ for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 09:59:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hK1NW-0003Qc-6U for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 09:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47993) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hK1NW-0003QY-2z for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 09:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hK1NW-00059S-0h for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 09:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Apr 2019 13:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34915 X-GNU-PR-Package: emacs Original-Received: via spool by 34915-submit@debbugs.gnu.org id=B34915.155628708419713 (code B ref 34915); Fri, 26 Apr 2019 13:59:01 +0000 Original-Received: (at 34915) by debbugs.gnu.org; 26 Apr 2019 13:58:04 +0000 Original-Received: from localhost ([127.0.0.1]:33304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hK1MZ-00057t-Tn for submit@debbugs.gnu.org; Fri, 26 Apr 2019 09:58:04 -0400 Original-Received: from mail-ed1-f41.google.com ([209.85.208.41]:33745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hK1MX-00057H-Nt for 34915@debbugs.gnu.org; Fri, 26 Apr 2019 09:58:02 -0400 Original-Received: by mail-ed1-f41.google.com with SMTP id d55so1410312ede.0 for <34915@debbugs.gnu.org>; Fri, 26 Apr 2019 06:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=j2QQzHndcQJ/5f3f3lSr0HTDCJbpfPn0UkE01pbRiUo=; b=isAv4XtZBstqm1PQoTRdSW3vUmpP41c/uJs4NISh4ZYU8XT+b/ZRiLlvkDGuMbgbZW fhE/e9SvGq6CnZRN54+RrD7Btt4WhfGDyBnj9O6U+XrRhhArwdGOF5NT2GOQqBiVc0pI uwUOqbtska7ux0I0bdGybxxLURnAQIsDoPE4EWZXjKpfHzyIA5lsoR0Ye5WTdYmUqfg1 5uz+S1eKwMqmWLTV37OvKKHjZ2+/FIOv58vJ1sFRv1/B3wFyM9FyctIgHBGo7NfPsAFh n+G1f6tGMOuysiOTUNj8cWf5L8CWuLITf0YDnRuyhCdoGJ6Mq46du3dHJne54eGvA99B KMzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=j2QQzHndcQJ/5f3f3lSr0HTDCJbpfPn0UkE01pbRiUo=; b=nfD/Qz02LNITyDko2+QVfRWSZ9SQpBs63/UiDTdoxArl7TB4zQYq+1qYUgOyjdw6Cq 5ygMQRL1b6MA8VUZft7BwkcevJi2brSjmzd3E9B9SVZGGNSH/vqmkvcOqVuOHeVcgDrq wOPLVdIDM6TQd0up1kBNpcxKEACadAQa2Ah/Tsq6OkW105pXNNNaj/mPTvFaA7VRwcnT WWkEkntiqMDR4LPmEOg5TxiW1Blw91TzDSwFsFSE+cWgzj2LLkqYbky0JkGC4GmrK7v4 ehkiNeHJWvPvzyCDA79qbxEPJkgEeGCtKUEXQl8Hd7hgKcTZ6iu+dcBWBIOY26xxO7jI XbNQ== X-Gm-Message-State: APjAAAUIUc5QaE0uQh8iRkxBZV6WpcAEgMoqK3IFqQoHBsa9yccgHK41 o/6xP2kevo7/iENhMWA/N/eMyicwYOk= X-Google-Smtp-Source: APXvYqyx7F/C09uIF/FaMeGPTGlsoJXrCdTL9gmaaXCFyNGj9nMSJ39PswBVi1C7bVMCOe1x+ei2yQ== X-Received: by 2002:a17:906:2601:: with SMTP id h1mr22923840ejc.70.1556287076006; Fri, 26 Apr 2019 06:57:56 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:8cad:ae29:555d:852d]) by smtp.gmail.com with ESMTPSA id o9sm3542886edh.95.2019.04.26.06.57.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Apr 2019 06:57:55 -0700 (PDT) In-Reply-To: <87sgu6f0zp.fsf@gmx.net> (Stephen Berman's message of "Thu, 25 Apr 2019 19:28:26 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158295 Archived-At: --=-=-= Content-Type: text/plain Stephen Berman writes: > On Fri, 12 Apr 2019 15:06:18 +0200 Stephen Berman wrote: > >> On Fri, 12 Apr 2019 13:58:25 +0100 "Basil L. Contovounesios" wrote: >> >>> Stephen Berman writes: >>> >>>> On Tue, 19 Mar 2019 13:43:16 +0000 "Basil L. Contovounesios" >>>> 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=classify.diff 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)) --=-=-= Content-Type: text/plain 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 --=-=-=--