mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
autoload/packages: more reliable self-parser for doom-read-packages
This commit is contained in:
@ -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))
|
||||||
(beginning-of-defun)
|
(save-excursion
|
||||||
(sexp-at-point)))))
|
(beginning-of-defun)
|
||||||
(push sexp sexps)))
|
(push (cdr (sexp-at-point)) sexps))))
|
||||||
(reverse sexps))))
|
(reverse sexps))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
Reference in New Issue
Block a user