summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-10-29 16:16:06 +0300
committerEli Zaretskii <eliz@gnu.org>2022-10-29 16:16:06 +0300
commit174dd064643e9487c0fa1460727d0935a60b3646 (patch)
treebe5a68b34ec2ed4c3af01ecae11969d0795e39e0 /lisp/dired.el
parente9bdf3d4bd5aa2be7448b0f7a968af5abb058db0 (diff)
downloademacs-174dd064643e9487c0fa1460727d0935a60b3646.tar.gz
emacs-174dd064643e9487c0fa1460727d0935a60b3646.tar.bz2
emacs-174dd064643e9487c0fa1460727d0935a60b3646.zip
Make Dired header clickable on non-Posix systems as well
* lisp/dired.el (dired--make-directory-clickable): Support MS-Windows and MS-DOS absolute directory names with drive letters and UNCs. (Bug#21973)
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 128770105b0..7a8f1ae7a16 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1911,11 +1911,15 @@ mouse-2: visit this file in other window"
(defun dired--make-directory-clickable ()
(save-excursion
(goto-char (point-min))
- (while (re-search-forward "^ /" nil t 1)
+ (while (re-search-forward
+ (if (memq system-type '(windows-nt ms-dos))
+ "^ \\([a-zA-Z]:/\\|//\\)"
+ "^ /")
+ nil t 1)
(let ((bound (line-end-position))
(segment-start (point))
(inhibit-read-only t)
- (dir "/"))
+ (dir (substring (match-string 1) 2)))
(while (search-forward "/" bound t 1)
(setq dir (concat dir (buffer-substring segment-start (point))))
(add-text-properties