aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Berman2018-07-29 13:16:48 +0200
committerStephen Berman2018-07-29 13:16:48 +0200
commitea1cf0960a86bc373cfd4900f46d9fe5e847941e (patch)
tree089cb91ceabfd3188e096316a53e4663cdf1ae93
parent8a563d9762670e9eec9420ba2dc12075c1dd0a8c (diff)
downloademacs-ea1cf0960a86bc373cfd4900f46d9fe5e847941e.tar.gz
emacs-ea1cf0960a86bc373cfd4900f46d9fe5e847941e.zip
Handle symlinks in wdired.el when restoring filename property
* lisp/wdired.el (wdired--restore-dired-filename-prop): If the file name is a symbolic link, only propertize the link name. This prevents wdired-create-parentdirs from turning the link into a directory.
-rw-r--r--lisp/wdired.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 1d0106775d6..be0bde290ab 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -611,7 +611,10 @@ Optional arguments are ignored."
611 (when (re-search-forward directory-listing-before-filename-regexp 611 (when (re-search-forward directory-listing-before-filename-regexp
612 (line-end-position) t) 612 (line-end-position) t)
613 (setq beg (point) 613 (setq beg (point)
614 end (line-end-position)) 614 end (if (and (file-symlink-p (dired-get-filename))
615 (search-forward " -> " (line-end-position) t))
616 (goto-char (match-beginning 0))
617 (line-end-position)))
615 (put-text-property beg end 'dired-filename t))))) 618 (put-text-property beg end 'dired-filename t)))))
616 619
617(defun wdired-next-line (arg) 620(defun wdired-next-line (arg)