From f0e6ede81baf356244f657f98024d6543f8b625b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 19 May 2020 22:00:20 -0400 Subject: [PATCH] Relax how strict doom/bump-package-at-point is about point This command would formerly work only if the point was on the opening parenthesis, and sometimes insert the :pin in odd places. It is now much more relaxed. --- core/autoload/packages.el | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/core/autoload/packages.el b/core/autoload/packages.el index 82bdd0284..746e10f4b 100644 --- a/core/autoload/packages.el +++ b/core/autoload/packages.el @@ -31,15 +31,10 @@ (save-match-data (save-excursion (and point (goto-char point)) - (if (eq (sexp-at-point) 'package!) - (progn - (backward-sexp) - (backward-char) - t) - (while (and (search-backward "(package!" nil t) - (doom-point-in-string-or-comment-p)))) - (unless (or (doom-point-in-string-or-comment-p) - (not (eq (car-safe (sexp-at-point)) 'package!))) + (while (and (or (atom (sexp-at-point)) + (doom-point-in-string-or-comment-p)) + (search-backward "(" nil t))) + (when (eq (car-safe (sexp-at-point)) 'package!) (cl-destructuring-bind (beg . end) (bounds-of-thing-at-point 'sexp) (let ((package (let (doom-packages)