fix(emacs/lean-util.el): use f-join instead of lean-concat-paths

This commit is contained in:
Soonho Kong 2015-05-26 16:06:39 -04:00
parent ce10d5ca08
commit 1d25f9fa06

View file

@ -10,16 +10,11 @@
(require 'dash) (require 'dash)
(require 'dash-functional) (require 'dash-functional)
(defun lean-concat-paths (&rest seq)
"Concatenate paths"
(cl-reduce (lambda (p1 p2) (concat (file-name-as-directory p1) p2))
seq))
(defun lean-find-file-upward (file-name &optional dir-name) (defun lean-find-file-upward (file-name &optional dir-name)
"Try to find a file in a (current) directory or its parent directories." "Try to find a file in a (current) directory or its parent directories."
(let* ((dir-name (or dir-name (file-name-directory (buffer-file-name)))) (let* ((dir-name (or dir-name (file-name-directory (buffer-file-name))))
(parent-dir-name (file-name-directory (directory-file-name dir-name))) (parent-dir-name (file-name-directory (directory-file-name dir-name)))
(full-name (lean-concat-paths dir-name file-name))) (full-name (f-join dir-name file-name)))
(cond ((file-exists-p full-name) full-name) (cond ((file-exists-p full-name) full-name)
((string= dir-name parent-dir-name) nil) ((string= dir-name parent-dir-name) nil)
(t (lean-find-file-upward file-name parent-dir-name))))) (t (lean-find-file-upward file-name parent-dir-name)))))
@ -45,7 +40,7 @@
(defun lean-get-executable (exe-name) (defun lean-get-executable (exe-name)
"Return fullpath of lean executable" "Return fullpath of lean executable"
(let ((lean-bin-dir-name "bin")) (let ((lean-bin-dir-name "bin"))
(lean-concat-paths (lean-get-rootdir) lean-bin-dir-name exe-name))) (f-full (f-join (lean-get-rootdir) lean-bin-dir-name exe-name))))
(defun lean-path-list () (defun lean-path-list ()
(interactive) (interactive)