emacs/lisp/progmodes/flymake.el

1393 lines
57 KiB
EmacsLisp
Raw Normal View History

;;; flymake.el --- A universal on-the-fly syntax checker -*- lexical-binding: t; -*-
2004-05-29 12:55:24 +00:00
;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
2004-05-29 12:55:24 +00:00
;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
;; Maintainer: João Távora <joaotavora@gmail.com>
;; Version: 1.0.8
;; Package-Requires: ((emacs "26.1"))
2004-05-29 12:55:24 +00:00
;; Keywords: c languages tools
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
2004-05-29 12:55:24 +00:00
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
2004-05-29 12:55:24 +00:00
;; GNU Emacs is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
2004-05-29 12:55:24 +00:00
;; You should have received a copy of the GNU General Public License
2017-10-14 19:18:37 -07:00
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
2004-05-29 12:55:24 +00:00
;;; Commentary:
;;
;; Flymake is a minor Emacs mode performing on-the-fly syntax checks.
;;
;; Flymake collects diagnostic information for multiple sources,
;; called backends, and visually annotates the relevant portions in
;; the buffer.
;;
;; This file contains the UI for displaying and interacting with the
;; results produced by these backends, as well as entry points for
;; backends to hook on to.
;;
;; The main interactive entry point is the `flymake-mode' minor mode,
;; which periodically and automatically initiates checks as the user
;; is editing the buffer. The variables `flymake-no-changes-timeout',
;; `flymake-start-on-flymake-mode' give finer control over the events
;; triggering a check, as does the interactive command `flymake-start',
;; which immediately starts a check.
;;
;; Shortly after each check, a summary of collected diagnostics should
;; appear in the mode-line. If it doesn't, there might not be a
;; suitable Flymake backend for the current buffer's major mode, in
;; which case Flymake will indicate this in the mode-line. The
;; indicator will be `!' (exclamation mark), if all the configured
;; backends errored (or decided to disable themselves) and `?'
;; (question mark) if no backends were even configured.
;;
;; For programmers interested in writing a new Flymake backend, the
;; docstring of `flymake-diagnostic-functions', the Flymake manual,
;; and the code of existing backends are probably a good starting
;; point.
;;
;; The user wishing to customize the appearance of error types should
;; set properties on the symbols associated with each diagnostic type.
;; The standard diagnostic symbols are `:error', `:warning' and
;; `:note' (though a specific backend may define and use more). The
;; following properties can be set:
;;
;; * `flymake-bitmap', an image displayed in the fringe according to
;; `flymake-fringe-indicator-position'. The value actually follows
;; the syntax of `flymake-error-bitmap' (which see). It is overridden
;; by any `before-string' overlay property.
;;
;; * `flymake-severity', a non-negative integer specifying the
;; diagnostic's severity. The higher, the more serious. If the
;; overlay property `priority' is not specified, `severity' is used to
;; set it and help sort overlapping overlays.
;;
;; * `flymake-overlay-control', an alist ((OVPROP . VALUE) ...) of
;; further properties used to affect the appearance of Flymake
;; annotations. With the exception of `category' and `evaporate',
;; these properties are applied directly to the created overlay. See
;; Info Node `(elisp)Overlay Properties'.
;;
;; * `flymake-category', a symbol whose property list is considered a
;; default for missing values of any other properties. This is useful
;; to backend authors when creating new diagnostic types that differ
;; from an existing type by only a few properties. The category
;; symbols `flymake-error', `flymake-warning' and `flymake-note' make
;; good candidates for values of this property.
;;
;; For instance, to omit the fringe bitmap displayed for the standard
;; `:note' type, set its `flymake-bitmap' property to nil:
;;
;; (put :note 'flymake-bitmap nil)
;;
;; To change the face for `:note' type, add a `face' entry to its
;; `flymake-overlay-control' property.
;;
;; (push '(face . highlight) (get :note 'flymake-overlay-control))
;;
;; If you push another alist entry in front, it overrides the previous
;; one. So this effectively removes the face from `:note'
;; diagnostics.
;;
;; (push '(face . nil) (get :note 'flymake-overlay-control))
;;
;; To erase customizations and go back to the original look for
;; `:note' types:
;;
;; (cl-remf (symbol-plist :note) 'flymake-overlay-control)
;; (cl-remf (symbol-plist :note) 'flymake-bitmap)
;;
2004-05-29 12:55:24 +00:00
;;; Code:
(require 'cl-lib)
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(require 'thingatpt) ; end-of-thing
(require 'warnings) ; warning-numeric-level, display-warning
(require 'compile) ; for some faces
;; We need the next require to avoid compiler warnings and run-time
;; errors about mouse-wheel-up/down-event in builds --without-x, where
;; mwheel is not preloaded.
(require 'mwheel)
;; when-let*, if-let*, hash-table-keys, hash-table-values:
(eval-when-compile (require 'subr-x))
(defgroup flymake nil
"Universal on-the-fly syntax checker."
:version "23.1"
:link '(custom-manual "(flymake) Top")
:group 'tools)
(defcustom flymake-error-bitmap '(flymake-double-exclamation-mark
compilation-error)
"Bitmap (a symbol) used in the fringe for indicating errors.
The value may also be a list of two elements where the second
element specifies the face for the bitmap. For possible bitmap
symbols, see `fringe-bitmaps'. See also `flymake-warning-bitmap'.
The option `flymake-fringe-indicator-position' controls how and where
this is used."
:version "24.3"
:type '(choice (symbol :tag "Bitmap")
(list :tag "Bitmap and face"
(symbol :tag "Bitmap")
(face :tag "Face"))))
(defcustom flymake-warning-bitmap '(exclamation-mark compilation-warning)
"Bitmap (a symbol) used in the fringe for indicating warnings.
The value may also be a list of two elements where the second
element specifies the face for the bitmap. For possible bitmap
symbols, see `fringe-bitmaps'. See also `flymake-error-bitmap'.
The option `flymake-fringe-indicator-position' controls how and where
this is used."
:version "24.3"
:type '(choice (symbol :tag "Bitmap")
(list :tag "Bitmap and face"
(symbol :tag "Bitmap")
(face :tag "Face"))))
(defcustom flymake-note-bitmap '(exclamation-mark compilation-info)
"Bitmap (a symbol) used in the fringe for indicating info notes.
The value may also be a list of two elements where the second
element specifies the face for the bitmap. For possible bitmap
symbols, see `fringe-bitmaps'. See also `flymake-error-bitmap'.
The option `flymake-fringe-indicator-position' controls how and where
this is used."
:version "26.1"
:type '(choice (symbol :tag "Bitmap")
(list :tag "Bitmap and face"
(symbol :tag "Bitmap")
(face :tag "Face"))))
(defcustom flymake-fringe-indicator-position 'left-fringe
"The position to put Flymake fringe indicator.
The value can be nil (do not use indicators), `left-fringe' or `right-fringe'.
See `flymake-error-bitmap' and `flymake-warning-bitmap'."
:version "24.3"
:type '(choice (const left-fringe)
(const right-fringe)
(const :tag "No fringe indicators" nil)))
(make-obsolete-variable 'flymake-start-syntax-check-on-newline
"can check on newline in post-self-insert-hook"
"27.1")
(defcustom flymake-no-changes-timeout 0.5
"Time to wait after last change before automatically checking buffer.
If nil, never start checking buffer automatically like this."
:type '(choice (number :tag "Timeout in seconds")
(const :tag "No check on timeout" nil)))
(defcustom flymake-gui-warnings-enabled t
"Enables/disables GUI warnings."
:type 'boolean)
(make-obsolete-variable 'flymake-gui-warnings-enabled
"it no longer has any effect." "26.1")
(define-obsolete-variable-alias 'flymake-start-syntax-check-on-find-file
'flymake-start-on-flymake-mode "26.1")
(defcustom flymake-start-on-flymake-mode t
"If non-nil, start syntax check when `flymake-mode' is enabled.
Specifically, start it when the buffer is actually displayed."
:version "26.1"
:type 'boolean)
(defcustom flymake-start-on-save-buffer t
"If non-nil, start syntax check when a buffer is saved.
Specifically, start it when the saved buffer is actually displayed."
:version "27.1"
:type 'boolean)
(defcustom flymake-log-level -1
"Obsolete and ignored variable."
:type 'integer)
(make-obsolete-variable 'flymake-log-level
"it is superseded by `warning-minimum-log-level.'"
"26.1")
(defcustom flymake-wrap-around t
"If non-nil, moving to errors wraps around buffer boundaries."
:version "26.1"
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
:type 'boolean)
(defcustom flymake-suppress-zero-counters :warning
"Control appearance of zero-valued diagnostic counters in mode line.
If set to t, supress all zero counters. If set to a severity
symbol like `:warning' (the default) suppress zero counters less
severe than that severity, according to `warning-numeric-level'.
If set to nil, don't supress any zero counters."
:type 'symbol)
(when (fboundp 'define-fringe-bitmap)
(define-fringe-bitmap 'flymake-double-exclamation-mark
(vector #b00000000
#b00000000
#b00000000
#b00000000
#b01100110
#b01100110
#b01100110
#b01100110
#b01100110
#b01100110
#b01100110
#b01100110
#b00000000
#b01100110
#b00000000
#b00000000
#b00000000)))
(defvar-local flymake-timer nil
"Timer for starting syntax check.")
(defvar-local flymake-check-start-time nil
"Time at which syntax check was started.")
(defun flymake--log-1 (level sublog msg &rest args)
"Do actual work for `flymake-log'."
(let (;; never popup the log buffer
(warning-minimum-level :emergency)
(warning-type-format
(format " [%s %s]"
(or sublog 'flymake)
(current-buffer))))
(display-warning (list 'flymake sublog)
(apply #'format-message msg args)
(if (numberp level)
(or (nth level
'(:emergency :error :warning :debug :debug) )
:error)
level)
"*Flymake log*")))
(defun flymake-switch-to-log-buffer ()
"Go to the *Flymake log* buffer."
(interactive)
(switch-to-buffer "*Flymake log*"))
;;;###autoload
(defmacro flymake-log (level msg &rest args)
"Log, at level LEVEL, the message MSG formatted with ARGS.
LEVEL is passed to `display-warning', which is used to display
the warning. If this form is included in a byte-compiled file,
the generated warning contains an indication of the file that
generated it."
(let* ((compile-file (and (boundp 'byte-compile-current-file)
(symbol-value 'byte-compile-current-file)))
(sublog (if (and
compile-file
(not load-file-name))
(intern
(file-name-nondirectory
(file-name-sans-extension compile-file))))))
`(flymake--log-1 ,level ',sublog ,msg ,@args)))
(defun flymake-error (text &rest args)
"Format TEXT with ARGS and signal an error for Flymake."
(let ((msg (apply #'format-message text args)))
(flymake-log :error msg)
(error (concat "[Flymake] " msg))))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(cl-defstruct (flymake--diag
(:constructor flymake--diag-make))
buffer beg end type text backend data overlay-properties overlay)
;;;###autoload
(defun flymake-make-diagnostic (buffer
beg
end
type
text
&optional data
overlay-properties)
"Make a Flymake diagnostic for BUFFER's region from BEG to END.
TYPE is a key to symbol and TEXT is a description of the problem
detected in this region. DATA is any object that the caller
wishes to attach to the created diagnostic for later retrieval.
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
OVERLAY-PROPERTIES is an alist of properties attached to the
created diagnostic, overriding the default properties and any
properties of `flymake-overlay-control' of the diagnostic's
type."
(flymake--diag-make :buffer buffer :beg beg :end end
:type type :text text :data data
:overlay-properties overlay-properties))
;;;###autoload
(defun flymake-diagnostics (&optional beg end)
"Get Flymake diagnostics in region determined by BEG and END.
If neither BEG or END is supplied, use the whole buffer,
otherwise if BEG is non-nil and END is nil, consider only
diagnostics at BEG."
(mapcar (lambda (ov) (overlay-get ov 'flymake-diagnostic))
(flymake--overlays :beg beg :end end)))
(defmacro flymake--diag-accessor (public internal thing)
"Make PUBLIC an alias for INTERNAL, add doc using THING."
`(defsubst ,public (diag)
,(format "Get Flymake diagnostic DIAG's %s." (symbol-name thing))
(,internal diag)))
(flymake--diag-accessor flymake-diagnostic-buffer flymake--diag-buffer buffer)
(flymake--diag-accessor flymake-diagnostic-text flymake--diag-text text)
(flymake--diag-accessor flymake-diagnostic-type flymake--diag-type type)
(flymake--diag-accessor flymake-diagnostic-backend flymake--diag-backend backend)
(flymake--diag-accessor flymake-diagnostic-data flymake--diag-data backend)
(defun flymake-diagnostic-beg (diag)
"Get Flymake diagnostic DIAG's start position."
(overlay-start (flymake--diag-overlay diag)))
(defun flymake-diagnostic-end (diag)
"Get Flymake diagnostic DIAG's end position."
(overlay-end (flymake--diag-overlay diag)))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(cl-defun flymake--overlays (&key beg end filter compare key)
"Get flymake-related overlays.
If BEG is non-nil and END is nil, consider only `overlays-at'
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
BEG. Otherwise consider `overlays-in' the region comprised by BEG
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
and END, defaulting to the whole buffer. Remove all that do not
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
verify FILTER, a function, and sort them by COMPARE (using KEY)."
(save-restriction
(widen)
(let ((ovs (cl-remove-if-not
(lambda (ov)
(and (overlay-get ov 'flymake-diagnostic)
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
(or (not filter)
(funcall filter ov))))
(if (and beg (null end))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(overlays-at beg t)
(overlays-in (or beg (point-min))
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
(or end (point-max)))))))
(if compare
(cl-sort ovs compare :key (or key
#'identity))
ovs))))
Flymake diagnostics now apply to arbitrary buffer regions Make Flymake UI some 150 lines lighter Strip away much of the original implementation's complexity in manipulating objects representing diagnostics as well as creating and navigating overlays. Lay some groundwork for a more flexible approach that allows for different classes of diagnostics, not necessarily line-based. Importantly, one overlay per diagnostic is created, whereas the original implementation had one per line, and on it it concatenated the results of errors and warnings. This means that currently, an error and warning on the same line are problematic and the warning might be overlooked but this will soon be fixed by setting appropriate priorities. Since diagnostics can highlight arbitrary regions, not just lines, the faces were renamed. Tests pass and backward compatibility with interactive functions is maintained, but probably any third-party extension or customization relying on more than a trivial set of flymake.el internals has stopped working. * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make constructor syntax. * lisp/progmodes/flymake.el (flymake-ins-after) (flymake-set-at, flymake-er-make-er, flymake-er-get-line) (flymake-er-get-line-err-info-list, flymake-ler-set-file) (flymake-ler-set-full-file, flymake-ler-set-line) (flymake-get-line-err-count, flymake-get-err-count) (flymake-highlight-err-lines, flymake-overlay-p) (flymake-make-overlay, flymake-region-has-flymake-overlays) (flymake-find-err-info) (flymake-line-err-info-is-less-or-equal) (flymake-add-line-err-info, flymake-add-err-info) (flymake-get-first-err-line-no) (flymake-get-last-err-line-no, flymake-get-next-err-line-no) (flymake-get-prev-err-line-no, flymake-skip-whitespace) (flymake-goto-line, flymake-goto-next-error) (flymake-goto-prev-error, flymake-patch-err-text): Delete functions no longer used. (flymake-goto-next-error, flymake-goto-prev-error): Rewrite. (flymake-report): Rewrite. (flymake-popup-current-error-menu): Rewrite. (flymake--highlight-line): Rename from flymake-highlight-line. Call `flymake--place-overlay. (flymake--place-overlay): New function. (flymake-ler-errorp): New predicate. (flymake-ler): Simplify. (flymake-error): Rename from flymake-errline. (flymake-warning): Rename from flymake-warnline. (flymake-warnline, flymake-errline): Obsoletion aliases. * test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc) (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): Use face `flymake-warning'.
2017-09-06 16:03:24 +01:00
(defface flymake-error
'((((supports :underline (:style wave)))
:underline (:style wave :color "Red1"))
(t
:inherit error))
Flymake diagnostics now apply to arbitrary buffer regions Make Flymake UI some 150 lines lighter Strip away much of the original implementation's complexity in manipulating objects representing diagnostics as well as creating and navigating overlays. Lay some groundwork for a more flexible approach that allows for different classes of diagnostics, not necessarily line-based. Importantly, one overlay per diagnostic is created, whereas the original implementation had one per line, and on it it concatenated the results of errors and warnings. This means that currently, an error and warning on the same line are problematic and the warning might be overlooked but this will soon be fixed by setting appropriate priorities. Since diagnostics can highlight arbitrary regions, not just lines, the faces were renamed. Tests pass and backward compatibility with interactive functions is maintained, but probably any third-party extension or customization relying on more than a trivial set of flymake.el internals has stopped working. * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make constructor syntax. * lisp/progmodes/flymake.el (flymake-ins-after) (flymake-set-at, flymake-er-make-er, flymake-er-get-line) (flymake-er-get-line-err-info-list, flymake-ler-set-file) (flymake-ler-set-full-file, flymake-ler-set-line) (flymake-get-line-err-count, flymake-get-err-count) (flymake-highlight-err-lines, flymake-overlay-p) (flymake-make-overlay, flymake-region-has-flymake-overlays) (flymake-find-err-info) (flymake-line-err-info-is-less-or-equal) (flymake-add-line-err-info, flymake-add-err-info) (flymake-get-first-err-line-no) (flymake-get-last-err-line-no, flymake-get-next-err-line-no) (flymake-get-prev-err-line-no, flymake-skip-whitespace) (flymake-goto-line, flymake-goto-next-error) (flymake-goto-prev-error, flymake-patch-err-text): Delete functions no longer used. (flymake-goto-next-error, flymake-goto-prev-error): Rewrite. (flymake-report): Rewrite. (flymake-popup-current-error-menu): Rewrite. (flymake--highlight-line): Rename from flymake-highlight-line. Call `flymake--place-overlay. (flymake--place-overlay): New function. (flymake-ler-errorp): New predicate. (flymake-ler): Simplify. (flymake-error): Rename from flymake-errline. (flymake-warning): Rename from flymake-warnline. (flymake-warnline, flymake-errline): Obsoletion aliases. * test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc) (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): Use face `flymake-warning'.
2017-09-06 16:03:24 +01:00
"Face used for marking error regions."
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
:version "24.4")
Flymake diagnostics now apply to arbitrary buffer regions Make Flymake UI some 150 lines lighter Strip away much of the original implementation's complexity in manipulating objects representing diagnostics as well as creating and navigating overlays. Lay some groundwork for a more flexible approach that allows for different classes of diagnostics, not necessarily line-based. Importantly, one overlay per diagnostic is created, whereas the original implementation had one per line, and on it it concatenated the results of errors and warnings. This means that currently, an error and warning on the same line are problematic and the warning might be overlooked but this will soon be fixed by setting appropriate priorities. Since diagnostics can highlight arbitrary regions, not just lines, the faces were renamed. Tests pass and backward compatibility with interactive functions is maintained, but probably any third-party extension or customization relying on more than a trivial set of flymake.el internals has stopped working. * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make constructor syntax. * lisp/progmodes/flymake.el (flymake-ins-after) (flymake-set-at, flymake-er-make-er, flymake-er-get-line) (flymake-er-get-line-err-info-list, flymake-ler-set-file) (flymake-ler-set-full-file, flymake-ler-set-line) (flymake-get-line-err-count, flymake-get-err-count) (flymake-highlight-err-lines, flymake-overlay-p) (flymake-make-overlay, flymake-region-has-flymake-overlays) (flymake-find-err-info) (flymake-line-err-info-is-less-or-equal) (flymake-add-line-err-info, flymake-add-err-info) (flymake-get-first-err-line-no) (flymake-get-last-err-line-no, flymake-get-next-err-line-no) (flymake-get-prev-err-line-no, flymake-skip-whitespace) (flymake-goto-line, flymake-goto-next-error) (flymake-goto-prev-error, flymake-patch-err-text): Delete functions no longer used. (flymake-goto-next-error, flymake-goto-prev-error): Rewrite. (flymake-report): Rewrite. (flymake-popup-current-error-menu): Rewrite. (flymake--highlight-line): Rename from flymake-highlight-line. Call `flymake--place-overlay. (flymake--place-overlay): New function. (flymake-ler-errorp): New predicate. (flymake-ler): Simplify. (flymake-error): Rename from flymake-errline. (flymake-warning): Rename from flymake-warnline. (flymake-warnline, flymake-errline): Obsoletion aliases. * test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc) (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): Use face `flymake-warning'.
2017-09-06 16:03:24 +01:00
(defface flymake-warning
'((((supports :underline (:style wave)))
:underline (:style wave :color "deep sky blue"))
(t
:inherit warning))
Flymake diagnostics now apply to arbitrary buffer regions Make Flymake UI some 150 lines lighter Strip away much of the original implementation's complexity in manipulating objects representing diagnostics as well as creating and navigating overlays. Lay some groundwork for a more flexible approach that allows for different classes of diagnostics, not necessarily line-based. Importantly, one overlay per diagnostic is created, whereas the original implementation had one per line, and on it it concatenated the results of errors and warnings. This means that currently, an error and warning on the same line are problematic and the warning might be overlooked but this will soon be fixed by setting appropriate priorities. Since diagnostics can highlight arbitrary regions, not just lines, the faces were renamed. Tests pass and backward compatibility with interactive functions is maintained, but probably any third-party extension or customization relying on more than a trivial set of flymake.el internals has stopped working. * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make constructor syntax. * lisp/progmodes/flymake.el (flymake-ins-after) (flymake-set-at, flymake-er-make-er, flymake-er-get-line) (flymake-er-get-line-err-info-list, flymake-ler-set-file) (flymake-ler-set-full-file, flymake-ler-set-line) (flymake-get-line-err-count, flymake-get-err-count) (flymake-highlight-err-lines, flymake-overlay-p) (flymake-make-overlay, flymake-region-has-flymake-overlays) (flymake-find-err-info) (flymake-line-err-info-is-less-or-equal) (flymake-add-line-err-info, flymake-add-err-info) (flymake-get-first-err-line-no) (flymake-get-last-err-line-no, flymake-get-next-err-line-no) (flymake-get-prev-err-line-no, flymake-skip-whitespace) (flymake-goto-line, flymake-goto-next-error) (flymake-goto-prev-error, flymake-patch-err-text): Delete functions no longer used. (flymake-goto-next-error, flymake-goto-prev-error): Rewrite. (flymake-report): Rewrite. (flymake-popup-current-error-menu): Rewrite. (flymake--highlight-line): Rename from flymake-highlight-line. Call `flymake--place-overlay. (flymake--place-overlay): New function. (flymake-ler-errorp): New predicate. (flymake-ler): Simplify. (flymake-error): Rename from flymake-errline. (flymake-warning): Rename from flymake-warnline. (flymake-warnline, flymake-errline): Obsoletion aliases. * test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc) (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): Use face `flymake-warning'.
2017-09-06 16:03:24 +01:00
"Face used for marking warning regions."
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
:version "24.4")
(defface flymake-note
'((((supports :underline (:style wave)))
:underline (:style wave :color "yellow green"))
(t
:inherit warning))
"Face used for marking note regions."
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
:version "26.1")
Flymake diagnostics now apply to arbitrary buffer regions Make Flymake UI some 150 lines lighter Strip away much of the original implementation's complexity in manipulating objects representing diagnostics as well as creating and navigating overlays. Lay some groundwork for a more flexible approach that allows for different classes of diagnostics, not necessarily line-based. Importantly, one overlay per diagnostic is created, whereas the original implementation had one per line, and on it it concatenated the results of errors and warnings. This means that currently, an error and warning on the same line are problematic and the warning might be overlooked but this will soon be fixed by setting appropriate priorities. Since diagnostics can highlight arbitrary regions, not just lines, the faces were renamed. Tests pass and backward compatibility with interactive functions is maintained, but probably any third-party extension or customization relying on more than a trivial set of flymake.el internals has stopped working. * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make constructor syntax. * lisp/progmodes/flymake.el (flymake-ins-after) (flymake-set-at, flymake-er-make-er, flymake-er-get-line) (flymake-er-get-line-err-info-list, flymake-ler-set-file) (flymake-ler-set-full-file, flymake-ler-set-line) (flymake-get-line-err-count, flymake-get-err-count) (flymake-highlight-err-lines, flymake-overlay-p) (flymake-make-overlay, flymake-region-has-flymake-overlays) (flymake-find-err-info) (flymake-line-err-info-is-less-or-equal) (flymake-add-line-err-info, flymake-add-err-info) (flymake-get-first-err-line-no) (flymake-get-last-err-line-no, flymake-get-next-err-line-no) (flymake-get-prev-err-line-no, flymake-skip-whitespace) (flymake-goto-line, flymake-goto-next-error) (flymake-goto-prev-error, flymake-patch-err-text): Delete functions no longer used. (flymake-goto-next-error, flymake-goto-prev-error): Rewrite. (flymake-report): Rewrite. (flymake-popup-current-error-menu): Rewrite. (flymake--highlight-line): Rename from flymake-highlight-line. Call `flymake--place-overlay. (flymake--place-overlay): New function. (flymake-ler-errorp): New predicate. (flymake-ler): Simplify. (flymake-error): Rename from flymake-errline. (flymake-warning): Rename from flymake-warnline. (flymake-warnline, flymake-errline): Obsoletion aliases. * test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc) (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): Use face `flymake-warning'.
2017-09-06 16:03:24 +01:00
(define-obsolete-face-alias 'flymake-warnline 'flymake-warning "26.1")
(define-obsolete-face-alias 'flymake-errline 'flymake-error "26.1")
;;;###autoload
(defun flymake-diag-region (buffer line &optional col)
"Compute BUFFER's region (BEG . END) corresponding to LINE and COL.
If COL is nil, return a region just for LINE. Return nil if the
region is invalid."
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(condition-case-unless-debug _err
(with-current-buffer buffer
(let ((line (min (max line 1)
(line-number-at-pos (point-max) 'absolute))))
(save-excursion
(goto-char (point-min))
(forward-line (1- line))
(cl-flet ((fallback-bol
()
(back-to-indentation)
(if (eobp)
(line-beginning-position 0)
(point)))
(fallback-eol
(beg)
(progn
(end-of-line)
Fix more regular expression typos Problem reported by Mattias Engdegård in: https://lists.gnu.org/r/emacs-devel/2019-03/msg00548.html except that I didn’t address the issues involving Hebrew, or involving comint-prompt-regexp. * lisp/align.el (align-rules-list, align-exclude-rules-list): * lisp/auth-source-pass.el (auth-source-pass--parse-secret) (auth-source-pass--parse-data): * lisp/cedet/data-debug.el (data-debug-next) (data-debug-prev, data-debug-expand-or-contract): * lisp/comint.el (comint-within-quotes): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emulation/viper-ex.el (ex-cmd-complete): * lisp/gnus/gnus-cite.el (gnus-message-search-citation-line): * lisp/gnus/nnir.el (nnir-imap-end-of-input): * lisp/mail/mail-extr.el (mail-extr-all-letters): * lisp/minibuffer.el (minibuffer-maybe-quote-filename): * lisp/nxml/rng-nxml.el (rng-complete-tag) (rng-complete-end-tag, rng-complete-attribute-name): * lisp/obsolete/vip.el (vip-get-ex-token, vip-get-ex-pat): * lisp/org/org-pcomplete.el (org-thing-at-point): * lisp/org/org.el (org-set-tags) (org-increase-number-at-point) (org-fill-line-break-nobreak-p): * lisp/pcomplete.el (pcomplete-parse-comint-arguments): * lisp/progmodes/ada-mode.el (ada-compile-goto-error): * lisp/progmodes/cperl-mode.el (cperl-highlight-charclass) (cperl-find-pods-heres, cperl-not-bad-style-regexp) (cperl-regext-to-level-start): * lisp/progmodes/ebnf-yac.el (ebnf-yac-skip-spaces): * lisp/progmodes/flymake-proc.el (flymake-proc-master-tex-init): * lisp/progmodes/flymake.el (flymake-diag-region): * lisp/progmodes/fortran.el (fortran-current-line-indentation): * lisp/progmodes/idlw-complete-structtag.el: (idlwave-complete-structure-tag): * lisp/progmodes/idlwave.el (idlwave-complete-sysvar-or-tag): * lisp/progmodes/prolog.el (prolog-pred-end) (prolog-clause-info): * lisp/progmodes/ruby-mode.el (ruby-forward-sexp) (ruby-backward-sexp): * lisp/progmodes/verilog-mode.el (verilog-repair-open-comma): * lisp/term.el (term-within-quotes): * lisp/textmodes/bib-mode.el (bib-capitalize-title-stop-words): * lisp/textmodes/refbib.el (r2b-capitalize-title-stop-words): * lisp/textmodes/reftex-parse.el (reftex-nth-arg): * lisp/textmodes/rst.el (rst-svn-rev): * lisp/url/url-http.el (url-http-parse-response): * test/lisp/progmodes/f90-tests.el (f90-test-bug3730): Fix regular expression typos.
2019-03-18 17:02:01 -07:00
(skip-chars-backward " \t\f\n" beg)
(if (eq (point) beg)
(line-beginning-position 2)
(point)))))
(if (and col (cl-plusp col))
(let* ((beg (progn (forward-char (1- col))
(point)))
(sexp-end (ignore-errors (end-of-thing 'sexp)))
(end (or (and sexp-end
(not (= sexp-end beg))
sexp-end)
(and (< (goto-char (1+ beg)) (point-max))
(point)))))
(if end
(cons beg end)
(cons (setq beg (fallback-bol))
(fallback-eol beg))))
(let* ((beg (fallback-bol))
(end (fallback-eol beg)))
(cons beg end)))))))
(error (flymake-log :warning "Invalid region line=%s col=%s" line col)
nil)))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
(defvar flymake-diagnostic-functions nil
"Special hook of Flymake backends that check a buffer.
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
The functions in this hook diagnose problems in a buffer's
contents and provide information to the Flymake user interface
about where and how to annotate problems diagnosed in a buffer.
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
Each backend function must be prepared to accept an arbitrary
number of arguments:
* the first argument is always REPORT-FN, a callback function
detailed below;
* the remaining arguments are keyword-value pairs in the
form (:KEY VALUE :KEY2 VALUE2...).
Currently, Flymake may provide these keyword-value pairs:
* `:recent-changes', a list of recent changes since the last time
the backend function was called for the buffer. An empty list
indicates that no changes have been reocrded. If it is the
first time that this backend function is called for this
activation of `flymake-mode', then this argument isn't provided
at all (i.e. it's not merely nil).
Each element is in the form (BEG END TEXT) where BEG and END
are buffer positions, and TEXT is a string containing the text
contained between those positions (if any) after the change was
performed.
* `:changes-start' and `:changes-end', the minimum and maximum
buffer positions touched by the recent changes. These are only
provided if `:recent-changes' is also provided.
Whenever Flymake or the user decides to re-check the buffer,
backend functions are called as detailed above and are expected
to initiate this check, but aren't required to complete it before
exiting: if the computation involved is expensive, especially for
large buffers, that task can be scheduled for the future using
asynchronous processes or other asynchronous mechanisms.
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-09-30 17:32:53 +01:00
In any case, backend functions are expected to return quickly or
signal an error, in which case the backend is disabled. Flymake
will not try disabled backends again for any future checks of
this buffer. To reset the list of disabled backends, turn
`flymake-mode' off and on again, or interactively call
`flymake-start' with a prefix argument.
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-09-30 17:32:53 +01:00
If the function returns, Flymake considers the backend to be
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
\"running\". If it has not done so already, the backend is
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-09-30 17:32:53 +01:00
expected to call the function REPORT-FN with a single argument
REPORT-ACTION also followed by an optional list of keyword-value
pairs in the form (:REPORT-KEY VALUE :REPORT-KEY2 VALUE2...).
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
Currently accepted values for REPORT-ACTION are:
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
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-09-30 17:32:53 +01:00
* A (possibly empty) list of diagnostic objects created with
`flymake-make-diagnostic', causing Flymake to delete all
previous diagnostic annotations in the buffer and create new
ones from this list.
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
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-09-30 17:32:53 +01:00
A backend may call REPORT-FN repeatedly in this manner, but
only until Flymake considers that the most recently requested
buffer check is now obsolete because, say, buffer contents have
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
changed in the meantime. The backend is only given notice of
this via a renewed call to the backend function. Thus, to
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-09-30 17:32:53 +01:00
prevent making obsolete reports and wasting resources, backend
functions should first cancel any ongoing processing from
previous calls.
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
2017-10-03 16:04:30 -07:00
* The symbol `:panic', signaling that the backend has encountered
an exceptional situation and should be disabled.
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
Currently accepted REPORT-KEY arguments are:
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
* `:explanation' value should give user-readable details of
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
the situation encountered, if any.
* `:force': value should be a boolean suggesting that Flymake
consider the report even if it was somehow unexpected.
* `:region': a cons (BEG . END) of buffer positions indicating
that the report applies to that region only. Specifically,
this means that Flymake will only delete diagnostic annotations
of past reports if they intersect the region by at least one
character.")
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
(put 'flymake-diagnostic-functions 'safe-local-variable #'null)
(put :error 'flymake-category 'flymake-error)
(put :warning 'flymake-category 'flymake-warning)
(put :note 'flymake-category 'flymake-note)
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 01:22:15 +01:00
(defvar flymake-diagnostic-types-alist '() "")
(make-obsolete-variable
'flymake-diagnostic-types-alist
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
"Set properties on the diagnostic symbols instead. See Info
Node `(Flymake)Flymake error types'"
"27.1")
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(put 'flymake-error 'face 'flymake-error)
(put 'flymake-error 'flymake-bitmap 'flymake-error-bitmap)
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(put 'flymake-error 'severity (warning-numeric-level :error))
(put 'flymake-error 'mode-line-face 'compilation-error)
(put 'flymake-error 'flymake-type-name "error")
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(put 'flymake-warning 'face 'flymake-warning)
(put 'flymake-warning 'flymake-bitmap 'flymake-warning-bitmap)
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(put 'flymake-warning 'severity (warning-numeric-level :warning))
(put 'flymake-warning 'mode-line-face 'compilation-warning)
(put 'flymake-warning 'flymake-type-name "warning")
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(put 'flymake-note 'face 'flymake-note)
(put 'flymake-note 'flymake-bitmap 'flymake-note-bitmap)
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(put 'flymake-note 'severity (warning-numeric-level :debug))
(put 'flymake-note 'mode-line-face 'compilation-info)
(put 'flymake-note 'flymake-type-name "note")
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(defun flymake--lookup-type-property (type prop &optional default)
"Look up PROP for diagnostic TYPE.
If TYPE doesn't declare PROP in its plist or in the symbol of its
associated `flymake-category' return DEFAULT."
;; This function also consults `flymake-diagnostic-types-alist' for
;; backward compatibility.
;;
(if (plist-member (symbol-plist type) prop)
;; allow nil values to survive
(get type prop)
(let (alist)
(or
(alist-get
prop (setq
alist
(alist-get type flymake-diagnostic-types-alist)))
(when-let* ((cat (or
(get type 'flymake-category)
(alist-get 'flymake-category alist)))
(plist (and (symbolp cat)
(symbol-plist cat)))
(cat-probe (plist-member plist prop)))
(cadr cat-probe))
default))))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(defun flymake--severity (type)
"Get the severity for diagnostic TYPE."
(flymake--lookup-type-property type 'severity
(warning-numeric-level :error)))
(defun flymake--fringe-overlay-spec (bitmap &optional recursed)
(if (and (symbolp bitmap)
(boundp bitmap)
(not recursed))
(flymake--fringe-overlay-spec
(symbol-value bitmap) t)
(and flymake-fringe-indicator-position
bitmap
(propertize "!" 'display
(cons flymake-fringe-indicator-position
(if (listp bitmap)
bitmap
(list bitmap)))))))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
Flymake diagnostics now apply to arbitrary buffer regions Make Flymake UI some 150 lines lighter Strip away much of the original implementation's complexity in manipulating objects representing diagnostics as well as creating and navigating overlays. Lay some groundwork for a more flexible approach that allows for different classes of diagnostics, not necessarily line-based. Importantly, one overlay per diagnostic is created, whereas the original implementation had one per line, and on it it concatenated the results of errors and warnings. This means that currently, an error and warning on the same line are problematic and the warning might be overlooked but this will soon be fixed by setting appropriate priorities. Since diagnostics can highlight arbitrary regions, not just lines, the faces were renamed. Tests pass and backward compatibility with interactive functions is maintained, but probably any third-party extension or customization relying on more than a trivial set of flymake.el internals has stopped working. * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make constructor syntax. * lisp/progmodes/flymake.el (flymake-ins-after) (flymake-set-at, flymake-er-make-er, flymake-er-get-line) (flymake-er-get-line-err-info-list, flymake-ler-set-file) (flymake-ler-set-full-file, flymake-ler-set-line) (flymake-get-line-err-count, flymake-get-err-count) (flymake-highlight-err-lines, flymake-overlay-p) (flymake-make-overlay, flymake-region-has-flymake-overlays) (flymake-find-err-info) (flymake-line-err-info-is-less-or-equal) (flymake-add-line-err-info, flymake-add-err-info) (flymake-get-first-err-line-no) (flymake-get-last-err-line-no, flymake-get-next-err-line-no) (flymake-get-prev-err-line-no, flymake-skip-whitespace) (flymake-goto-line, flymake-goto-next-error) (flymake-goto-prev-error, flymake-patch-err-text): Delete functions no longer used. (flymake-goto-next-error, flymake-goto-prev-error): Rewrite. (flymake-report): Rewrite. (flymake-popup-current-error-menu): Rewrite. (flymake--highlight-line): Rename from flymake-highlight-line. Call `flymake--place-overlay. (flymake--place-overlay): New function. (flymake-ler-errorp): New predicate. (flymake-ler): Simplify. (flymake-error): Rename from flymake-errline. (flymake-warning): Rename from flymake-warnline. (flymake-warnline, flymake-errline): Obsoletion aliases. * test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc) (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): Use face `flymake-warning'.
2017-09-06 16:03:24 +01:00
(defun flymake--highlight-line (diagnostic)
"Highlight buffer with info in DIGNOSTIC."
(let ((type (or (flymake--diag-type diagnostic)
:error))
(ov (make-overlay
(flymake--diag-beg diagnostic)
(flymake--diag-end diagnostic))))
;; First set `category' in the overlay
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
;;
(overlay-put ov 'category
(flymake--lookup-type-property type 'flymake-category))
;; Now "paint" the overlay with all the other non-category
;; properties.
(cl-loop
for (ov-prop . value) in
(append (reverse
(flymake--diag-overlay-properties diagnostic))
(reverse ; ensure ealier props override later ones
(flymake--lookup-type-property type 'flymake-overlay-control))
(alist-get type flymake-diagnostic-types-alist))
do (overlay-put ov ov-prop value))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
;; Now ensure some essential defaults are set
;;
(cl-flet ((default-maybe
(prop value)
(unless (plist-member (overlay-properties ov) prop)
(overlay-put ov prop (flymake--lookup-type-property
type prop value)))))
(default-maybe 'face 'flymake-error)
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(default-maybe 'before-string
(flymake--fringe-overlay-spec
(flymake--lookup-type-property
type
'flymake-bitmap
(alist-get 'bitmap (alist-get type ; backward compat
flymake-diagnostic-types-alist)))))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(default-maybe 'help-echo
(lambda (window _ov pos)
(with-selected-window window
(mapconcat
#'flymake--diag-text
(flymake-diagnostics pos)
"\n"))))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
(default-maybe 'severity (warning-numeric-level :error))
;; Use (PRIMARY . SECONDARY) priority, to avoid clashing with
;; `region' face, for example (bug#34022).
(default-maybe 'priority (cons nil (+ 40 (overlay-get ov 'severity)))))
2017-10-03 16:04:30 -07:00
;; Some properties can't be overridden.
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
;;
(overlay-put ov 'evaporate t)
(overlay-put ov 'flymake-diagnostic diagnostic)
ov))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
;; Nothing in Flymake uses this at all any more, so this is just for
;; third-party compatibility.
(define-obsolete-function-alias 'flymake-display-warning 'message-box "26.1")
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-09-30 17:32:53 +01:00
(defvar-local flymake--backend-state nil
"Buffer-local hash table of a Flymake backend's state.
The keys to this hash table are functions as found in
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
`flymake-diagnostic-functions'. The values are structures
of the type `flymake--backend-state', with these slots:
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-09-30 17:32:53 +01:00
`running', a symbol to keep track of a backend's replies via its
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
REPORT-FN argument. A backend is running if this key is
present. If nil, Flymake isn't expecting any replies from the
backend.
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-09-30 17:32:53 +01:00
`diags', a (possibly empty) list of recent diagnostic objects
created by the backend with `flymake-make-diagnostic'.
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-09-30 17:32:53 +01:00
`reported-p', a boolean indicating if the backend has replied
since it last was contacted.
`disabled', a string with the explanation for a previous
exceptional situation reported by the backend, nil if the
backend is operating normally.")
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-09-30 17:32:53 +01:00
(cl-defstruct (flymake--backend-state
(:constructor flymake--make-backend-state))
running reported-p disabled diags)
(defmacro flymake--with-backend-state (backend state-var &rest body)
"Bind BACKEND's STATE-VAR to its state, run BODY."
(declare (indent 2) (debug (sexp sexp &rest form)))
(let ((b (make-symbol "b")))
`(let* ((,b ,backend)
(,state-var
(or (gethash ,b flymake--backend-state)
(puthash ,b (flymake--make-backend-state)
flymake--backend-state))))
,@body)))
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
(defun flymake-is-running ()
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
"Tell if Flymake has running backends in this buffer."
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-09-30 17:32:53 +01:00
(flymake-running-backends))
2019-12-10 20:04:36 -08:00
;; FIXME: clone of `isearch-intersects-p'! Make this an util.
(defun flymake--intersects-p (start0 end0 start1 end1)
"Return t if regions START0..END0 and START1..END1 intersect."
(or (and (>= start0 start1) (< start0 end1))
(and (> end0 start1) (<= end0 end1))
(and (>= start1 start0) (< start1 end0))
(and (> end1 start0) (<= end1 end0))))
(cl-defun flymake--handle-report (backend token report-action
&key explanation force region
&allow-other-keys)
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-09-30 17:32:53 +01:00
"Handle reports from BACKEND identified by TOKEN.
BACKEND, REPORT-ACTION and EXPLANATION, and FORCE conform to the
calling convention described in
`flymake-diagnostic-functions' (which see). Optional FORCE says
to handle a report even if TOKEN was not expected. REGION is
a (BEG . END) pair of buffer positions indicating that this
report applies to that region."
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-09-30 17:32:53 +01:00
(let* ((state (gethash backend flymake--backend-state))
(first-report (not (flymake--backend-state-reported-p state))))
(setf (flymake--backend-state-reported-p state) t)
(let (expected-token
new-diags)
(cond
((null state)
(flymake-error
"Unexpected report from unknown backend %s" backend))
((flymake--backend-state-disabled state)
(flymake-error
"Unexpected report from disabled backend %s" backend))
((progn
(setq expected-token (flymake--backend-state-running state))
(null expected-token))
;; should never happen
(flymake-error "Unexpected report from stopped backend %s" backend))
((not (or (eq expected-token token)
force))
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-09-30 17:32:53 +01:00
(flymake-error "Obsolete report from backend %s with explanation %s"
backend explanation))
((eq :panic report-action)
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-09-30 17:32:53 +01:00
(flymake--disable-backend backend explanation))
((not (listp report-action))
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-09-30 17:32:53 +01:00
(flymake--disable-backend backend
(format "Unknown action %S" report-action))
(flymake-error "Expected report, but got unknown key %s" report-action))
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-09-30 17:32:53 +01:00
(t
(setq new-diags
(cl-remove-if-not
(lambda (diag) (eq (flymake--diag-buffer diag) (current-buffer)))
report-action))
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-09-30 17:32:53 +01:00
(save-restriction
(widen)
;; Before adding to backend's diagnostic list, decide if
;; some or all must be deleted. When deleting, also delete
;; the associated overlay.
(cond
(region
(cl-loop for diag in (flymake--backend-state-diags state)
for ov = (flymake--diag-overlay diag)
if (or (not (overlay-buffer ov))
(flymake--intersects-p
(overlay-start ov) (overlay-end ov)
(car region) (cdr region)))
do (delete-overlay ov)
else collect diag into surviving
finally (setf (flymake--backend-state-diags state)
surviving)))
(first-report
(dolist (diag (flymake--backend-state-diags state))
(delete-overlay (flymake--diag-overlay diag)))
(setf (flymake--backend-state-diags state) nil)))
;; Now make new ones
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-09-30 17:32:53 +01:00
(mapc (lambda (diag)
(let ((overlay (flymake--highlight-line diag)))
(setf (flymake--diag-backend diag) backend
(flymake--diag-overlay diag) overlay)))
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-09-30 17:32:53 +01:00
new-diags)
(setf (flymake--backend-state-diags state)
(append new-diags (flymake--backend-state-diags state)))
(when flymake-check-start-time
(flymake-log :debug "backend %s reported %d diagnostics in %.2f second(s)"
backend
(length new-diags)
Avoid some double-rounding of Lisp timestamps Also, simplify some time-related Lisp timestamp code while we’re in the neighborhood. * lisp/battery.el (battery-linux-proc-acpi) (battery-linux-sysfs, battery-upower, battery-bsd-apm): * lisp/calendar/timeclock.el (timeclock-seconds-to-string) (timeclock-log, timeclock-last-period) (timeclock-entry-length, timeclock-entry-list-span) (timeclock-find-discrep, timeclock-generate-report): * lisp/cedet/ede/detect.el (ede-detect-qtest): * lisp/completion.el (cmpl-hours-since-origin): * lisp/ecomplete.el (ecomplete-decay-1): * lisp/emacs-lisp/ert.el (ert--results-update-stats-display) (ert--results-update-stats-display-maybe): * lisp/emacs-lisp/timer-list.el (list-timers): * lisp/emacs-lisp/timer.el (timer-until) (timer-event-handler): * lisp/erc/erc-backend.el (erc-server-send-ping) (erc-server-send-queue, erc-handle-parsed-server-response) (erc-handle-unknown-server-response): * lisp/erc/erc-track.el (erc-buffer-visible): * lisp/erc/erc.el (erc-lurker-cleanup, erc-lurker-p) (erc-cmd-PING, erc-send-current-line): * lisp/eshell/em-pred.el (eshell-pred-file-time): * lisp/eshell/em-unix.el (eshell-show-elapsed-time): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event:org-timestamp): * lisp/gnus/gnus-int.el (gnus-backend-trace): * lisp/gnus/gnus-sum.el (gnus-user-date): * lisp/gnus/mail-source.el (mail-source-delete-crash-box): * lisp/gnus/nnmaildir.el (nnmaildir--scan): * lisp/ibuf-ext.el (ibuffer-mark-old-buffers): * lisp/gnus/nnmaildir.el (nnmaildir--scan): * lisp/mouse.el (mouse--down-1-maybe-follows-link) (mouse--click-1-maybe-follows-link): * lisp/mpc.el (mpc--faster-toggle): * lisp/net/rcirc.el (rcirc-handler-ctcp-KEEPALIVE) (rcirc-sentinel): * lisp/net/tramp-cache.el (tramp-get-file-property): * lisp/net/tramp-sh.el (tramp-sh-handle-file-newer-than-file-p) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): * lisp/org/org-clock.el (org-clock-resolve): (org-resolve-clocks, org-clock-in, org-clock-out, org-clock-sum): * lisp/org/org-timer.el (org-timer-start) (org-timer-pause-or-continue, org-timer-seconds): * lisp/org/org.el (org-evaluate-time-range): * lisp/org/ox-publish.el (org-publish-cache-ctime-of-src): * lisp/pixel-scroll.el (pixel-scroll-in-rush-p): * lisp/play/hanoi.el (hanoi-move-ring): * lisp/proced.el (proced-format-time): * lisp/progmodes/cpp.el (cpp-progress-message): * lisp/progmodes/flymake.el (flymake--handle-report): * lisp/progmodes/js.el (js--wait-for-matching-output): * lisp/subr.el (progress-reporter-do-update): * lisp/term/xterm.el (xterm--read-event-for-query): * lisp/time.el (display-time-update, emacs-uptime): * lisp/tooltip.el (tooltip-delay): * lisp/url/url-cookie.el (url-cookie-parse-file-netscape): * lisp/url/url-queue.el (url-queue-prune-old-entries): * lisp/url/url.el (url-retrieve-synchronously): * lisp/xt-mouse.el (xterm-mouse-event): Avoid double-rounding of time-related values. Simplify. * lisp/calendar/icalendar.el (icalendar--decode-isodatetime): When hoping for the best (unlikely), use a better decoded time. (icalendar--convert-sexp-to-ical): Avoid unnecessary encode-time. * lisp/calendar/timeclock.el (timeclock-when-to-leave): * lisp/cedet/ede/detect.el (ede-detect-qtest): * lisp/desktop.el (desktop-create-buffer): * lisp/emacs-lisp/benchmark.el (benchmark-elapse): * lisp/gnus/gnus-art.el (article-lapsed-string): * lisp/gnus/gnus-group.el (gnus-group-timestamp-delta): * lisp/gnus/nnmail.el (nnmail-expired-article-p): * lisp/gnus/nnmaildir.el (nnmaildir-request-expire-articles): * lisp/nxml/rng-maint.el (rng-time-function): * lisp/org/org-clock.el (org-clock-get-clocked-time) (org-clock-resolve, org-resolve-clocks, org-resolve-clocks-if-idle): * lisp/org/org-habit.el (org-habit-insert-consistency-graphs): * lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info) (vhdl-fix-case-region-1): Use time-since instead of open-coding most of it. * lisp/erc/erc-dcc.el (erc-dcc-get-sentinel): * lisp/erc/erc.el (erc-string-to-emacs-time, erc-time-gt): Now obsolete. All uses changed. (erc-time-diff): Accept all Lisp time values. All uses changed. * lisp/gnus/gnus-demon.el (gnus-demon-idle-since): * lisp/gnus/gnus-score.el (gnus-score-headers): * lisp/gnus/nneething.el (nneething-make-head): * lisp/gnus/nnheader.el (nnheader-message-maybe): * lisp/gnus/nnimap.el (nnimap-keepalive): * lisp/image.el (image-animate-timeout): * lisp/mail/feedmail.el (feedmail-rfc822-date): * lisp/net/imap.el (imap-wait-for-tag): * lisp/net/newst-backend.el (newsticker--image-get): * lisp/net/rcirc.el (rcirc-handler-317, rcirc-handler-333): * lisp/obsolete/xesam.el (xesam-refresh-entry): * lisp/org/org-agenda.el (org-agenda-show-clocking-issues) (org-agenda-check-clock-gap, org-agenda-to-appt): * lisp/org/org-capture.el (org-capture-set-target-location): * lisp/org/org-clock.el (org-clock-resolve-clock) (org-clocktable-steps): * lisp/org/org-colview.el (org-columns-edit-value) (org-columns, org-agenda-columns): * lisp/org/org-duration.el (org-duration-from-minutes): * lisp/org/org-element.el (org-element-cache-sync-duration) (org-element-cache-sync-break) (org-element--cache-interrupt-p, org-element--cache-sync): * lisp/org/org-habit.el (org-habit-get-faces) * lisp/org/org-indent.el (org-indent-add-properties): * lisp/org/org-table.el (org-table-sum): * lisp/org/org-timer.el (org-timer-show-remaining-time) (org-timer-set-timer): * lisp/org/org.el (org-babel-load-file, org-today) (org-auto-repeat-maybe, org-2ft, org-time-stamp) (org-read-date-analyze, org-time-stamp-to-now) (org-small-year-to-year, org-goto-calendar): * lisp/org/ox.el (org-export-insert-default-template): * lisp/ses.el (ses--time-check): * lisp/type-break.el (type-break-time-warning) (type-break-statistics, type-break-demo-boring): * lisp/url/url-cache.el (url-cache-expired) (url-cache-prune-cache): * lisp/vc/vc-git.el (vc-git-stash-snapshot): * lisp/erc/erc-match.el (erc-log-matches-come-back): Simplify.
2019-02-22 18:32:31 -08:00
(float-time
(time-since flymake-check-start-time))))
(when (and (get-buffer (flymake--diagnostics-buffer-name))
(get-buffer-window (flymake--diagnostics-buffer-name))
(null (cl-set-difference (flymake-running-backends)
(flymake-reporting-backends))))
(flymake-show-diagnostics-buffer))))))))
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-09-30 17:32:53 +01:00
(defun flymake-make-report-fn (backend &optional token)
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
"Make a suitable anonymous report function for BACKEND.
BACKEND is used to help Flymake distinguish different diagnostic
sources. If provided, TOKEN helps Flymake distinguish between
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-09-30 17:32:53 +01:00
different runs of the same backend."
(let ((buffer (current-buffer)))
(lambda (&rest args)
(when (buffer-live-p buffer)
(with-current-buffer buffer
(apply #'flymake--handle-report backend token args))))))
(defun flymake--collect (fn &optional message-prefix)
"Collect Flymake backends matching FN.
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
If MESSAGE-PREFIX, echo a message using that prefix."
(unless flymake--backend-state
(user-error "Flymake is not initialized"))
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-09-30 17:32:53 +01:00
(let (retval)
(maphash (lambda (backend state)
(when (funcall fn state) (push backend retval)))
flymake--backend-state)
(when message-prefix
(message "%s%s"
message-prefix
(mapconcat (lambda (s) (format "%s" s))
retval ", ")))
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-09-30 17:32:53 +01:00
retval))
(defun flymake-running-backends ()
"Compute running Flymake backends in current buffer."
(interactive)
(flymake--collect #'flymake--backend-state-running
(and (called-interactively-p 'interactive)
"Running backends: ")))
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-09-30 17:32:53 +01:00
(defun flymake-disabled-backends ()
"Compute disabled Flymake backends in current buffer."
(interactive)
(flymake--collect #'flymake--backend-state-disabled
(and (called-interactively-p 'interactive)
"Disabled backends: ")))
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-09-30 17:32:53 +01:00
(defun flymake-reporting-backends ()
"Compute reporting Flymake backends in current buffer."
(interactive)
(flymake--collect #'flymake--backend-state-reported-p
(and (called-interactively-p 'interactive)
"Reporting backends: ")))
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-09-30 17:32:53 +01:00
(defun flymake--disable-backend (backend &optional explanation)
"Disable BACKEND because EXPLANATION.
If it is running also stop it."
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-09-30 17:32:53 +01:00
(flymake-log :warning "Disabling backend %s because %s" backend explanation)
(flymake--with-backend-state backend state
(setf (flymake--backend-state-running state) nil
(flymake--backend-state-disabled state) explanation
(flymake--backend-state-reported-p state) t)))
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
(defun flymake--run-backend (backend &optional args)
"Run the backend BACKEND, re-enabling if necessary.
ARGS is a keyword-value plist passed to the backend along
with a report function."
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-09-30 17:32:53 +01:00
(flymake-log :debug "Running backend %s" backend)
(let ((run-token (cl-gensym "backend-token")))
(flymake--with-backend-state backend state
(setf (flymake--backend-state-running state) run-token
(flymake--backend-state-disabled state) nil
(flymake--backend-state-reported-p state) nil))
;; FIXME: Should use `condition-case-unless-debug' here, but don't
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-09-30 17:32:53 +01:00
;; for two reasons: (1) that won't let me catch errors from inside
;; `ert-deftest' where `debug-on-error' appears to be always
;; t. (2) In cases where the user is debugging elisp somewhere
;; else, and using flymake, the presence of a frequently
;; misbehaving backend in the global hook (most likely the legacy
;; backend) will trigger an annoying backtrace.
;;
(condition-case err
(apply backend (flymake-make-report-fn backend run-token)
args)
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-09-30 17:32:53 +01:00
(error
(flymake--disable-backend backend err)))))
(defvar-local flymake--recent-changes nil
"Recent changes collected by `flymake-after-change-function'.")
(defvar flymake-mode)
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-09-30 17:32:53 +01:00
(defun flymake-start (&optional deferred force)
"Start a syntax check for the current buffer.
DEFERRED is a list of symbols designating conditions to wait for
before actually starting the check. If it is nil (the list is
empty), start it immediately, else defer the check to when those
conditions are met. Currently recognized conditions are
`post-command', for waiting until the current command is over,
`on-display', for waiting until the buffer is actually displayed
in a window. If DEFERRED is t, wait for all known conditions.
With optional FORCE run even disabled backends.
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-09-30 17:32:53 +01:00
Interactively, with a prefix arg, FORCE is t."
(interactive (list nil current-prefix-arg))
(let ((deferred (if (eq t deferred)
'(post-command on-display)
deferred))
(buffer (current-buffer)))
(cl-labels
((start-post-command
()
(remove-hook 'post-command-hook #'start-post-command
nil)
;; The buffer may have disappeared already, e.g. because of
;; code like `(with-temp-buffer (python-mode) ...)'.
(when (buffer-live-p buffer)
(with-current-buffer buffer
(flymake-start (remove 'post-command deferred) force))))
(start-on-display
()
(remove-hook 'window-configuration-change-hook #'start-on-display
'local)
(flymake-start (remove 'on-display deferred) force)))
(cond ((and (memq 'post-command deferred)
this-command)
(add-hook 'post-command-hook
#'start-post-command
'append nil))
((and (memq 'on-display deferred)
(not (get-buffer-window (current-buffer))))
(add-hook 'window-configuration-change-hook
#'start-on-display
'append 'local))
(flymake-mode
(setq flymake-check-start-time (float-time))
(let ((backend-args
(and
flymake--recent-changes
(list :recent-changes
flymake--recent-changes
:changes-start
(cl-reduce
#'min (mapcar #'car flymake--recent-changes))
:changes-end
(cl-reduce
#'max (mapcar #'cadr flymake--recent-changes))))))
(setq flymake--recent-changes nil)
(run-hook-wrapped
'flymake-diagnostic-functions
(lambda (backend)
(cond
((and (not force)
(flymake--with-backend-state backend state
(flymake--backend-state-disabled state)))
(flymake-log :debug "Backend %s is disabled, not starting"
backend))
(t
(flymake--run-backend backend backend-args)))
nil))))))))
(defvar flymake-mode-map
(let ((map (make-sparse-keymap))) map)
"Keymap for `flymake-mode'")
;;;###autoload
(define-minor-mode flymake-mode
"Toggle Flymake mode on or off.
Flymake is an Emacs minor mode for on-the-fly syntax checking.
Flymake collects diagnostic information from multiple sources,
called backends, and visually annotates the buffer with the
results.
Flymake performs these checks while the user is editing.
The customization variables `flymake-start-on-flymake-mode',
`flymake-no-changes-timeout' determine the exact circumstances
whereupon Flymake decides to initiate a check of the buffer.
The commands `flymake-goto-next-error' and
`flymake-goto-prev-error' can be used to navigate among Flymake
diagnostics annotated in the buffer.
The visual appearance of each type of diagnostic can be changed
by setting properties `flymake-overlay-control', `flymake-bitmap'
and `flymake-severity' on the symbols of diagnostic types (like
`:error', `:warning' and `:note').
Activation or deactivation of backends used by Flymake in each
buffer happens via the special hook
`flymake-diagnostic-functions'.
Some backends may take longer than others to respond or complete,
and some may decide to disable themselves if they are not
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
suitable for the current buffer. The commands
`flymake-running-backends', `flymake-disabled-backends' and
`flymake-reporting-backends' summarize the situation, as does the
special *Flymake log* buffer." :group 'flymake :lighter
flymake--mode-line-format :keymap flymake-mode-map
(cond
;; Turning the mode ON.
(flymake-mode
(add-hook 'after-change-functions 'flymake-after-change-function nil t)
(add-hook 'after-save-hook 'flymake-after-save-hook nil t)
(add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t)
;; If Flymake happened to be alrady already ON, we must cleanup
;; existing diagnostic overlays, lest we forget them by blindly
;; reinitializing `flymake--backend-state' in the next line.
;; See https://github.com/joaotavora/eglot/issues/223.
(mapc #'delete-overlay (flymake--overlays))
(setq flymake--backend-state (make-hash-table))
(setq flymake--recent-changes nil)
(when flymake-start-on-flymake-mode (flymake-start t)))
;; Turning the mode OFF.
(t
(remove-hook 'after-change-functions 'flymake-after-change-function t)
(remove-hook 'after-save-hook 'flymake-after-save-hook t)
(remove-hook 'kill-buffer-hook 'flymake-kill-buffer-hook t)
;;+(remove-hook 'find-file-hook (function flymake-find-file-hook) t)
(mapc #'delete-overlay (flymake--overlays))
(when flymake-timer
(cancel-timer flymake-timer)
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
(setq flymake-timer nil)))))
(defun flymake--schedule-timer-maybe ()
"(Re)schedule an idle timer for checking the buffer.
Do it only if `flymake-no-changes-timeout' is non-nil."
(when flymake-timer (cancel-timer flymake-timer))
(when flymake-no-changes-timeout
(setq
flymake-timer
(run-with-idle-timer
New function time-convert This replaces the awkward reuse of encode-time to both convert calendrical timestamps to Lisp timestamps, and to convert Lisp timestamps to other forms. Now, encode-time does just the former and the new function does just the latter. The new function builds on a suggestion by Lars Ingebrigtsen in: https://lists.gnu.org/r/emacs-devel/2019-07/msg00801.html and refined by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2019-07/msg00803.html * doc/lispref/os.texi (Time of Day, Time Conversion): * doc/misc/emacs-mime.texi (time-date): * etc/NEWS: Update documentation. * lisp/calendar/cal-dst.el (calendar-next-time-zone-transition): * lisp/calendar/time-date.el (seconds-to-time, days-to-time): * lisp/calendar/timeclock.el (timeclock-seconds-to-time): * lisp/cedet/ede/detect.el (ede-detect-qtest): * lisp/completion.el (cmpl-hours-since-origin): * lisp/ecomplete.el (ecomplete-add-item): * lisp/emacs-lisp/cl-extra.el (cl--random-time): * lisp/emacs-lisp/timer.el (timer--time-setter) (timer-next-integral-multiple-of-time): * lisp/find-lisp.el (find-lisp-format-time): * lisp/gnus/gnus-diary.el (gnus-user-format-function-d): * lisp/gnus/gnus-group.el (gnus-group-set-timestamp): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-show-org-agenda): * lisp/gnus/nnrss.el (nnrss-normalize-date): * lisp/gnus/nnspool.el (nnspool-request-newgroups): * lisp/net/ntlm.el (ntlm-compute-timestamp): * lisp/net/pop3.el (pop3-uidl-dele): * lisp/obsolete/vc-arch.el (vc-arch-add-tagline): * lisp/org/org-clock.el (org-clock-get-clocked-time) (org-clock-resolve, org-resolve-clocks, org-clock-in) (org-clock-out, org-clock-sum): * lisp/org/org-id.el (org-id-uuid, org-id-time-to-b36): * lisp/org/ox-publish.el (org-publish-cache-ctime-of-src): * lisp/proced.el (proced-format-time): * lisp/progmodes/cc-cmds.el (c-progress-init) (c-progress-update): * lisp/progmodes/cperl-mode.el (cperl-time-fontification): * lisp/progmodes/flymake.el (flymake--schedule-timer-maybe): * lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info) (vhdl-fix-case-region-1): * lisp/tar-mode.el (tar-octal-time): * lisp/time.el (emacs-uptime): * lisp/url/url-auth.el (url-digest-auth-make-cnonce): * lisp/url/url-util.el (url-lazy-message): * lisp/vc/vc-cvs.el (vc-cvs-parse-entry): * lisp/vc/vc-hg.el (vc-hg-state-fast): * lisp/xt-mouse.el (xterm-mouse-event): * test/lisp/emacs-lisp/timer-tests.el: (timer-next-integral-multiple-of-time-2): Use time-convert, not encode-time. * lisp/calendar/icalendar.el (icalendar--decode-isodatetime): Don’t use now-removed FORM argument for encode-time. It wasn’t crucial anyway. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add time-convert. * lisp/emacs-lisp/elint.el (elint-unknown-builtin-args): Update encode-time signature to match current arg set. * lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time): Use timer-convert with t rather than doing it by hand. * src/timefns.c (time_hz_ticks, time_form_stamp, lisp_time_form_stamp): Remove; no longer needed. (decode_lisp_time): Rturn the form instead of having a *PFORM arg. All uses changed. (time_arith): Just return TICKS if HZ is 1. (Fencode_time): Remove argument FORM. All callers changed. Do not attempt to encode time values; just encode decoded (calendrical) times. Unless CURRENT_TIME_LIST, just return VALUE since HZ is 1. (Ftime_convert): New function, which does the time value conversion that bleeding-edge encode-time formerly did. Return TIME if it is easy to see that it is already of the correct form. (Fcurrent_time): Mention in doc that the form is planned to change. * test/src/timefns-tests.el (decode-then-encode-time): Don’t use (encode-time nil).
2019-08-05 17:38:52 -07:00
;; This can use time-convert instead of seconds-to-time,
;; once we can assume Emacs 27 or later.
(seconds-to-time flymake-no-changes-timeout)
nil
(lambda (buffer)
(when (buffer-live-p buffer)
(with-current-buffer buffer
(when (and flymake-mode
flymake-no-changes-timeout)
(flymake-log
:debug "starting syntax check after idle for %s seconds"
flymake-no-changes-timeout)
(flymake-start t))
(setq flymake-timer nil))))
(current-buffer)))))
;;;###autoload
(defun flymake-mode-on ()
"Turn Flymake mode on."
(flymake-mode 1))
;;;###autoload
(defun flymake-mode-off ()
"Turn Flymake mode off."
(flymake-mode 0))
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
(make-obsolete 'flymake-mode-on 'flymake-mode "26.1")
(make-obsolete 'flymake-mode-off 'flymake-mode "26.1")
(defun flymake-after-change-function (start stop _len)
"Start syntax check for current buffer if it isn't already running.
START and STOP and LEN are as in `after-change-functions'."
(let((new-text (buffer-substring start stop)))
(push (list start stop new-text) flymake--recent-changes)
(flymake--schedule-timer-maybe)))
(defun flymake-after-save-hook ()
(when flymake-start-on-save-buffer
(flymake-log :debug "starting syntax check as buffer was saved")
(flymake-start t)))
(defun flymake-kill-buffer-hook ()
(when flymake-timer
(cancel-timer flymake-timer)
(setq flymake-timer nil)))
(defun flymake-find-file-hook ()
New Flymake API variable flymake-diagnostic-functions Lay groundwork for multiple active backends in the same buffer. Backends are lisp functions called when flymake-mode sees fit. They are responsible for examining the current buffer and telling flymake.el, via return value, if they can syntax check it. Backends should return quickly and inexpensively, but they are also passed a REPORT-FN argument which they may or may not call asynchronously after performing more expensive work. REPORT-FN's calling convention stipulates that a backend calls it with a list of diagnostics as argument, or, alternatively, with a symbol denoting an exceptional situation, usually some panic resulting from a misconfigured backend. In keeping with legacy behaviour, flymake.el's response to a panic is to disable the issuing backend. The flymake--diag object representing a diagnostic now also keeps information about its source backend. Among other uses, this allows flymake to selectively cleanup overlays based on which backend is updating its diagnostics. * lisp/progmodes/flymake-proc.el (flymake-proc--report-fn): New dynamic variable. (flymake-proc--process): New variable. (flymake-can-syntax-check-buffer): Remove. (flymake-proc--process-sentinel): Simplify. Use unwind-protect. Affect flymake-proc--processes here. Bind flymake-proc--report-fn. (flymake-proc--process-filter): Bind flymake-proc--report-fn. (flymake-proc--post-syntax-check): Delete (flymake-proc-start-syntax-check): Take mandatory report-fn. Rewrite. Bind flymake-proc--report-fn. (flymake-proc--process-sentinel): Rewrite and simplify. (flymake-proc--panic): New helper. (flymake-proc--start-syntax-check-process): Record report-fn in process. Use flymake-proc--panic. (flymake-proc-stop-all-syntax-checks): Use mapc. Don't affect flymake-proc--processes here. Record interruption reason. (flymake-proc--init-find-buildfile-dir) (flymake-proc--init-create-temp-source-and-master-buffer-copy): Use flymake-proc--panic. (flymake-diagnostic-functions): Add flymake-proc-start-syntax-check. (flymake-proc-compile): Call flymake-proc-stop-all-syntax-checks with a reason. * lisp/progmodes/flymake.el (flymake-backends): Delete. (flymake-check-was-interrupted): Delete. (flymake--diag): Add backend slot. (flymake-delete-own-overlays): Take optional filter arg. (flymake-diagnostic-functions): New user-visible variable. (flymake--running-backends, flymake--disabled-backends): New buffer-local variables. (flymake-is-running): Now a function, not a variable. (flymake-mode-line, flymake-mode-line-e-w) (flymake-mode-line-status): Delete. (flymake-lighter): flymake's minor-mode "lighter". (flymake-report): Delete. (flymake--backend): Delete. (flymake--can-syntax-check-buffer): Delete. (flymake--handle-report, flymake--disable-backend) (flymake--run-backend, flymake--run-backend): New helpers. (flymake-make-report-fn): Make a lambda. (flymake--start-syntax-check): Iterate flymake-diagnostic-functions. (flymake-mode): Use flymake-lighter. Simplify. Initialize flymake--running-backends and flymake--disabled-backends. (flymake-find-file-hook): Simplify. * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): Use flymake-is-running the function. Check if flymake-mode already active before activating it. Add a thorough test for flymake multiple backends * lisp/progmodes/flymake.el (flymake--start-syntax-check): Don't use condition-case-unless-debug, use condition-case * test/lisp/progmodes/flymake-tests.el (flymake-tests--assert-set): New helper macro. (dummy-backends): New test.
2017-09-26 00:45:46 +01:00
(unless (or flymake-mode
(null flymake-diagnostic-functions))
(flymake-mode)
(flymake-log :warning "Turned on in `flymake-find-file-hook'")))
(defun flymake-goto-next-error (&optional n filter interactive)
"Go to Nth next Flymake diagnostic that matches FILTER.
Interactively, always move to the next diagnostic. With a prefix
arg, skip any diagnostics with a severity less than `:warning'.
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
If `flymake-wrap-around' is non-nil and no more next diagnostics,
resumes search from top.
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
FILTER is a list of diagnostic types. Only diagnostics with
matching severities matching are considered. If nil (the
default) no filter is applied."
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
;; TODO: let filter be a number, a severity below which diags are
;; skipped.
(interactive (list 1
(if current-prefix-arg
'(:error :warning))
t))
Flymake diagnostics now apply to arbitrary buffer regions Make Flymake UI some 150 lines lighter Strip away much of the original implementation's complexity in manipulating objects representing diagnostics as well as creating and navigating overlays. Lay some groundwork for a more flexible approach that allows for different classes of diagnostics, not necessarily line-based. Importantly, one overlay per diagnostic is created, whereas the original implementation had one per line, and on it it concatenated the results of errors and warnings. This means that currently, an error and warning on the same line are problematic and the warning might be overlooked but this will soon be fixed by setting appropriate priorities. Since diagnostics can highlight arbitrary regions, not just lines, the faces were renamed. Tests pass and backward compatibility with interactive functions is maintained, but probably any third-party extension or customization relying on more than a trivial set of flymake.el internals has stopped working. * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make constructor syntax. * lisp/progmodes/flymake.el (flymake-ins-after) (flymake-set-at, flymake-er-make-er, flymake-er-get-line) (flymake-er-get-line-err-info-list, flymake-ler-set-file) (flymake-ler-set-full-file, flymake-ler-set-line) (flymake-get-line-err-count, flymake-get-err-count) (flymake-highlight-err-lines, flymake-overlay-p) (flymake-make-overlay, flymake-region-has-flymake-overlays) (flymake-find-err-info) (flymake-line-err-info-is-less-or-equal) (flymake-add-line-err-info, flymake-add-err-info) (flymake-get-first-err-line-no) (flymake-get-last-err-line-no, flymake-get-next-err-line-no) (flymake-get-prev-err-line-no, flymake-skip-whitespace) (flymake-goto-line, flymake-goto-next-error) (flymake-goto-prev-error, flymake-patch-err-text): Delete functions no longer used. (flymake-goto-next-error, flymake-goto-prev-error): Rewrite. (flymake-report): Rewrite. (flymake-popup-current-error-menu): Rewrite. (flymake--highlight-line): Rename from flymake-highlight-line. Call `flymake--place-overlay. (flymake--place-overlay): New function. (flymake-ler-errorp): New predicate. (flymake-ler): Simplify. (flymake-error): Rename from flymake-errline. (flymake-warning): Rename from flymake-warnline. (flymake-warnline, flymake-errline): Obsoletion aliases. * test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc) (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): Use face `flymake-warning'.
2017-09-06 16:03:24 +01:00
(let* ((n (or n 1))
(ovs (flymake--overlays :filter
(lambda (ov)
(let ((diag (overlay-get
ov
'flymake-diagnostic)))
(and diag
(or
(not filter)
(cl-find
(flymake--severity
(flymake--diag-type diag))
filter :key #'flymake--severity)))))
New Flymake variable flymake-diagnostic-types-alist and much cleanup A new user-visible variable is introduced where different diagnostic types can be categorized. Flymake backends can also contribute to this variable. Anything that doesn’t match an existing error type is considered. The variable’s alists are used to propertize the overlays pertaining to each error type. The user can override the built-in properties by either by modifying the alist, or by modifying the properties of a special "category" symbol, named by the `flymake-category' entry in the alist. The `flymake-category' entry is especially useful for, say, the author of foo-flymake-backend, who issues diagnostics of type :foo-note, that should behave like notes, except with no fringe bitmap: (add-to-list 'flymake-diagnostic-types-alist '(:foo-note . ((flymake-category . flymake-note) (bitmap . nil)))) For essential properties like `severity', `priority', etc, a default value is produced. Some properties like `evaporate' cannot be overriden. * lisp/progmodes/flymake.el (flymake--diag): Rename from flymake-ler. (flymake-ler-make): Obsolete alias for flymake-diagnostic-make (flymake-ler-errorp): Rewrite using flymake--severity. (flymake--place-overlay): Delete. (flymake--overlays): Now a cl-defun with &key args. Document. Use `overlays-at' if BEG is non-nil and END is nil. (flymake--lookup-type-property): New helper. (flymake--highlight-line): Rewrite. (flymake-diagnostic-types-alist): New API variable. (flymake--diag-region) (flymake--severity, flymake--face) (flymake--fringe-overlay-spec): New helper. (flymake-popup-current-error-menu): Use new flymake-overlays. (flymake-popup-current-error-menu, flymake-report): Use flymake--diag-errorp. (flymake--fix-line-numbers): Use flymake--diag-line. (flymake-goto-next-error): Pass :key to flymake-overlays * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use flymake-diagnostic-make.
2017-09-07 15:13:39 +01:00
:compare (if (cl-plusp n) #'< #'>)
:key #'overlay-start))
(tail (cl-member-if (lambda (ov)
(if (cl-plusp n)
(> (overlay-start ov)
(point))
(< (overlay-start ov)
(point))))
ovs))
(chain (if flymake-wrap-around
(if tail
(progn (setcdr (last tail) ovs) tail)
(and ovs (setcdr (last ovs) ovs)))
tail))
(target (nth (1- n) chain)))
(cond (target
(goto-char (overlay-start target))
(when interactive
(message
"%s"
(funcall (overlay-get target 'help-echo)
(selected-window) target (point)))))
(interactive
(user-error "No more Flymake diagnostics%s"
(if filter
(format " of %s severity"
(mapconcat #'symbol-name filter ", ")) ""))))))
(defun flymake-goto-prev-error (&optional n filter interactive)
"Go to Nth previous Flymake diagnostic that matches FILTER.
Interactively, always move to the previous diagnostic. With a
prefix arg, skip any diagnostics with a severity less than
`:warning'.
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
If `flymake-wrap-around' is non-nil and no more previous
diagnostics, resumes search from bottom.
Batch of minor Flymake cleanup actions agreed to with Stefan Discussed with Stefan, in no particular order - Remove aliases for symbols thought to be internal to flymake-proc.el - Don’t need :group in defcustom and defface in flymake.el - Fix docstring of flymake-make-diagnostic - Fix docstring of flymake-diagnostic-functions to clarify keywords. - Mark overlays with just the property ’flymake, not ’flymake-overlay - Tune flymake-overlays for performance - Make flymake-mode-on and flymake-mode-off obsolete - Don’t use hash-table-keys unless necessary. - Copyright notice in flymake-elisp. Added some more - Clarify docstring of flymake-goto-next-error - Clarify a comment in flymake--run-backend complaining about ert-deftest. - Prevent compilation warnings in flymake-proc.el - Remove doctring from obsolete aliases Now the changelog: * lisp/progmodes/flymake-elisp.el: Proper copyright notice. * lisp/progmodes/flymake-proc.el (flymake-warning-re) (flymake-proc-diagnostic-type-pred) (flymake-proc-default-guess) (flymake-proc--get-file-name-mode-and-masks): Move up to beginning of file to shoosh compiler warnings (define-obsolete-variable-alias): Delete many obsolete aliases. * lisp/progmodes/flymake.el (flymake-error-bitmap) (flymake-warning-bitmap, flymake-note-bitmap) (flymake-fringe-indicator-position) (flymake-start-syntax-check-on-newline) (flymake-no-changes-timeout, flymake-gui-warnings-enabled) (flymake-start-syntax-check-on-find-file, flymake-log-level) (flymake-wrap-around, flymake-error, flymake-warning) (flymake-note): Don't need :group in these defcustom and defface. (flymake--run-backend): Clarify comment (flymake-mode-map): Remove. (flymake-make-diagnostic): Fix docstring. (flymake--highlight-line, flymake--overlays): Identify flymake overlays with just ’flymake. (flymake--overlays): Reverse order of invocation for cl-remove-if-not and cl-sort. (flymake-mode-on) (flymake-mode-off): Make obsolete. (flymake-goto-next-error, flymake-goto-prev-error): Fix docstring. (flymake-diagnostic-functions): Clarify keyword arguments in docstring. Maybe squash in that one where I remove many obsoletes
2017-09-29 11:02:36 +01:00
FILTER is a list of diagnostic types. Only diagnostics with
matching severities matching are considered. If nil (the
default) no filter is applied."
(interactive (list 1 (if current-prefix-arg
'(:error :warning))
t))
(flymake-goto-next-error (- (or n 1)) filter interactive))
Flymake diagnostics now apply to arbitrary buffer regions Make Flymake UI some 150 lines lighter Strip away much of the original implementation's complexity in manipulating objects representing diagnostics as well as creating and navigating overlays. Lay some groundwork for a more flexible approach that allows for different classes of diagnostics, not necessarily line-based. Importantly, one overlay per diagnostic is created, whereas the original implementation had one per line, and on it it concatenated the results of errors and warnings. This means that currently, an error and warning on the same line are problematic and the warning might be overlooked but this will soon be fixed by setting appropriate priorities. Since diagnostics can highlight arbitrary regions, not just lines, the faces were renamed. Tests pass and backward compatibility with interactive functions is maintained, but probably any third-party extension or customization relying on more than a trivial set of flymake.el internals has stopped working. * lisp/progmodes/flymake-proc.el (flymake-proc--diagnostics-for-pattern): Use new flymake-ler-make constructor syntax. * lisp/progmodes/flymake.el (flymake-ins-after) (flymake-set-at, flymake-er-make-er, flymake-er-get-line) (flymake-er-get-line-err-info-list, flymake-ler-set-file) (flymake-ler-set-full-file, flymake-ler-set-line) (flymake-get-line-err-count, flymake-get-err-count) (flymake-highlight-err-lines, flymake-overlay-p) (flymake-make-overlay, flymake-region-has-flymake-overlays) (flymake-find-err-info) (flymake-line-err-info-is-less-or-equal) (flymake-add-line-err-info, flymake-add-err-info) (flymake-get-first-err-line-no) (flymake-get-last-err-line-no, flymake-get-next-err-line-no) (flymake-get-prev-err-line-no, flymake-skip-whitespace) (flymake-goto-line, flymake-goto-next-error) (flymake-goto-prev-error, flymake-patch-err-text): Delete functions no longer used. (flymake-goto-next-error, flymake-goto-prev-error): Rewrite. (flymake-report): Rewrite. (flymake-popup-current-error-menu): Rewrite. (flymake--highlight-line): Rename from flymake-highlight-line. Call `flymake--place-overlay. (flymake--place-overlay): New function. (flymake-ler-errorp): New predicate. (flymake-ler): Simplify. (flymake-error): Rename from flymake-errline. (flymake-warning): Rename from flymake-warnline. (flymake-warnline, flymake-errline): Obsoletion aliases. * test/lisp/progmodes/flymake-tests.el (warning-predicate-rx-gcc) (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): Use face `flymake-warning'.
2017-09-06 16:03:24 +01:00
;;; Mode-line and menu
;;;
(easy-menu-define flymake-menu flymake-mode-map "Flymake"
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 01:22:15 +01:00
'("Flymake"
[ "Go to next problem" flymake-goto-next-error t ]
[ "Go to previous problem" flymake-goto-prev-error t ]
[ "Check now" flymake-start t ]
[ "List all problems" flymake-show-diagnostics-buffer t ]
"--"
[ "Go to log buffer" flymake-switch-to-log-buffer t ]
[ "Turn off Flymake" flymake-mode t ]))
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 01:22:15 +01:00
(defvar flymake--mode-line-format '(:eval (flymake--mode-line-format)))
(put 'flymake--mode-line-format 'risky-local-variable t)
(defun flymake--mode-line-format ()
"Produce a pretty minor mode indicator."
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-09-30 17:32:53 +01:00
(let* ((known (hash-table-keys flymake--backend-state))
(running (flymake-running-backends))
(disabled (flymake-disabled-backends))
(reported (flymake-reporting-backends))
(diags-by-type (make-hash-table))
(all-disabled (and disabled (null running)))
(some-waiting (cl-set-difference running reported)))
(maphash (lambda (_b state)
(mapc (lambda (diag)
(push diag
(gethash (flymake--diag-type diag)
diags-by-type)))
(flymake--backend-state-diags state)))
flymake--backend-state)
`((:propertize " Flymake"
mouse-face mode-line-highlight
help-echo
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-09-30 17:32:53 +01:00
,(concat (format "%s known backends\n" (length known))
(format "%s running\n" (length running))
(format "%s disabled\n" (length disabled))
"mouse-1: Display minor mode menu\n"
"mouse-2: Show help for minor mode")
keymap
,(let ((map (make-sparse-keymap)))
(define-key map [mode-line down-mouse-1]
flymake-menu)
(define-key map [mode-line mouse-2]
(lambda ()
(interactive)
(describe-function 'flymake-mode)))
map))
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-09-30 17:32:53 +01:00
,@(pcase-let ((`(,ind ,face ,explain)
(cond ((null known)
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 01:22:15 +01:00
'("?" mode-line "No known backends"))
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-09-30 17:32:53 +01:00
(some-waiting
`("Wait" compilation-mode-line-run
,(format "Waiting for %s running backend(s)"
(length some-waiting))))
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-09-30 17:32:53 +01:00
(all-disabled
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 01:22:15 +01:00
'("!" compilation-mode-line-run
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-09-30 17:32:53 +01:00
"All backends disabled"))
(t
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 01:22:15 +01:00
'(nil nil nil)))))
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-09-30 17:32:53 +01:00
(when ind
`((":"
(:propertize ,ind
face ,face
help-echo ,explain
keymap
,(let ((map (make-sparse-keymap)))
(define-key map [mode-line mouse-1]
'flymake-switch-to-log-buffer)
map))))))
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-09-30 17:32:53 +01:00
,@(unless (or all-disabled
(null known))
(cl-loop
with types = (hash-table-keys diags-by-type)
with _augmented = (cl-loop for extra in '(:error :warning)
do (cl-pushnew extra types
:key #'flymake--severity))
for type in (cl-sort types #'> :key #'flymake--severity)
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-09-30 17:32:53 +01:00
for diags = (gethash type diags-by-type)
for face = (flymake--lookup-type-property type
'mode-line-face
'compilation-error)
when (or diags
(cond ((eq flymake-suppress-zero-counters t)
nil)
(flymake-suppress-zero-counters
(>= (flymake--severity type)
(warning-numeric-level
flymake-suppress-zero-counters)))
(t t)))
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-09-30 17:32:53 +01:00
collect `(:propertize
,(format "%d" (length diags))
face ,face
mouse-face mode-line-highlight
keymap
,(let ((map (make-sparse-keymap))
(type type))
(define-key map (vector 'mode-line
mouse-wheel-down-event)
(lambda (event)
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-09-30 17:32:53 +01:00
(interactive "e")
(with-selected-window (posn-window (event-start event))
(flymake-goto-prev-error 1 (list type) t))))
(define-key map (vector 'mode-line
mouse-wheel-up-event)
(lambda (event)
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-09-30 17:32:53 +01:00
(interactive "e")
(with-selected-window (posn-window (event-start event))
(flymake-goto-next-error 1 (list type) t))))
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-09-30 17:32:53 +01:00
map)
help-echo
,(concat (format "%s diagnostics of type %s\n"
(propertize (format "%d"
(length diags))
'face face)
(propertize (format "%s" type)
'face face))
(format "%s/%s: previous/next of this type"
mouse-wheel-down-event
mouse-wheel-up-event)))
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-09-30 17:32:53 +01:00
into forms
finally return
`((:propertize "[")
,@(cl-loop for (a . rest) on forms by #'cdr
collect a when rest collect
'(:propertize " "))
(:propertize "]")))))))
;;; Diagnostics buffer
(defvar-local flymake--diagnostics-buffer-source nil)
(defvar flymake-diagnostics-buffer-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "RET") 'flymake-goto-diagnostic)
(define-key map (kbd "SPC") 'flymake-show-diagnostic)
map))
(defun flymake-show-diagnostic (pos &optional other-window)
"Show location of diagnostic at POS."
(interactive (list (point) t))
(let* ((id (or (tabulated-list-get-id pos)
(user-error "Nothing at point")))
(diag (plist-get id :diagnostic)))
(with-current-buffer (flymake--diag-buffer diag)
(with-selected-window
(display-buffer (current-buffer) other-window)
(goto-char (flymake--diag-beg diag))
(pulse-momentary-highlight-region (flymake-diagnostic-beg diag)
(flymake-diagnostic-end diag)
'highlight))
(current-buffer))))
(defun flymake-goto-diagnostic (pos)
"Show location of diagnostic at POS.
POS can be a buffer position or a button"
(interactive "d")
(pop-to-buffer
(flymake-show-diagnostic (if (button-type pos) (button-start pos) pos))))
(defun flymake--diagnostics-buffer-entries ()
(with-current-buffer flymake--diagnostics-buffer-source
(cl-loop for diag in
(cl-sort (flymake-diagnostics) #'< :key #'flymake-diagnostic-beg)
for (line . col) =
(save-excursion
(goto-char (flymake--diag-beg diag))
(cons (line-number-at-pos)
(- (point)
(line-beginning-position))))
for type = (flymake--diag-type diag)
collect
(list (list :diagnostic diag
:line line
:severity (flymake--lookup-type-property
type
'severity (warning-numeric-level :error)))
`[,(format "%s" line)
,(format "%s" col)
,(propertize (format "%s"
(flymake--lookup-type-property
type 'flymake-type-name type))
'face (flymake--lookup-type-property
type 'mode-line-face 'flymake-error))
(,(format "%s" (flymake--diag-text diag))
mouse-face highlight
help-echo "mouse-2: visit this diagnostic"
face nil
action flymake-goto-diagnostic
mouse-action flymake-goto-diagnostic)]))))
(define-derived-mode flymake-diagnostics-buffer-mode tabulated-list-mode
"Flymake diagnostics"
"A mode for listing Flymake diagnostics."
(setq tabulated-list-format
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 01:22:15 +01:00
`[("Line" 5 ,(lambda (l1 l2)
(< (plist-get (car l1) :line)
(plist-get (car l2) :line)))
:right-align t)
("Col" 3 nil :right-align t)
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 01:22:15 +01:00
("Type" 8 ,(lambda (l1 l2)
(< (plist-get (car l1) :severity)
(plist-get (car l2) :severity))))
("Message" 0 t)])
(setq tabulated-list-entries
'flymake--diagnostics-buffer-entries)
(tabulated-list-init-header))
(defun flymake--diagnostics-buffer-name ()
(format "*Flymake diagnostics for %s*" (current-buffer)))
(defun flymake-show-diagnostics-buffer ()
"Show a list of Flymake diagnostics for current buffer."
(interactive)
(let* ((name (flymake--diagnostics-buffer-name))
(source (current-buffer))
(target (or (get-buffer name)
(with-current-buffer (get-buffer-create name)
(flymake-diagnostics-buffer-mode)
(current-buffer)))))
(with-current-buffer target
(setq flymake--diagnostics-buffer-source source)
(revert-buffer)
(display-buffer (current-buffer)))))
(provide 'flymake)
(require 'flymake-proc)
2004-05-29 12:55:24 +00:00
;;; flymake.el ends here