Skip to content

Error thrown by flycheck segment #29

@oscarfv

Description

@oscarfv

I'm not sure if it is a change on flycheck or a change on Emacs (I'm using the master branch) but the segment started failing with:

propertize: Wrong type argument: numberp, nil

I think that the problematic part is:

(al (push (cons 'success (alist-get 'info errors 0)) errors))

If I try to message the contents of al I get errors like:

string-join: Lisp nesting exceeds ‘max-lisp-eval-depth’: 1601

For now, I'm using this patch:

--- a/singles/mini-echo-segments.el
+++ b/singles/mini-echo-segments.el
@@ -821,13 +821,16 @@ (mini-echo-define-segment "flycheck"
                         ('running "*")
                         ('finished nil))))
        (propertize ind 'face 'compilation-mode-line-run))
-     (let* ((errors (flycheck-count-errors flycheck-current-errors))
-            (al (push (cons 'success (alist-get 'info errors 0)) errors)))
-       (mapconcat
-        (lambda (s)
-          (propertize (number-to-string (alist-get s al)) 'face s))
-        '(error warning success)
-        "/")))))
+     (let-alist (flycheck-count-errors flycheck-current-errors)
+       (concat
+	(propertize (number-to-string (or .error 0))
+		    'face (if .error 'error 'success))
+	"/"
+	(propertize (number-to-string (or .warning 0))
+		    'face (if .warning 'warning 'success))
+	"/"
+	(propertize (number-to-string (or .info 0))
+		    'face (if .warning 'info 'success)))))))
 
 (mini-echo-define-segment "meow"
   "Return the meow status of current buffer."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions