From cc1ab09111f58f52f8c702db932bf67d8d0d9c1d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 26 Oct 2022 22:56:10 -0500 Subject: yoke --- lisp/yoke.el | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/yoke.el b/lisp/yoke.el index 68b02c4..e7a6fe9 100644 --- a/lisp/yoke.el +++ b/lisp/yoke.el @@ -128,7 +128,7 @@ BODY after Emacs is finished initializing." depends ; :depends ((PKG REPO)...) load ; :load DIRECTORY (when t whenp) ; :when PREDICATE - (unless nil unlessp) ; :unless PREDICATE + (unless nil unlessp) ; :unless PREDICATE &allow-other-keys) "Yoke a PKG into your Emacs session." (declare (indent 2)) @@ -137,9 +137,7 @@ BODY after Emacs is finished initializing." :depends :when :unless :after :load))) `(cl-block ,name (condition-case e - (let ((*yoke-name* ',name) - (*yoke-repo* ,repo) - (*yoke-dest* ,(when repo `(yoke-repo-dir ',pkg ,repo)))) + (progn ,@(cond ((and whenp unlessp) `((when (or (not ,when) ,unless) @@ -169,3 +167,18 @@ BODY after Emacs is finished initializing." (+ space) (group (+ (not space))))) 1))) + +(defun yoke-remove (pkg) + "Remove package PKG from `yoke-dir'." + (interactive (list (completing-read "Package: " + (directory-files yoke-dir) + (lambda (f) + (not (or (string= f ".") + (string= f "..")))) + :require-match))) + (let ((dir (expand-file-name pkg yoke-dir))) + (move-file-to-trash dir) + (message "Package `%s' removed." pkg))) + +(provide 'yoke) +;;; yoke.el ends here -- cgit 1.4.1-21-gabe81