From 259363fd4f21d796c3c6a35be6398aed3f493a73 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 3 Jan 2023 23:02:26 -0600 Subject: bleh --- lisp/yoke.el | 111 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 57 insertions(+), 54 deletions(-) (limited to 'lisp/yoke.el') diff --git a/lisp/yoke.el b/lisp/yoke.el index f9c4d49..8ca94fd 100644 --- a/lisp/yoke.el +++ b/lisp/yoke.el @@ -84,60 +84,63 @@ Execute BODY afterward. append (list this next) into ret finally return (cond ((eq (car (last ret)) nil) (butlast ret)) - (:else ret))))) - `(cl-block ,pname - (condition-case err - (progn - ;; Pass `:when' or `:unless' clauses - ,@(cond - ((and whenp unlessp) - `((when (or (not ,when) ,unless) - (cl-return-from ,pname - (format "%s (abort) :when %S :unless %S" - ',pname ',when ',unless))))) - (whenp - `((unless ,when (cl-return-from ,pname - (format "%s (abort) :when %S" - ',pname ',when))))) - (unlessp - `((when ,unless (cl-return-from ,pname - (format "%s (abort) :unless %S" - ',pname ',unless)))))) - ;; Evaluate `:pre' forms - ,@pre - ;; Get prerequisite packages - ,@(cl-loop - for (pkg* . yoke-get-args) in depends - collect `(or - (let* ((pkg-spec (yoke-get ,@yoke-get-args - :dir ,(format "%s" pkg*))) - (dir (expand-file-name (or (plist-get (cdr pkg-spec) :load) - "") - (car pkg-spec)))) - (and dir - ,@(if autoload - `((yoke-generate-autoloads ',pkg* dir)) - '(t)) - (add-to-list 'yoke-dirs dir nil #'string=))) - (cl-return-from ,pname - (format "Error fetching prerequiste: %s" - ',pkg*)))) - ;; Download the package, generate autoloads - ,@(when url - `((let* ((pkg-spec (yoke-get ,@url :dir ,(format "%s" pkg))) - (,dirvar (expand-file-name (or (plist-get (cdr pkg-spec) :load) - "") - (car pkg-spec)))) - ,@(when autoload - `((yoke-generate-autoloads ',pkg ,dirvar))) - (add-to-list 'yoke-dirs ,dirvar nil #'string=)))) - ;; Evaluate the body, optionally after the features in `:after' - ,@(cond (after - `((yoke-eval-after ,after ,@body))) - (:else body))) - (:success ',package) - (t (message "%s: %s (%s)" ',pname (car err) (cdr err)) - nil))))) + (:else ret)))) + (r (gensym))) + `(let ((,r (cl-block ,pname +(condition-case err + (progn + ;; Pass `:when' or `:unless' clauses + ,@(cond + ((and whenp unlessp) + `((when (or (not ,when) ,unless) + (cl-return-from ,pname + (format "%s (abort) :when %S :unless %S" + ',pname ',when ',unless))))) + (whenp + `((unless ,when (cl-return-from ,pname + (format "%s (abort) :when %S" + ',pname ',when))))) + (unlessp + `((when ,unless (cl-return-from ,pname + (format "%s (abort) :unless %S" + ',pname ',unless)))))) + ;; Evaluate `:pre' forms + ,@pre + ;; Get prerequisite packages + ,@(cl-loop + for (pkg* . yoke-get-args) in depends + collect `(or + (let* ((pkg-spec (yoke-get ,@yoke-get-args + :dir ,(format "%s" pkg*))) + (dir (expand-file-name (or (plist-get (cdr pkg-spec) :load) + "") + (car pkg-spec)))) + (and dir + ,@(if autoload + `((yoke-generate-autoloads ',pkg* dir)) + '(t)) + (add-to-list 'yoke-dirs dir nil #'string=))) + (cl-return-from ,pname + (format "Error fetching prerequiste: %s" + ',pkg*)))) + ;; Download the package, generate autoloads + ,@(when url + `((let* ((pkg-spec (yoke-get ,@url :dir ,(format "%s" pkg))) + (,dirvar (expand-file-name (or (plist-get (cdr pkg-spec) :load) + "") + (car pkg-spec)))) + ,@(when autoload + `((yoke-generate-autoloads ',pkg ,dirvar))) + (add-to-list 'yoke-dirs ,dirvar nil #'string=)))) + ;; Evaluate the body, optionally after the features in `:after' + ,@(cond (after + `((yoke-eval-after ,after ,@body))) + (:else body))) + (:success ',package) + (t (message "%s: %s (%s)" ',pname (car err) (cdr err)) + nil))))) + (when (stringp ,r) (message "%S" ,r)) + ,r))) (defun yoke-get (url &rest args) "\"Get\" URL and and put it in DIR, then add DIR to `load-path'. -- cgit 1.4.1-21-gabe81