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)
|
||||
(error "%s is not a valid symbol" sym))
|
||||
(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))
|
||||
(let ((regexp (concat "\\(^\\|\\s-\\)(" (symbol-name sym) " "))
|
||||
sexps)
|
||||
(while (re-search-forward regexp nil t)
|
||||
(let ((sexp (cdr-safe (save-excursion
|
||||
(unless (nth 4 (syntax-ppss))
|
||||
(save-excursion
|
||||
(beginning-of-defun)
|
||||
(sexp-at-point)))))
|
||||
(push sexp sexps)))
|
||||
(push (cdr (sexp-at-point)) sexps))))
|
||||
(reverse sexps))))
|
||||
|
||||
;;;###autoload
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue