Function: hpath:mswindows-to-posix-separators

hpath:mswindows-to-posix-separators is a byte-compiled function defined in hpath.el.

Signature

(hpath:mswindows-to-posix-separators PATH)

Documentation

Replace backslashes with forward slashes and abbreviate the PATH if possible.

Path must be a string or an error will be triggered. See abbreviate-file-name for how path abbreviation is handled.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hpath.el
(defun hpath:mswindows-to-posix-separators (path)
  "Replace backslashes with forward slashes and abbreviate the PATH if possible.
Path must be a string or an error will be triggered.  See
`abbreviate-file-name' for how path abbreviation is handled."
    (setq path (replace-regexp-in-string "\\\\" "/" path)
          ;; Downcase any host and domain for mount-point matching
          path (if (string-match "\\`//[^/:]+" path)
                   (concat (downcase (match-string 0 path))
                           (substring path (match-end 0)))
                 path)
          path (hpath:abbreviate-file-name path)
          path (replace-regexp-in-string (regexp-quote "\\`") "" path)
          path (replace-regexp-in-string (regexp-quote "\\>") "" path)))