flycheck/flycheck — pull request #212 by lunaryorn (2013-09-20 13:35:45+00:00)
Title: Make error level extensible

Provide an API to add new error levels to Flycheck.

# Rationale

Users may wish to create their own syntax checkers with more subtle highlighting, see #211.

# Interface

```lisp
(flycheck-define-error-level 'warning
:overlay-category 'flycheck-warning-overlay
:fringe-bitmap flycheck-fringe-exclamation-mark
:fringe-face 'flycheck-fringe-warning)
```

# Implementation

- Store error level properties in symbol properties of the error level symbol
- When creating overlays, retrieve the categories and fringe settings from the error level again

# Status

- [ ] Add `flycheck-define-error-level`
- [ ] Define built-in error levels
- [ ] Use error level properties when creating overlays and fringe icons
- [ ] Document error levels
- [ ] Add unit tests

# Potential pitfalls

- Do not set the essential `flycheck-overlay` overlay property via overlay categories, as we cannot rely on custom categories to set this symbol as well. Instead, set it directly in `flycheck-add-overlay`
- Do not check error pattern levels in `flycheck-define-checker`