diff options
author | Martin Polden <mpolden@mpolden.no> | 2024-03-04 21:43:42 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2024-03-04 21:43:42 +0100 |
commit | 0ad26684430e4c5e9cab64d324611c46acfc115d (patch) | |
tree | 946f3e72d346cac27a860f0b4b60f4275c2ff3ef | |
parent | 9e8de31ec1d686fb7b0e2cfd09a658e205ea9ea3 (diff) |
tramp: less nth
-rw-r--r-- | lisp/init-tramp.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/init-tramp.el b/lisp/init-tramp.el index 6c3fdcd..dcfa179 100644 --- a/lisp/init-tramp.el +++ b/lisp/init-tramp.el @@ -12,9 +12,9 @@ FILENAME is a local path and prefix it with \"/sudo::\". If doas is available, that method is used instead of sudo." (let* ((parts (split-string filename ":")) - (method (substring (nth 0 parts) 1)) - (host (nth 1 parts)) - (hop-method (when host (nth 1 (split-string host "|")))) + (method (string-trim (car parts) "/")) + (host (car (cdr parts))) + (hop-method (when host (car (cdr (split-string host "|"))))) (sudo-methods '("sudo" "doas"))) (if (or (member method sudo-methods) (member hop-method sudo-methods)) |