about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-10-26 22:56:10 -0500
committerCase Duckworth2022-10-26 22:56:10 -0500
commitcc1ab09111f58f52f8c702db932bf67d8d0d9c1d (patch)
tree03c75030b2fe657f734b95b3eb384d322c8369ab
parentblhe (diff)
downloademacs-cc1ab09111f58f52f8c702db932bf67d8d0d9c1d.tar.gz
emacs-cc1ab09111f58f52f8c702db932bf67d8d0d9c1d.zip
yoke
-rw-r--r--lisp/yoke.el21
1 files changed, 17 insertions, 4 deletions
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."
128 depends ; :depends ((PKG REPO)...) 128 depends ; :depends ((PKG REPO)...)
129 load ; :load DIRECTORY 129 load ; :load DIRECTORY
130 (when t whenp) ; :when PREDICATE 130 (when t whenp) ; :when PREDICATE
131 (unless nil unlessp) ; :unless PREDICATE 131 (unless nil unlessp) ; :unless PREDICATE
132 &allow-other-keys) 132 &allow-other-keys)
133 "Yoke a PKG into your Emacs session." 133 "Yoke a PKG into your Emacs session."
134 (declare (indent 2)) 134 (declare (indent 2))
@@ -137,9 +137,7 @@ BODY after Emacs is finished initializing."
137 :depends :when :unless :after :load))) 137 :depends :when :unless :after :load)))
138 `(cl-block ,name 138 `(cl-block ,name
139 (condition-case e 139 (condition-case e
140 (let ((*yoke-name* ',name) 140 (progn
141 (*yoke-repo* ,repo)
142 (*yoke-dest* ,(when repo `(yoke-repo-dir ',pkg ,repo))))
143 ,@(cond 141 ,@(cond
144 ((and whenp unlessp) 142 ((and whenp unlessp)
145 `((when (or (not ,when) ,unless) 143 `((when (or (not ,when) ,unless)
@@ -169,3 +167,18 @@ BODY after Emacs is finished initializing."
169 (+ space) 167 (+ space)
170 (group (+ (not space))))) 168 (group (+ (not space)))))
171 1))) 169 1)))
170
171(defun yoke-remove (pkg)
172 "Remove package PKG from `yoke-dir'."
173 (interactive (list (completing-read "Package: "
174 (directory-files yoke-dir)
175 (lambda (f)
176 (not (or (string= f ".")
177 (string= f ".."))))
178 :require-match)))
179 (let ((dir (expand-file-name pkg yoke-dir)))
180 (move-file-to-trash dir)
181 (message "Package `%s' removed." pkg)))
182
183(provide 'yoke)
184;;; yoke.el ends here