From: Eli Zaretskii Date: Sat, 29 Oct 2022 13:16:06 +0000 (+0300) Subject: Make Dired header clickable on non-Posix systems as well X-Git-Tag: emacs-29.0.90~1616^2~394 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=174dd064643e9487c0fa1460727d0935a60b3646;p=emacs.git 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) --- 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