Function: elint-scan-doc-file

elint-scan-doc-file is a byte-compiled function defined in elint.el.gz.

Signature

(elint-scan-doc-file)

Documentation

Scan the DOC file for function and variables.

Marks the function with their arguments, and returns a list of variables.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/elint.el.gz
;; This includes all the built-in and dumped things with documentation.
(defun elint-scan-doc-file ()
  "Scan the DOC file for function and variables.
Marks the function with their arguments, and returns a list of variables."
  ;; Cribbed from help-fns.el.
  (let ((docbuf " *DOC*")
	vars sym args)
    (save-excursion
      (if (get-buffer docbuf)
	  (progn
	    (set-buffer docbuf)
	    (goto-char (point-min)))
	(set-buffer (get-buffer-create docbuf))
	(insert-file-contents-literally
	 (expand-file-name internal-doc-file-name doc-directory)))
      (while (re-search-forward "\^_\\([VF]\\)" nil t)
	(when (setq sym (intern-soft (buffer-substring (point)
						       (line-end-position))))
	  (if (string-equal (match-string 1) "V")
	      ;; Excludes platform-specific stuff not relevant to the
	      ;; running platform.
	      (if (boundp sym) (setq vars (cons sym vars)))
	    ;; Function.
	    (when (fboundp sym)
	      (when (re-search-forward "\\(^(fn.*)\\)?\^_" nil t)
		(backward-char 1)
		;; FIXME distinguish no args from not found.
		(and (setq args (match-string 1))
		     (setq args
			   (ignore-errors
			     (read
			      (replace-regexp-in-string "^(fn ?" "(" args))))
		     (elint-put-function-args sym args))))))))
    vars))