emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dtache 391ff88fa1 3/4: Simplify get working directory f


From: ELPA Syncer
Subject: [elpa] externals/dtache 391ff88fa1 3/4: Simplify get working directory function
Date: Thu, 20 Jan 2022 11:57:42 -0500 (EST)

branch: externals/dtache
commit 391ff88fa1bdc2a2000f0bb142ff40db950a83dc
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]