[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 457b8f4a5a 3/3: Simplify previous commit
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 457b8f4a5a 3/3: Simplify previous commit |
Date: |
Tue, 23 Jul 2024 10:00:02 -0400 (EDT) |
branch: elpa/helm
commit 457b8f4a5aaef1b8c8376f30cae0dbee32b01978
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Simplify previous commit
---
helm-lib.el | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/helm-lib.el b/helm-lib.el
index 68710a7cd1..31d276b87f 100644
--- a/helm-lib.el
+++ b/helm-lib.el
@@ -1906,10 +1906,7 @@ Take same args as `directory-files'."
else do (push file others)
finally return (if (and others base)
(append (list (directory-file-name base))
- (let ((res (helm-common-dir-1 others)))
- (if (listp res)
- res
- (list res))))
+ (helm-common-dir-1 others))
(list (and base (directory-file-name base))))))
(defun helm-common-dir (files)
@@ -1919,6 +1916,19 @@ common directory is returned."
(let ((result (helm-common-dir-1 files)))
(if (cdr result) result (car result))))
+;; Tests:
+;; (helm-common-dir '("c:/foo" "c:/foo/bar/baz"
+;; "f:/foo" "e:/foo" "f:/foo/bar"
+;; "d:/foo" "d:/foo/bar/baz"
+;; "e:/foo/bar/baz"))
+;; ("c:/foo" "e:/foo" "f:/foo" "d:/foo")
+
+
+;; (helm-common-dir '("/home/you/download/foo/"
+;; "/home/you/download/foo/bar/baz"
+;; "/home/you/tmp/foo"))
+;; "/home/you"
+
;;; helm internals
;;