Remove smartparens dependency for doom/info

This commit is contained in:
Henrik Lissner 2020-03-03 16:15:43 -05:00
parent 5f98e12b0e
commit f8a69464d0
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -23,17 +23,19 @@
(when (file-exists-p file) (when (file-exists-p file)
(insert-file-contents file)))) (insert-file-contents file))))
(defun doom--collect-forms-in (file form) (defsubst doom--collect-forms-in (file form)
(when (file-readable-p file) (when (file-readable-p file)
(let (forms) (let (forms)
(with-temp-buffer (with-temp-buffer
(insert-file-contents file) (insert-file-contents file)
(delay-mode-hooks (emacs-lisp-mode)) (delay-mode-hooks (emacs-lisp-mode))
(while (re-search-forward (format "(%s " (regexp-quote form)) nil t) (while (re-search-forward (format "(%s " (regexp-quote form)) nil t)
(unless (doom-point-in-string-or-comment-p) (let ((ppss (syntax-ppss)))
(save-excursion (unless (or (nth 4 ppss)
(goto-char (match-beginning 0)) (nth 3 ppss))
(push (sexp-at-point) forms)))) (save-excursion
(goto-char (match-beginning 0))
(push (sexp-at-point) forms)))))
(nreverse forms))))) (nreverse forms)))))
;;;###autoload ;;;###autoload