aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Rankin <william@bydasein.com>2020-10-12 15:58:44 +1000
committerWilliam Rankin <william@bydasein.com>2020-10-12 15:58:44 +1000
commit3cfa5e1294654ad6781edb5757d6c93c26b47f69 (patch)
tree9c1e1d76887ab7894d4c72ec1c1551fccb81d67b
parent6948c1b0c15a4d0171e347559ced760cb7ebf940 (diff)
downloadbinder-3cfa5e1294654ad6781edb5757d6c93c26b47f69.zip
Use fun file-relative-name for binder-file-relative-to-root
-rw-r--r--binder.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/binder.el b/binder.el
index 11e1c3d..d316344 100644
--- a/binder.el
+++ b/binder.el
@@ -508,10 +508,9 @@ With optional argument FILTER, call `binder-filter' on data."
(binder-init))))))
(defun binder-file-relative-to-root (filepath)
- "Return FILEPATH relative to binder root directory."
- (let ((dir (expand-file-name (or binder-project-directory ""))))
- (unless (string-suffix-p "/" dir) (setq dir (concat dir "/")))
- (string-remove-prefix dir (expand-file-name filepath))))
+ "Return FILEPATH relative to `binder-project-directory'."
+ (file-relative-name (or filepath default-directory)
+ binder-project-directory))
(defun binder-get-item (fileid)
"Return project item association list for FILEID."