Function: elint-get-top-forms
elint-get-top-forms is a byte-compiled function defined in
elint.el.gz.
Signature
(elint-get-top-forms)
Documentation
Collect all the top forms in the current buffer.
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/elint.el.gz
(defun elint-get-top-forms ()
"Collect all the top forms in the current buffer."
(save-excursion
(let (tops)
(goto-char (point-min))
(while (elint-find-next-top-form)
(let ((elint-current-pos (point)))
;; non-list check could be here too. errors may be out of seq.
;; quoted check cannot be elsewhere, since quotes skipped.
(if (= (preceding-char) ?\')
;; Eg cust-print.el uses ' as a comment syntax.
(elint-warning "Skipping quoted form `%c%.20s...'" ?\'
(read (current-buffer)))
(condition-case nil
(setq tops (cons
(elint-make-top-form (read (current-buffer))
elint-current-pos)
tops))
(end-of-file
(goto-char elint-current-pos)
(error "Missing `)' in top form: %s"
(buffer-substring elint-current-pos
(line-end-position))))))))
(nreverse tops))))