diff options
| author | João Távora | 2019-11-02 16:38:53 +0000 |
|---|---|---|
| committer | João Távora | 2019-11-02 16:38:53 +0000 |
| commit | adb5f45d7bc4612916a5b8e4bd2b92d49119b57a (patch) | |
| tree | 7a4f87c4e8023ad8765734d4a2fcab6bff8fe680 /lisp | |
| parent | 455e753a2b8fa2e83d23be1771f3371ba90b85f9 (diff) | |
| download | emacs-adb5f45d7bc4612916a5b8e4bd2b92d49119b57a.tar.gz emacs-adb5f45d7bc4612916a5b8e4bd2b92d49119b57a.zip | |
Allow flymake diagnostic types to have shorter names
Eglot, a third-party package which uses Flymake, has its own
diagnostic types such as 'eglot-error', 'eglot-warning', etc... While
not being too long, they will not fit in the type column of the "list
all diagnostics" buffer. This commit allows diagnostic types to have
user-defined names and also assigns names to the default categories.
* doc/misc/flymake.texi (Flymake error types): Describe
flymake-type-name prop.
* lisp/progmodes/flymake.el (flymake--diagnostics-buffer-entries):
Use type names.
(flymake-error, flymake-warning, flymake-note): Give these
diagnostic categories default type names.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/flymake.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index e394096e23e..f052e002df7 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -553,16 +553,19 @@ Node `(Flymake)Flymake error types'" | |||
| 553 | (put 'flymake-error 'flymake-bitmap 'flymake-error-bitmap) | 553 | (put 'flymake-error 'flymake-bitmap 'flymake-error-bitmap) |
| 554 | (put 'flymake-error 'severity (warning-numeric-level :error)) | 554 | (put 'flymake-error 'severity (warning-numeric-level :error)) |
| 555 | (put 'flymake-error 'mode-line-face 'compilation-error) | 555 | (put 'flymake-error 'mode-line-face 'compilation-error) |
| 556 | (put 'flymake-error 'flymake-type-name "error") | ||
| 556 | 557 | ||
| 557 | (put 'flymake-warning 'face 'flymake-warning) | 558 | (put 'flymake-warning 'face 'flymake-warning) |
| 558 | (put 'flymake-warning 'flymake-bitmap 'flymake-warning-bitmap) | 559 | (put 'flymake-warning 'flymake-bitmap 'flymake-warning-bitmap) |
| 559 | (put 'flymake-warning 'severity (warning-numeric-level :warning)) | 560 | (put 'flymake-warning 'severity (warning-numeric-level :warning)) |
| 560 | (put 'flymake-warning 'mode-line-face 'compilation-warning) | 561 | (put 'flymake-warning 'mode-line-face 'compilation-warning) |
| 562 | (put 'flymake-warning 'flymake-type-name "warning") | ||
| 561 | 563 | ||
| 562 | (put 'flymake-note 'face 'flymake-note) | 564 | (put 'flymake-note 'face 'flymake-note) |
| 563 | (put 'flymake-note 'flymake-bitmap 'flymake-note-bitmap) | 565 | (put 'flymake-note 'flymake-bitmap 'flymake-note-bitmap) |
| 564 | (put 'flymake-note 'severity (warning-numeric-level :debug)) | 566 | (put 'flymake-note 'severity (warning-numeric-level :debug)) |
| 565 | (put 'flymake-note 'mode-line-face 'compilation-info) | 567 | (put 'flymake-note 'mode-line-face 'compilation-info) |
| 568 | (put 'flymake-note 'flymake-type-name "note") | ||
| 566 | 569 | ||
| 567 | (defun flymake--lookup-type-property (type prop &optional default) | 570 | (defun flymake--lookup-type-property (type prop &optional default) |
| 568 | "Look up PROP for diagnostic TYPE. | 571 | "Look up PROP for diagnostic TYPE. |
| @@ -1336,7 +1339,9 @@ POS can be a buffer position or a button" | |||
| 1336 | 'severity (warning-numeric-level :error))) | 1339 | 'severity (warning-numeric-level :error))) |
| 1337 | `[,(format "%s" line) | 1340 | `[,(format "%s" line) |
| 1338 | ,(format "%s" col) | 1341 | ,(format "%s" col) |
| 1339 | ,(propertize (format "%s" type) | 1342 | ,(propertize (format "%s" |
| 1343 | (flymake--lookup-type-property | ||
| 1344 | type 'flymake-type-name type)) | ||
| 1340 | 'face (flymake--lookup-type-property | 1345 | 'face (flymake--lookup-type-property |
| 1341 | type 'mode-line-face 'flymake-error)) | 1346 | type 'mode-line-face 'flymake-error)) |
| 1342 | (,(format "%s" (flymake--diag-text diag)) | 1347 | (,(format "%s" (flymake--diag-text diag)) |