1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-30 00:51:50 -08:00
emacs/test/lisp
João Távora f6e909b41e Flymake backends can report multiple times per check
Rewrote a significant part of the Flymake backend API.  Flymake now
ignores the return value of backend functions: a function can either
returns or errors.  If it doesn't error, a backend is no longer
constrained to call REPORT-FN exactly once.  It may do so any number
of times, cumulatively reporting diagnostics.  Flymake keeps track of
outdated REPORT-FN instances and disconsiders obsolete reports.
Backends should avoid reporting obsolete data by cancelling any
ongoing processing at every renewed call to the backend function.

Consolidated flymake.el internal data structures to require less
buffer-local variables.  Adjusted Flymake's mode-line indicator to the
new semantics.

Adapted and simplified the implementation of elisp and legacy
backends, fixing potential race conditions when calling backends in
rapid succession.

Added a new test for a backend that calls REPORT-FN multiple
times.  Simplify test infrastructure.

* lisp/progmodes/flymake-elisp.el (flymake-elisp-checkdoc)
(flymake-elisp-byte-compile): Error instead of returning nil
if not in emacs-lisp-mode.
(flymake-elisp--byte-compile-process): New buffer-local variable.
(flymake-elisp-byte-compile): Mark (and kill) previous process
obsolete process before starting a new one.  Don't report if
obsolete process.

* lisp/progmodes/flymake-proc.el
(flymake-proc--current-process): New buffer-local variable.
(flymake-proc--processes): Remove.
(flymake-proc--process-filter): Don't bind
flymake-proc--report-fn.
(flymake-proc--process-sentinel): Rewrite.  Don't report if
obsolete process.
(flymake-proc-legacy-flymake): Rewrite.  Mark (and kill)
previous process obsolete process before starting a new
one.  Integrate flymake-proc--start-syntax-check-process
helper.
(flymake-proc--start-syntax-check-process): Delete.
(flymake-proc-stop-all-syntax-checks): Don't use
flymake-proc--processes, iterate buffers.
(flymake-proc-compile):

* lisp/progmodes/flymake.el (subr-x): Require it
explicitly.
(flymake-diagnostic-functions): Reword docstring.
(flymake--running-backends, flymake--disabled-backends)
(flymake--diagnostics-table): Delete.
(flymake--backend-state): New buffer-local variable and new defstruct.
(flymake--with-backend-state, flymake--collect)
(flymake-running-backends, flymake-disabled-backends)
(flymake-reporting-backends): New helpers.
(flymake-is-running): Use flymake-running-backends.
(flymake--handle-report): Rewrite.
(flymake-make-report-fn): Ensure REPORT-FN runs in the correct
buffer or not at all.
(flymake--disable-backend, flymake--run-backend): Rewrite.
(flymake-start): Rewrite.
(flymake-mode): Set flymake--backend-state.
(flymake--mode-line-format): Rewrite.

* test/lisp/progmodes/flymake-tests.el
(flymake-tests--wait-for-backends): New helper.
(flymake-tests--call-with-fixture): Use it.
(included-c-header-files): Fix whitespace.
(flymake-tests--diagnose-words): New helper.
(dummy-backends): Rewrite for new semantics.  Use cl-letf.
(flymake-tests--assert-set): Use quote.
(recurrent-backend): New test.
2017-10-03 14:18:55 +01:00
..
calc Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
calendar Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
emacs-lisp Fix slot typecheck in eieio-persistent 2017-09-30 16:28:00 -07:00
emulation Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
erc Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
eshell Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
gnus Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
international Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
mail Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
net ; Spelling fixes 2017-09-29 16:41:50 -07:00
progmodes Flymake backends can report multiple times per check 2017-10-03 14:18:55 +01:00
textmodes Add tests for `css-current-defun-name' 2017-09-28 18:55:06 +02:00
url Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
vc Prefer HTTPS to HTTP for gnu.org 2017-10-01 19:59:01 -07:00
abbrev-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
arc-mode-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
auth-source-pass-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
auth-source-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
autorevert-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
buff-menu-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
char-fold-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
color-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
comint-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dabbrev-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
descr-text-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dired-aux-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dired-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dired-x-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
dom-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
electric-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
epg-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
faces-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ffap-tests.el Prefer HTTPS to HTTP for gnu.org 2017-09-13 15:54:25 -07:00
filenotify-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
files-tests.el Fix new copy-directory bug with empty dirs 2017-09-20 11:50:35 -07:00
files-x-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
help-fns-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
hi-lock-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
htmlfontify-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ibuffer-tests.el Fix 2 testsuite tests for MS-Windows 2017-09-20 10:16:11 +03:00
ido-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
imenu-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
info-xref-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
isearch-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
jit-lock-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
json-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
kmacro-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ls-lisp-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
man-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
md4-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
minibuffer-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
mouse-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
obarray-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ps-print-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
register-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
replace-tests.el Prefer HTTPS to HTTP for gnu.org 2017-10-01 19:59:01 -07:00
rot13-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
ses-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
shell-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
simple-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
sort-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
soundex-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
subr-tests.el Fix gensym 2017-09-18 09:00:45 -04:00
tar-mode-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
thingatpt-tests.el Prefer HTTPS to HTTP for gnu.org 2017-09-13 15:54:25 -07:00
whitespace-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
xdg-tests.el Loosen strict parsing requirement for desktop files 2017-09-25 08:45:08 -04:00
xml-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00
xt-mouse-tests.el Prefer HTTPS to FTP and HTTP in documentation 2017-09-13 15:54:37 -07:00