Function: flymake-proc--process-filter

flymake-proc--process-filter is a byte-compiled function defined in flymake-proc.el.gz.

Signature

(flymake-proc--process-filter PROC STRING)

Documentation

Parse STRING and collect diagnostics info.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/flymake-proc.el.gz
(defun flymake-proc--process-filter (proc string)
  "Parse STRING and collect diagnostics info."
  (flymake-log 3 "received %d byte(s) of output from process %d"
               (length string) (process-id proc))
  (let ((output-buffer (process-get proc 'flymake-proc--output-buffer)))
    (when (and (buffer-live-p (process-buffer proc))
               output-buffer)
      (with-current-buffer output-buffer
        (let ((moving (= (point) (process-mark proc)))
              (inhibit-read-only t)
              (unprocessed-mark
               (or (process-get proc 'flymake-proc--unprocessed-mark)
                   (set-marker (make-marker) (point-min)))))
          (save-excursion
            ;; Insert the text, advancing the process marker.
            (goto-char (process-mark proc))
            (insert string)
            (set-marker (process-mark proc) (point)))
          (if moving (goto-char (process-mark proc)))

          ;; check for new diagnostics
          ;;
          (save-excursion
            (goto-char unprocessed-mark)
            (dolist (pattern flymake-proc-err-line-patterns)
              (let ((new (flymake-proc--diagnostics-for-pattern proc pattern)))
                (process-put
                 proc
                 'flymake-proc--collected-diagnostics
                 (append new
                         (process-get proc
                                      'flymake-proc--collected-diagnostics)))))
            (process-put proc 'flymake-proc--unprocessed-mark
                         (point-marker))))))))