aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorJoão Távora2018-06-15 12:17:37 +0100
committerJoão Távora2018-06-15 14:59:42 +0100
commit3e7dff88928b568f8d4126c7fe2251662d140be6 (patch)
treecc16b002a6bf1b4515e6f92f7ac9b2e8a62d2f67 /doc/misc
parentaeb6b2e31fea5d3fa78e2f8a0895dc86f6b4a7a6 (diff)
downloademacs-3e7dff88928b568f8d4126c7fe2251662d140be6.tar.gz
emacs-3e7dff88928b568f8d4126c7fe2251662d140be6.zip
Flymake and backends exchange hints abouts changed regions
* lisp/progmodes/flymake.el (flymake--delete-own-overlays): Accept BEG and END. Rename from flymake-delete-own-overlays. (flymake-diagnostic-functions): Describe :region, :recent-changes in docstring. (flymake--handle-report): Accept REGION. (flymake--run-backend): Accept optional ARGS to pass to backend fn. (flymake--recent-changes): New buffer-local variable. (flymake-start): Call flymake--run-backend with recent changes. (flymake-mode): Initialize flymake--recent-changes. Call flymake--delete-own-overlays. (flymake-after-change-function): Collect recent changes. * doc/misc/flymake.texi (Backend functions): Describe :recent-changes and :region. * etc/NEWS (Flymake): Mention improvements in backend communication.
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/flymake.texi40
1 files changed, 31 insertions, 9 deletions
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index 502d408f2b8..1e7a5e82c61 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -437,18 +437,35 @@ calling convention: one for calls made by Flymake into the backend via
437the backend function, the other in the reverse direction via a 437the backend function, the other in the reverse direction via a
438callback. To be usable, backends must adhere to both. 438callback. To be usable, backends must adhere to both.
439 439
440Backend functions must accept an arbitrary number of arguments: 440The first argument passed to a backend function is always
441@var{report-fn}, a callback function detailed below. Beyond it,
442functions must be prepared to accept (and possibly ignore) an
443arbitrary number of keyword-value pairs of the form
444@w{@code{(@var{:key} @var{value} @var{:key2} @var{value2}...)}}.
445
446Currently, Flymake may pass the following keywords and values to the
447backend function:
441 448
442@itemize 449@itemize
443@item
444the first argument is always @var{report-fn}, a callback function
445detailed below;
446 450
447@item 451@item @code{:recent-changes}
448the remaining arguments are keyword-value pairs of the form 452The value is a list recent changes since the last time the backend
449@w{@code{(@var{:key} @var{value} @var{:key2} @var{value2}...)}}. 453function was called for the buffer. If the list is empty, this
450Currently, Flymake provides no such arguments, but backend functions 454indicates that no changes have been recorded. If it is the first time
451must be prepared to accept (and possibly ignore) any number of them. 455that this backend function is called for this activation of
456@code{flymake-mode}, then this argument isn't provided at all
457(i.e. it's not merely nil).
458
459Each element is in the form (@var{beg} @var{end} @var{text}) where
460@var{beg} and @var{end} are buffer positions, and @var{text} is a
461string containing the text contained between those positions (if any),
462after the change was performed.
463
464@item @code{:changes-start} and @code{:changes-end}
465The value is, repectively, the minimum and maximum buffer positions
466touched by the recent changes. These are provided for convenience and
467only if @code{:recent-changes} is also provided.
468
452@end itemize 469@end itemize
453 470
454Whenever Flymake or the user decide to re-check the buffer, backend 471Whenever Flymake or the user decide to re-check the buffer, backend
@@ -504,6 +521,11 @@ details of the situation encountered, if any.
504@code{:force}, whose value should be a boolean suggesting 521@code{:force}, whose value should be a boolean suggesting
505that Flymake consider the report even if it was somehow 522that Flymake consider the report even if it was somehow
506unexpected. 523unexpected.
524
525@item
526@code{:region}, a cons (@var{beg} . @var{end}) of buffer positions
527indicating that the report applies to that region and that previous
528reports targeting other parts of the buffer remain valid.
507@end itemize 529@end itemize
508 530
509@menu 531@menu