Emit error on update-pinned-package if not in a package! call

This commit is contained in:
Henrik Lissner 2020-01-15 00:48:57 -05:00
parent d866592beb
commit 2fd7ede0d8
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -211,9 +211,11 @@ Grabs the latest commit id of the package using 'git'."
;; REVIEW Better error handling
;; TODO Insert a new `package!' if no `package!' at poin
(ignore-errors
(while (atom (sexp-at-point))
(while (and (atom (sexp-at-point))
(not (bolp)))
(forward-sexp -1)))
(when (eq (sexp-at-point) 'package!)
(if (not (eq (sexp-at-point) 'package!))
(user-error "Not on a `package!' call")
(backward-char)
(let* ((recipe (cdr (sexp-at-point)))
(name (car recipe))