]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle symlinks in wdired.el when restoring filename property
authorStephen Berman <stephen.berman@gmx.net>
Sun, 29 Jul 2018 11:16:48 +0000 (13:16 +0200)
committerStephen Berman <stephen.berman@gmx.net>
Sun, 29 Jul 2018 11:16:48 +0000 (13:16 +0200)
* 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.

lisp/wdired.el

index 1d0106775d6df4f3e1014e39577cfa34164e18ed..be0bde290ab0336a41c471b8659b4b286fa6e412 100644 (file)
@@ -611,7 +611,10 @@ Optional arguments are ignored."
       (when (re-search-forward directory-listing-before-filename-regexp
                                (line-end-position) t)
         (setq beg (point)
-              end (line-end-position))
+              end (if (and (file-symlink-p (dired-get-filename))
+                           (search-forward " -> " (line-end-position) t))
+                      (goto-char (match-beginning 0))
+                    (line-end-position)))
         (put-text-property beg end 'dired-filename t)))))
 
 (defun wdired-next-line (arg)