[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra fb6db46 093/395: counsel.el (counsel-flycheck
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra fb6db46 093/395: counsel.el (counsel-flycheck-occur): Add |
Date: |
Thu, 25 Feb 2021 08:31:38 -0500 (EST) |
branch: externals/ivy-hydra
commit fb6db466915a058139e2ea2c427474930fe6788d
Author: Rudi Grinberg <me@rgrinberg.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
counsel.el (counsel-flycheck-occur): Add
Fixes #2404
---
counsel.el | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/counsel.el b/counsel.el
index ea1374a..3553dbe 100644
--- a/counsel.el
+++ b/counsel.el
@@ -6334,9 +6334,36 @@ Local bindings (`counsel-mode-map'):
(flycheck-error-message error)) 'error error))
flycheck-current-errors))
+(defun counsel-flycheck-occur (cands)
+ "Generate a custom occur buffer for `counsel-flycheck'."
+ (require 'thingatpt)
+ (unless cands
+ (message "need to handle empty cands"))
+ (unless (eq major-mode 'ivy-occur-grep-mode)
+ (ivy-occur-grep-mode)
+ (setq default-directory (ivy-state-directory ivy-last)))
+ (swiper--occur-insert-lines
+ (mapcar
+ (lambda (cand)
+ (let ((err (get-text-property 0 'error cand)))
+ (propertize
+ (format
+ "%s:%d:%s"
+ (flycheck-error-filename err)
+ (flycheck-error-line err)
+ (save-excursion
+ (with-current-buffer (flycheck-error-buffer err)
+ (goto-line (flycheck-error-line err))
+ (string-trim (thing-at-point 'line)))))
+ 'error err)))
+ cands)))
+
(defun counsel-flycheck-errors-action (error)
(flycheck-jump-to-error (get-text-property 0 'error error)))
+(ivy-configure 'counsel-flycheck
+ :occur #'counsel-flycheck-occur)
+
;;;###autoload
(defun counsel-flycheck ()
"Flycheck errors."
- [elpa] externals/ivy-hydra e7146dc 066/395: counsel.el (counsel--compilation-errors-buffer): Simplify, (continued)
- [elpa] externals/ivy-hydra e7146dc 066/395: counsel.el (counsel--compilation-errors-buffer): Simplify, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 148f84e 074/395: counsel.el (counsel-git): Work with utf-8 characters, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra bfefd69 075/395: counsel.el (counsel-git-occur): Fixup, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b4d9286 080/395: ivy-test.el (ivy-read-sort-def): Add test, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 41bd988 082/395: ivy.el (ivy-alt-done): In an empty directory with no input return this directory, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0f57db8 079/395: ivy.el (ivy--reset-state): Ensure default values are prepended, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f8eb450 077/395: counsel.el (counsel-register): Fix for file registers in Emacs 27, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7d94e67 087/395: Use the current prompt for shell history initial input, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ce70661 095/395: counsel.el (counsel-grep-function): Simplfy and extend, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 51fe2ce 097/395: counsel.el (counsel--recentf-get-xdg-recent-files): Decode utf-8, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra fb6db46 093/395: counsel.el (counsel-flycheck-occur): Add,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra e3a72a5 096/395: Add XDG recent files to counsel-recentf., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 00e5e0d 099/395: Apply resize to window size change hook., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4875c7b 101/395: ivy.el (ivy-current-match): Add :extend t, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5430e11 107/395: ivy.el (ivy-regex): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f40a465 117/395: ivy.el (ivy-avy-style): New defcustom, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra eb83a3c 110/395: ivy.el (ivy--update-minibuffer): Extract, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5974f06 124/395: counsel.el (counsel-evil-marks): Improve, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b8dd986 112/395: swiper.el (swiper-isearch-format-function): Fix for ivy-prescient, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 526c7aa 113/395: counsel-org-tag-action: message when a tag has been removed., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3fa1677 118/395: counsel.el (counsel--imenu-candidates): Use "Functions" only for Elisp, Basil L. Contovounesios, 2021/02/25