diff --git a/src/workgroups-misc.el b/src/workgroups-misc.el new file mode 100644 index 0000000000000000000000000000000000000000..54c5f5ca3ab1b85a581d9be3ff05546caa9c2243 --- /dev/null +++ b/src/workgroups-misc.el @@ -0,0 +1,15 @@ +(defun wg-string/starts-with (s arg) + "returns non-nil if string S starts with ARG. Else nil." + (cond ((>= (length s) (length arg)) + (string-equal (substring s 0 (length arg)) arg)) + (t nil))) + +(defun wg-is-file-remote (filename) + "Return t if filename starts with \"/ssh:\" or \"/sudo:\"" + (interactive) + (or (wg-string/starts-with filename "/ssh:") + (wg-string/starts-with filename "/sudo:"))) + +;; (wg-is-file-remote "/sudo:/etc/myfile") + +(provide 'workgroups-misc)