From: Daniel Martín Date: Tue, 22 Dec 2020 06:36:41 +0000 (+0100) Subject: Fix wdired-get-filename when ls -F marks symlinks X-Git-Tag: emacs-28.0.90~4617 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=901532967873ab82d948024105b5736b622f518b;p=emacs.git Fix wdired-get-filename when ls -F marks symlinks * lisp/wdired.el (wdired-get-filename): In some systems like BSD or macOS, "ls -F" marks symlinks with a trailing "@". Add logic accounting for this so that wdired-get-filename returns the correct filename. This change also fixes test "wdired-test-bug34915" on macOS and BSD systems (bug#34915). --- diff --git a/lisp/wdired.el b/lisp/wdired.el index b7dd4ee9496..c2e1d0cafce 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -355,7 +355,10 @@ non-nil means return old filename." dired-permission-flags-regexp nil t) (goto-char (match-beginning 0)) (looking-at "l") - (search-forward " -> " (line-end-position) t))) + (if (and used-F + dired-ls-F-marks-symlinks) + (re-search-forward "@? -> " (line-end-position) t) + (search-forward " -> " (line-end-position) t)))) (goto-char (match-beginning 0)) (setq end (point))) (when (and used-F