• João Távora's avatar
    More Flymake cleanup before advancing to backend redesign · b2f8b8b4
    João Távora authored
    Diagnostics are reported for buffers, not necessarily files.  It’s the
    backend’s responsibility to compute the buffer where the diagnostic is
    applicable.  For now, this has to match the buffer where flymake-mode
    is active and which is at the origin of the backend call.
    
    flymake.el knows nothing about line/column diagnostics (except for
    backward-compatible flymake-ler-make-ler, which must yet be tested).
    It’s also the backend’s reponsibility to compute a BEG and END
    positions for the diagnostic in the relevant buffer.
    
    * lisp/progmodes/flymake-proc.el
    (flymake-proc--diagnostics-for-pattern): Convert LINE/COL to
    region here.  Check file buffer here.
    (flymake-proc--process-sentinel): Don’t kill output buffer if
    high enough log level.
    
    * lisp/progmodes/flymake.el (flymake-diag-region): Make this a utility
    function.  (flymake--highlight-line): Diagnostic has region now.
    (flymake-popup-current-error-menu): Don’t add file and line numbers to
    already this silly menu.  (flymake--fix-line-numbers): Remove.
    (flymake-report): No need to fix diagnostics here.
    b2f8b8b4
flymake.el 23.1 KB