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:56:57 +0100 Message-ID: <87d0l8hnti.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="63321"; 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:58:16 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 1hK1Ml-000GLe-TY for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Apr 2019 15:58:16 +0200 Original-Received: from localhost ([127.0.0.1]:47523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK1Mk-0002SB-Ti for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Apr 2019 09:58:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hK1Ma-0002QR-LF for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 09:58:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hK1MZ-000334-H0 for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 09:58:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hK1MY-00032O-No for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 09:58:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hK1MY-00057V-HX for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 09:58: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:58:02 +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.155628703719625 (code B ref 34915); Fri, 26 Apr 2019 13:58:02 +0000 Original-Received: (at 34915) by debbugs.gnu.org; 26 Apr 2019 13:57:17 +0000 Original-Received: from localhost ([127.0.0.1]:33300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hK1Lp-00056S-Eq for submit@debbugs.gnu.org; Fri, 26 Apr 2019 09:57:17 -0400 Original-Received: from mail-ed1-f42.google.com ([209.85.208.42]:34914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hK1Lk-00056B-2T for 34915@debbugs.gnu.org; Fri, 26 Apr 2019 09:57:12 -0400 Original-Received: by mail-ed1-f42.google.com with SMTP id y67so3278141ede.2 for <34915@debbugs.gnu.org>; Fri, 26 Apr 2019 06:57:11 -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:references:date:in-reply-to:message-id :user-agent:mime-version; bh=j2QQzHndcQJ/5f3f3lSr0HTDCJbpfPn0UkE01pbRiUo=; b=m5K/mms6NP14jByW/aJ4OwKrIZhfC8S+TmOA4Runw269Tnsnlgg6zM73xonH43T7aW uOaosAywrhV0QKsQ5sLEkeKfoo6SMRW5i8GMxbLdlpVGTyIjUqniyfwP+uMKjPnvIkZV JNWBk15OjdPgVEBQeMn/q/fDSOGK4VWbkvNgLToWq6UGwOKk9pjR/1U7qmnf8IJQVTDp 4b65C1ES7kbn4MLsMOvQBTBggneA50TenpEZNYLt4wOvWv6zkjZhCmlTpaMX+wVkp+PI j9SVQfVGat6S+bbdal4PwnLUTRQeWVuIkR4KFdKTqzIaEO3hKJLPQM8fs5XVrAfgcm7c mrxg== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=j2QQzHndcQJ/5f3f3lSr0HTDCJbpfPn0UkE01pbRiUo=; b=QXF3HhIZECXKG5wDw4fVmTH23y2z0wRVwh0/3kr8r+7KyMoeFRk3tgFl/KTL4Ue7I1 iaZVQ6BPvJ3ZSVV9SyNlzU/W+dTByS3L9l9/wntv4BBzniyunQZKsKFN1/ZXNHuNkJwh amoeIyWIZh0liCOgRvFqWIRTbydadWGByZh2+MWFIqB0LyaglhO0eHf0lxZLTvkLM4d+ MKDXOzX2bU8uDfadqh3oEhGmiJCUVAG/oJThqBbOvpSVWiJf7VbQVFcXtS1IWVKx6UsM GC8UFFgtTDi+j08gMoNulRMt21hPwMs5dagDdnvppFpm6kpi154kRtzAWH+gHRHENxn8 YqSg== X-Gm-Message-State: APjAAAWNjcXJbkpMrkaCI9UeQFNosr0GfjoSswry3G1nj55eRgJ51Fhc HOqo/4C8JZ/JS18TGyoxk3irGA== X-Google-Smtp-Source: APXvYqzZEHCoOBrwzPC77S46XybaD26gQpA8uNDrc0dmfiXKe2R3TTYrO68m8d/+BX+iJywW15dLJQ== X-Received: by 2002:a17:906:1146:: with SMTP id i6mr22089130eja.21.1556287026009; Fri, 26 Apr 2019 06:57:06 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:8cad:ae29:555d:852d]) by smtp.gmail.com with ESMTPSA id s56sm1329488edd.35.2019.04.26.06.57.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Apr 2019 06:57:03 -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:158294 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 --=-=-=--