branch: externals/dtache commit 391ff88fa1bdc2a2000f0bb142ff40db950a83dc Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Simplify get working directory function --- dtache.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dtache.el b/dtache.el index 087df01cbc..2ada2599db 100644 --- a/dtache.el +++ b/dtache.el @@ -908,12 +908,11 @@ Optionally make the path LOCAL to host." (defun dtache--get-working-directory () "Return an abreviated working directory path." - (let* ((remote (file-remote-p default-directory)) - (full-home (if remote (expand-file-name remote) (expand-file-name "~"))) - (short-home (if remote (concat remote "~/") "~"))) - (replace-regexp-in-string full-home - short-home - (expand-file-name default-directory)))) + (if-let (remote (file-remote-p default-directory)) + (replace-regexp-in-string (expand-file-name remote) + (concat remote "~/") + (expand-file-name default-directory)) + (abbreviate-file-name default-directory))) (defun dtache--attach-session (session) "Attach to SESSION."