Function: hpath:substitute-posix-or-mswindows-at-point

hpath:substitute-posix-or-mswindows-at-point is an autoloaded, interactive and byte-compiled function defined in hpath.el.

Signature

(hpath:substitute-posix-or-mswindows-at-point)

Documentation

If point is in a Posix or MSWindows path, change the path to the other type.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hpath.el
;;;###autoload
(defun hpath:substitute-posix-or-mswindows-at-point ()
  "If point is in a Posix or MSWindows path, change the path to the other type."
  (interactive "*")
  (barf-if-buffer-read-only)
  (let* ((opoint (point))
	 (str-and-positions (hpath:delimited-possible-path t t))
	 (path (car str-and-positions))
	 (start (nth 1 str-and-positions))
	 (end (nth 2 str-and-positions)))
      (when path
	(if (hpath:posix-path-p path)
	    (setq path (hpath:posix-to-mswindows path))
	  (setq path (hpath:mswindows-to-posix path)))
	(delete-region start end)
	(insert path)
	(goto-char (min opoint (point-max))))))