Function: flymake--tabulated-setup

flymake--tabulated-setup is a byte-compiled function defined in flymake.el.gz.

Signature

(flymake--tabulated-setup USE-PROJECT)

Documentation

Helper for flymake-diagnostics-buffer-mode.

And also flymake-project-diagnostics-mode.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/flymake.el.gz
(defun flymake--tabulated-setup (use-project)
  "Helper for `flymake-diagnostics-buffer-mode'.
And also `flymake-project-diagnostics-mode'."
  (setq-local next-error-function #'flymake--diagnostics-next-error)
  (let ((saved-r-b-f revert-buffer-function)
        (refresh
         (lambda ()
           (cond
            (use-project
             (let ((p (project-current)))
               (flymake--tabulated-setup-1
                (flymake--project-diagnostics p)
                (project-root p))))
            (t
             ;; Do nothing if 'flymake--diagnostics-buffer-source' has
             ;; not yet been set to a valid buffer.  This could happen
             ;; when this function is called too early.  For example
             ;; 'global-display-line-numbers-mode' calls us from its
             ;; mode hook, when the diagnostic buffer has just been
             ;; created by 'flymake-show-buffer-diagnostics', but is not
             ;; yet set up properly (Bug#40529).
             (flymake--tabulated-setup-1
              (and (bufferp flymake--diagnostics-buffer-source)
                   (with-current-buffer flymake--diagnostics-buffer-source
                     (and flymake-mode
                          (flymake-diagnostics))))
               nil)))
           (tabulated-list-init-header))))
    (setq revert-buffer-function
          (lambda (&rest args)
            (funcall refresh)
            (apply saved-r-b-f args)))))