[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sesman 3df33018f1 089/100: Strip trailing slash in `sesman
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sesman 3df33018f1 089/100: Strip trailing slash in `sesman-expand-path` |
Date: |
Tue, 28 Dec 2021 14:06:05 -0500 (EST) |
branch: elpa/sesman
commit 3df33018f1c42f09db21cebe39a25b389fe35f02
Author: Vitalie Spinu <spinuvit@gmail.com>
Commit: Vitalie Spinu <spinuvit@gmail.com>
Strip trailing slash in `sesman-expand-path`
clojure-emacs/cider#2577
---
sesman-test.el | 6 ++++--
sesman.el | 21 +++++++++++----------
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/sesman-test.el b/sesman-test.el
index 0a0c63c74f..48420cba2b 100644
--- a/sesman-test.el
+++ b/sesman-test.el
@@ -254,9 +254,11 @@
(ert-deftest sesman-symlinked-projects-tests ()
(let* ((dir1 (make-temp-file "1-" 'dir))
(dir2 (make-temp-file "2-" 'dir))
- (dir1-link (format "%s/dir1" dir2 dir1)))
+ (dir1-link (format "%s/dir1" dir2)))
+
;; dir1 link in dir2
- (shell-command (format "ln -s %s %s" dir1 dir1-link))
+ (should (equal (shell-command (format "ln -s %s %s" dir1 dir1-link))
+ 0))
(let ((sesman-follow-symlinks nil)
(vc-follow-symlinks t))
diff --git a/sesman.el b/sesman.el
index 875f2dda73..1ffeed97ee 100644
--- a/sesman.el
+++ b/sesman.el
@@ -926,16 +926,17 @@ buffers."
(defun sesman-expand-path (path)
"Expand PATH with optionally follow symlinks.
Whether symlinks are followed is controlled by `sesman-follow-symlinks' custom
-variable."
- (if sesman-follow-symlinks
- (let ((true-name (or (gethash path sesman--path-cache)
- (puthash path (file-truename path)
sesman--path-cache))))
- (if (or (eq sesman-follow-symlinks t)
- vc-follow-symlinks)
- true-name
- ;; sesman-follow-symlinks is 'vc but vc-follow-symlinks is nil
- (expand-file-name path)))
- (expand-file-name path)))
+variable. Always return the expansion without the trailing directory slash."
+ (directory-file-name
+ (if sesman-follow-symlinks
+ (let ((true-name (or (gethash path sesman--path-cache)
+ (puthash path (file-truename path)
sesman--path-cache))))
+ (if (or (eq sesman-follow-symlinks t)
+ vc-follow-symlinks)
+ true-name
+ ;; sesman-follow-symlinks is 'vc but vc-follow-symlinks is nil
+ (expand-file-name path)))
+ (expand-file-name path))))
;;; Contexts
- [nongnu] elpa/sesman 2a1a9a4ccf 087/100: Promote sesman-expand-path into public API, (continued)
- [nongnu] elpa/sesman 2a1a9a4ccf 087/100: Promote sesman-expand-path into public API, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman e8bfb0e379 091/100: Convert buffers to strings during formatting, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman fe92090cb6 099/100: Reformulate sesman-unlink docs, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 16fb6eca09 016/100: Fix package-lint issues, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman cdb8e0973a 018/100: Port back from CIDER, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman d8f293ff6e 024/100: Fix MELPA badge link, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman ea2e4fa0fe 039/100: Propagate system through `sesman-context`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 47678331da 051/100: New semantics of sesman-session-info generic, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 5a11793697 054/100: Fix tests and checkdoc, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 34521cd5c2 049/100: Fix buffer lookup, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 3df33018f1 089/100: Strip trailing slash in `sesman-expand-path`,
ELPA Syncer <=
- [nongnu] elpa/sesman 163984c60e 059/100: Better handling of overlays and sensor, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 6b0d6e318d 062/100: New UI and API functions sesman-link-with-least-specific and sesman-link-session, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 2b5135c00a 064/100: Version 0.2.1, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 209d9966e5 008/100: Renaming, refactoring ..., ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 665721c52f 066/100: Move context faces to sesman.el and use for info display, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 5a9727ee82 072/100: Expand all paths with file-truename and cache, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 14475d8192 080/100: [Fix #10] Defalias sesman-link-session, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 53efa0a9ca 086/100: Honor sesman-follow-symlinks in path expansion and project lookup, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 04df98807f 070/100: Change font of sesman-buffer-face, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 7fe522431e 068/100: Expand file-name because the backend might not do it, ELPA Syncer, 2021/12/28