summaryrefslogtreecommitdiff
path: root/lisp/wdired.el
diff options
context:
space:
mode:
authorStephen Berman <stephen.berman@gmx.net>2019-04-25 19:17:23 +0200
committerStephen Berman <stephen.berman@gmx.net>2019-04-25 19:17:23 +0200
commit6d8e0fc5aa7673540486af9ecbfc0a3e23c305cf (patch)
tree75247e50c3873c8dfeb4ad9b4b4e80851d2abdbb /lisp/wdired.el
parent30030945c30c4710d0d70cabad9d1b512cede0ee (diff)
downloademacs-6d8e0fc5aa7673540486af9ecbfc0a3e23c305cf.tar.gz
emacs-6d8e0fc5aa7673540486af9ecbfc0a3e23c305cf.tar.bz2
emacs-6d8e0fc5aa7673540486af9ecbfc0a3e23c305cf.zip
Make wdired-mode ignore ls file indicators
* lisp/wdired.el (wdired--restore-dired-filename-prop): When dired-listing-switches includes "F" or "classify", don't treat appended indicator characters as part of the file name (bug#34915). * test/lisp/wdired-tests.el (wdired-test-bug34915): New test.
Diffstat (limited to 'lisp/wdired.el')
-rw-r--r--lisp/wdired.el25
1 files changed, 17 insertions, 8 deletions
diff --git a/lisp/wdired.el b/lisp/wdired.el
index acc62e4e391..d2a298bd25b 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -612,14 +612,23 @@ Optional arguments are ignored."
(when (re-search-forward
directory-listing-before-filename-regexp lep t)
(setq beg (point)
- ;; If the file is a symlink, put the dired-filename
- ;; property only on the link name. (Using
- ;; (file-symlink-p (dired-get-filename)) fails in
- ;; wdired-mode, bug#32673.)
- end (if (and (re-search-backward
- dired-permission-flags-regexp nil t)
- (looking-at "l")
- (search-forward " -> " lep t))
+ end (if (or
+ ;; If the file is a symlink, put the
+ ;; dired-filename property only on the link
+ ;; name. (Using (file-symlink-p
+ ;; (dired-get-filename)) fails in
+ ;; wdired-mode, bug#32673.)
+ (and (re-search-backward
+ dired-permission-flags-regexp nil t)
+ (looking-at "l")
+ (search-forward " -> " lep t))
+ ;; When dired-listing-switches includes "F"
+ ;; 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")
+ (re-search-forward "[*/@|=>]$" lep t)))
(goto-char (match-beginning 0))
lep))
(put-text-property beg end 'dired-filename t))))))