From 011ef2e8a33cd76efc291e41aef13f443daa2cb2 Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Sun, 29 Sep 2019 08:28:29 -0500 Subject: [PATCH] Added library root parameter to functions --- python-conf.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python-conf.el b/python-conf.el index b45c2f3..d2cc5dc 100644 --- a/python-conf.el +++ b/python-conf.el @@ -1,6 +1,3 @@ -;; This buffer is for text that is not saved, and for Lisp evaluation. -;; To create a file, visit it with C-x C-f and enter text in its buffer. - (defun rlbr/get-venv-name (&optional library-root) "Generate venv name based off of the base-name of the library root" (file-name-base @@ -22,11 +19,14 @@ (setcar venv-partition-name (1+ (apply 'max (mapcar #'car venv-conflicts))))) (rlbr/join-venv-with-number venv-partition-name))) -(defun rlbr/setup-python-venv-dirlocals () +(defun rlbr/setup-python-venv-dirlocals (&optional library-root) "Setup .dir-locals file in library root and tell vc system to ignore .dir-locals file" - ) + (let (library-root (if library-root + library-root + (elpy-library-root))) + )) -(defun rlbr/init-python-venv-in-library-root () +(defun rlbr/init-python-venv-in-library-root (&optional library-root) "If no venv is specified in the library root .dir-locals file, prompt to either create one or use default" (let ((venv-name (rlbr/get-venv-name))) (setq venv-name (rlbr/handle-name-conflicts venv-name))