autoload/packages: more reliable self-parser for doom-read-packages
This commit is contained in:
parent
e342994307
commit
83f4abe100
1 changed files with 7 additions and 5 deletions
|
@ -98,15 +98,17 @@ fed to `doom/packages-delete'."
|
||||||
(unless (symbolp sym)
|
(unless (symbolp sym)
|
||||||
(error "%s is not a valid symbol" sym))
|
(error "%s is not a valid symbol" sym))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents file)
|
(buffer-disable-undo)
|
||||||
|
(emacs-lisp-mode)
|
||||||
|
(insert-file-contents file nil nil nil t)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(let ((regexp (concat "\\(^\\|\\s-\\)(" (symbol-name sym) " "))
|
(let ((regexp (concat "\\(^\\|\\s-\\)(" (symbol-name sym) " "))
|
||||||
sexps)
|
sexps)
|
||||||
(while (re-search-forward regexp nil t)
|
(while (re-search-forward regexp nil t)
|
||||||
(let ((sexp (cdr-safe (save-excursion
|
(unless (nth 4 (syntax-ppss))
|
||||||
|
(save-excursion
|
||||||
(beginning-of-defun)
|
(beginning-of-defun)
|
||||||
(sexp-at-point)))))
|
(push (cdr (sexp-at-point)) sexps))))
|
||||||
(push sexp sexps)))
|
|
||||||
(reverse sexps))))
|
(reverse sexps))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue