emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/flymake-popon cb66ecf122 2/8: Use different faces for diff


From: ELPA Syncer
Subject: [nongnu] elpa/flymake-popon cb66ecf122 2/8: Use different faces for different diagnostic types
Date: Sun, 22 May 2022 12:58:38 -0400 (EDT)

branch: elpa/flymake-popon
commit cb66ecf122f24cb45fd99d2afb30d1e394a34971
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Use different faces for different diagnostic types
---
 flymake-popon.el | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/flymake-popon.el b/flymake-popon.el
index 02287dd721..63fc7d19d5 100644
--- a/flymake-popon.el
+++ b/flymake-popon.el
@@ -87,6 +87,21 @@ The value should be in seconds."
   '((t :inherit default))
   "Default face for popon/posframe.")
 
+(defface flymake-popon-note
+  '((t :inherit compilation-info))
+  "Face for showing diagnotic of level :note."
+  :group 'capital)
+
+(defface flymake-popon-warning
+  '((t :inherit compilation-warning))
+  "Face for showing diagnotic of level :warning."
+  :group 'capital)
+
+(defface flymake-popon-error
+  '((t :inherit compilation-error))
+  "Face for showing diagnotic of level :error."
+  :group 'capital)
+
 (defface flymake-popon-posframe-border
   '((t :foreground "black"))
   "Border face.  Only foreground is used, others are ignored.")
@@ -101,8 +116,14 @@ The value should be in seconds."
   "Format DIAGNOSTIC to text."
   (with-temp-buffer
     (insert
-     (concat "* " (car (split-string (flymake-diagnostic-text diagnostic)
-                                     "[\n\r]+"))))
+     "* "
+     (propertize
+      (car (split-string (flymake-diagnostic-text diagnostic) "[\n\r]+"))
+      'face (plist-get (list :note 'flymake-popon-note
+                             :warning 'flymake-popon-warning
+                             :error 'flymake-popon-error)
+                       (flymake-diagnostic-type diagnostic))))
+    (message "%S" (flymake-diagnostic-type diagnostic))
 
     ;; Break long lines.
     (goto-char (point-min))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]