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

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

[elpa] externals/ivy-hydra 83f04c0 092/395: counsel.el (counsel-flycheck


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 83f04c0 092/395: counsel.el (counsel-flycheck): Add
Date: Thu, 25 Feb 2021 08:31:38 -0500 (EST)

branch: externals/ivy-hydra
commit 83f04c0ec54a3627c3d1476006787f91ca176e17
Author: Rudi Grinberg <me@rgrinberg.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    counsel.el (counsel-flycheck): Add
    
    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
---
 counsel.el | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/counsel.el b/counsel.el
index f8e94db..ea1374a 100644
--- a/counsel.el
+++ b/counsel.el
@@ -6324,6 +6324,29 @@ Local bindings (`counsel-mode-map'):
     (when (fboundp 'advice-remove)
       (advice-remove #'describe-bindings #'counsel-descbinds))))
 
+(defun counsel-flycheck-errors-cands ()
+  (seq-map
+   (lambda (error)
+     (propertize
+      (format "%s:%d:%s"
+              (file-name-base (flycheck-error-filename error))
+              (flycheck-error-line error)
+              (flycheck-error-message error)) 'error error))
+   flycheck-current-errors))
+
+(defun counsel-flycheck-errors-action (error)
+  (flycheck-jump-to-error (get-text-property 0 'error error)))
+
+;;;###autoload
+(defun counsel-flycheck ()
+  "Flycheck errors."
+  (interactive)
+  (require 'flycheck)
+  (ivy-read "flycheck errors: " (counsel-flycheck-errors-cands)
+            :require-match t
+            :action #'counsel-flycheck-errors-action
+            :history 'counsel-flycheck-errors-history))
+
 (provide 'counsel)
 
 ;;; counsel.el ends here



reply via email to

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