From 5f0d1753992e40e8d2ecdefb02456148e02e5f71 Mon Sep 17 00:00:00 2001 From: justbur Date: Thu, 10 Mar 2016 13:18:20 -0500 Subject: [PATCH] counsel.el (counsel-prompt-function-dir): Make portable Use the built-in eshell-split-path to split the directory path into components instead of split-string which is not likely to work on all systems. --- counsel.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/counsel.el b/counsel.el index 62d6c1a4e..49b0440e8 100644 --- a/counsel.el +++ b/counsel.el @@ -33,6 +33,7 @@ (require 'swiper) (require 'etags) +(require 'esh-util) ;;* Utility (defun counsel-more-chars (n) @@ -179,13 +180,11 @@ Update the minibuffer with the amount of lines collected every "Return PROMPT appended with the parent directory." (let ((directory counsel--git-grep-dir)) (format " [%s]: " - (let ((dir-list (split-string directory "/"))) + (let ((dir-list (eshell-split-path directory))) (if (> (length dir-list) 3) - (mapconcat - #'identity - (append '("..") - (cl-subseq dir-list (- (length dir-list) 3))) - "/") + (apply #'concat + (append '("...") + (cl-subseq dir-list (- (length dir-list) 3)))) directory))))) (defun counsel-delete-process () -- 2.39.2