Function: TeX-error-overview-make-entries

TeX-error-overview-make-entries is a byte-compiled function defined in tex.el.

Signature

(TeX-error-overview-make-entries &optional MASTER-DIR ACTIVE-BUFFER)

Documentation

Generate the list of errors to be printed using tabulated-list-entries.

Write file names relative to MASTER-DIR when they are not absolute.

ACTIVE-BUFFER is used as buffer from which to extract the list of errors. If nil, defaults to TeX-error-overview-active-buffer.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defun TeX-error-overview-make-entries (&optional master-dir active-buffer)
  "Generate the list of errors to be printed using `tabulated-list-entries'.
Write file names relative to MASTER-DIR when they are not absolute.

ACTIVE-BUFFER is used as buffer from which to extract the list of
errors.  If nil, defaults to `TeX-error-overview-active-buffer'."
  (with-current-buffer (or active-buffer TeX-error-overview-active-buffer)
    (let ((id 0)
          type file line msg entries)
      (mapc
       (lambda (entry)
         (setq type (nth 0 entry)
               file (nth 1 entry)
               line (nth 2 entry)
               msg  (nth 3 entry))
         ;; Add the entry only if it isn't to be skipped.
         (unless (TeX-error-list-skip-warning-p type (nth 10 entry))
           (push
            (list
             ;; ID.
             id
             (vector
              ;; File.
              (if (stringp file)
                  (if (file-name-absolute-p file)
                      file
                    (file-relative-name file master-dir))
                "")
              ;; Line.
              (if (numberp line)
                  (number-to-string line)
                "")
              ;; Type.
              (cond
               ((equal type 'error)
                (propertize "Error" 'font-lock-face 'TeX-error-description-error))
               ((equal type 'warning)
                (propertize "Warning" 'font-lock-face
                            'TeX-error-description-warning))
               ((equal type 'bad-box)
                (propertize "Bad box" 'font-lock-face
                            'TeX-error-description-warning))
               (t
                ""))
              ;; Message.
              (list (if (stringp msg)
                        ;; Sometimes, the message can be longer than one line,
                        ;; but print here only the first one.
                        (progn
                          (string-match "^.*" msg)
                          (match-string 0 msg))
                      "")
                    'face 'link
                    'follow-link t
                    'id id
                    'action #'TeX-error-overview-goto-source)))
            entries))
         ;; Increase the `id' counter in any case.
         (setq id (1+ id)))
       TeX-error-list)
      (reverse entries))))