From a94959dbe4d073797d6e1263a790f8802419b795 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 15 Jun 2016 21:30:17 -0700 Subject: [PATCH] imalison:join-paths --- dotfiles/emacs.d/README.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 27e6ec01..fdc26371 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -407,6 +407,14 @@ Prefix alternatives is a macro that builds a function that selects one of a coll (setq current-prefix-arg nil) (call-interactively function))) #+END_SRC +** Join paths together as with os.path.join in python +#+BEGIN_SRC emacs-lisp + (defun imalison:join-paths (root &rest dirs) + (let ((result root)) + (cl-loop for dir in dirs do + (setq result (concat (file-name-as-directory result) dir))) + result)) +#+END_SRC ** Other #+BEGIN_SRC emacs-lisp (defun imalison:join-paths (&rest paths)