Function: comp--accept-and-process-async-output

comp--accept-and-process-async-output is a byte-compiled function defined in comp-run.el.gz.

Signature

(comp--accept-and-process-async-output PROCESS)

Documentation

Accept PROCESS output and check for diagnostic messages.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/comp-run.el.gz
(defun comp--accept-and-process-async-output (process)
  "Accept PROCESS output and check for diagnostic messages."
  (if native-comp-async-report-warnings-errors
      (let ((warning-suppress-types
             (if (eq native-comp-async-report-warnings-errors 'silent)
                 (cons '(native-compiler) warning-suppress-types)
               warning-suppress-types))
            (regexp (if (eq native-comp-async-warnings-errors-kind 'all)
                        "^.*?\\(?:Error\\|Warning\\): .*$"
                      (rx bol
                          (*? nonl)
                          (or
                           (seq "Error: " (*? nonl))
                           (seq "Warning: the function ‘" (1+ (not "’"))
                                "’ is not known to be defined."))
                          eol))))
        (with-current-buffer (process-buffer process)
          (save-excursion
            (accept-process-output process)
            (goto-char (or comp-last-scanned-async-output (point-min)))
            (while (re-search-forward regexp nil t)
              (display-warning 'native-compiler (match-string 0)))
            (setq comp-last-scanned-async-output (point-max)))))
    (accept-process-output process)))