Function: elisp-refs--read-all-buffer-forms

elisp-refs--read-all-buffer-forms is a byte-compiled function defined in elisp-refs.el.

Signature

(elisp-refs--read-all-buffer-forms BUFFER SYMBOLS-WITH-POS)

Documentation

Read all the forms in BUFFER, along with their positions.

Source Code

;; Defined in ~/.emacs.d/elpa/elisp-refs-20230920.201/elisp-refs.el
(defun elisp-refs--read-all-buffer-forms (buffer symbols-with-pos)
  "Read all the forms in BUFFER, along with their positions."
  (with-current-buffer buffer
    (goto-char (point-min))
    (let ((forms nil))
      (condition-case err
          (while t
            (push (elisp-refs--read-buffer-form symbols-with-pos) forms))
        (error
         (if (or (equal (car err) 'end-of-file)
                 ;; TODO: this shouldn't occur in valid elisp files,
                 ;; but it's happening in helm-utils.el.
                 (equal (car err) 'scan-error))
             ;; Reached end of file, we're done.
             (nreverse forms)
           ;; Some unexpected error, propagate.
           (error "Unexpected error whilst reading %s position %s: %s"
                  (abbreviate-file-name elisp-refs--path) (point) err)))))))