Function: compilation--ensure-parse

compilation--ensure-parse is a byte-compiled function defined in compile.el.gz.

Signature

(compilation--ensure-parse LIMIT)

Documentation

Make sure the text has been parsed up to LIMIT.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/compile.el.gz
(defun compilation--ensure-parse (limit)
  "Make sure the text has been parsed up to LIMIT."
  (save-excursion
    (goto-char limit)
    (setq limit (line-beginning-position 2))
    (unless (markerp compilation--parsed)
      ;; We use a marker for compilation--parsed so that users (such as
      ;; grep.el) don't need to flush-parse when they modify the buffer
      ;; in a way that impacts buffer positions but does not require
      ;; re-parsing.
      (setq compilation--parsed
            (set-marker (make-marker)
                        (save-excursion
                          (goto-char (point-min))
                          (text-property-search-forward 'compilation-header-end)
                          ;; If we have no end marker, this will be
                          ;; `point-min' still.
                          (point)))))
    (when (< compilation--parsed limit)
      (let ((start (max compilation--parsed (point-min))))
        (move-marker compilation--parsed limit)
        (goto-char start)
        (forward-line 0)  ;Not line-beginning-position: ignore (comint) fields.
        (while (and (not (bobp))
                    (get-text-property (1- (point)) 'compilation-multiline))
          (forward-line -1))
        (with-silent-modifications
          (compilation--parse-region (point) compilation--parsed)))))
  nil)