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

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

[nongnu] elpa/sesman 7fe522431e 068/100: Expand file-name because the ba


From: ELPA Syncer
Subject: [nongnu] elpa/sesman 7fe522431e 068/100: Expand file-name because the backend might not do it
Date: Tue, 28 Dec 2021 14:06:03 -0500 (EST)

branch: elpa/sesman
commit 7fe522431e8b8f283e2285f5d5c1e5de46d76dc3
Author: Vitalie Spinu <spinuvit@gmail.com>
Commit: Vitalie Spinu <spinuvit@gmail.com>

    Expand file-name because the backend might not do it
---
 sesman.el | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/sesman.el b/sesman.el
index 57d01845f9..8437d42b67 100644
--- a/sesman.el
+++ b/sesman.el
@@ -409,11 +409,12 @@ PROJECT defaults to current project. On universal 
argument, or if PROJECT is
 'ask, ask for the project. SESSION defaults to the current session."
   (interactive "P")
   (let* ((system (sesman--system))
-         (project (if (or (eq project 'ask)
-                          (equal project '(4)))
-                      ;; FIXME: should be a completion over all known projects 
for this system
-                      (read-directory-name "Project: " (sesman-project system))
-                    (or project (sesman-project system)))))
+         (project (expand-file-name
+                   (if (or (eq project 'ask)
+                           (equal project '(4)))
+                       ;; FIXME: should be a completion over all known 
projects for this system
+                       (read-directory-name "Project: " (sesman-project 
system))
+                     (or project (sesman-project system))))))
     (sesman--link-session-interactively session 'project project)))
 
  ;;;###autoload
@@ -877,13 +878,15 @@ buffers."
   default-directory)
 (cl-defmethod sesman-context ((_cxt-type (eql project)) system)
   "Return current project."
-  (or
-   (sesman-project (or system (sesman--system)))
-   ;; Normally we would use (project-roots (project-current)) but currently
-   ;; project-roots fails on nil and doesn't work on custom `('foo .
-   ;; "path/to/project"). So, use vc as a fallback and don't use project.el at
-   ;; all for now.
-   (vc-root-dir)))
+  (let ((proj (or
+               (sesman-project (or system (sesman--system)))
+               ;; Normally we would use (project-roots (project-current)) but 
currently
+               ;; project-roots fails on nil and doesn't work on custom `('foo 
.
+               ;; "path/to/project"). So, use vc as a fallback and don't use 
project.el at
+               ;; all for now.
+               (vc-root-dir))))
+    (when proj
+      (expand-file-name proj))))
 
 (cl-defgeneric sesman-relevant-context-p (_cxt-type cxt)
   "Non-nil if context CXT is relevant to current context of type CXT-TYPE.")



reply via email to

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