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.
This commit is contained in:
parent
20f22d5741
commit
f0e6ede81b
1 changed files with 4 additions and 9 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue