summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/yoke.el40
1 files changed, 29 insertions, 11 deletions
diff --git a/lisp/yoke.el b/lisp/yoke.el index 46d30d5..1e1bc60 100644 --- a/lisp/yoke.el +++ b/lisp/yoke.el
@@ -46,10 +46,13 @@
46(defvar yoke-buffer "*yoke*" 46(defvar yoke-buffer "*yoke*"
47 "Buffer to use for yoke process output.") 47 "Buffer to use for yoke process output.")
48 48
49(defvar yoke-dirs nil
50 "List of directories managed by `yoke'.")
51
49;;; GET YOKED 52;;; GET YOKED
50 53
51(defmacro yoke (package 54(defmacro yoke (package
52 &rest body) 55 &rest body)
53 "Yoke PACKAGE to work with your Emacs. 56 "Yoke PACKAGE to work with your Emacs.
54Execute BODY afterward. 57Execute BODY afterward.
55 58
@@ -102,20 +105,23 @@ Execute BODY afterward.
102 ;; Get prerequisite packages 105 ;; Get prerequisite packages
103 ,@(cl-loop 106 ,@(cl-loop
104 for (pkg* . yoke-get-args) in depends 107 for (pkg* . yoke-get-args) in depends
105 collect `(or (let ((dir (yoke-get ,@yoke-get-args 108 collect `(or
106 :dir ,(format "%s" pkg*)))) 109 (let ((dir (yoke-get ,@yoke-get-args
107 (and dir 110 :dir ,(format "%s" pkg*))))
108 ,@(if autoload 111 (and dir
109 `((yoke-generate-autoloads ',pkg* dir)) 112 ,@(if autoload
110 '(t)))) 113 `((yoke-generate-autoloads ',pkg* dir))
111 (cl-return-from ,pname 114 '(t))
112 (format "Error fetching prerequiste: %s" 115 (add-to-list 'yoke-dirs dir nil #'string=)))
113 ',pkg*)))) 116 (cl-return-from ,pname
117 (format "Error fetching prerequiste: %s"
118 ',pkg*))))
114 ;; Download the package, generate autoloads 119 ;; Download the package, generate autoloads
115 ,@(when url 120 ,@(when url
116 `((let ((,dirvar (yoke-get ,@url :dir ,(format "%s" pkg)))) 121 `((let ((,dirvar (yoke-get ,@url :dir ,(format "%s" pkg))))
117 ,@(when autoload 122 ,@(when autoload
118 `((yoke-generate-autoloads ',pkg ,dirvar)))))) 123 `((yoke-generate-autoloads ',pkg ,dirvar)))
124 (add-to-list 'yoke-dirs ,dirvar nil #'string=))))
119 ;; Evaluate the body, optionally after the features in `:after' 125 ;; Evaluate the body, optionally after the features in `:after'
120 ,@(cond (after 126 ,@(cond (after
121 `((eval-after ,after ,@body))) 127 `((eval-after ,after ,@body)))
@@ -275,5 +281,17 @@ BODY after Emacs is finished initializing."
275 (group (+ (not space))))) 281 (group (+ (not space)))))
276 1))) 282 1)))
277 283
284(defun yoke-compile ()
285 "Compile all elisp files in `yoke-dirs'."
286 (interactive)
287 (dolist (dir yoke-dirs)
288 (byte-recompile-directory dir 0)))
289
290(defun yoke-remove (dir)
291 (interactive
292 (completing-read "Remove: " yoke-dirs
293 nil :require-match))
294 (delete-file dir :trash))
295
278(provide 'yoke) 296(provide 'yoke)
279;;; yoke.el ends here 297;;; yoke.el ends here