Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose js2-parsed-errors and js2-parsed-warnings in the mode-line #456

Open
lelit opened this issue Oct 6, 2017 · 0 comments
Open

Expose js2-parsed-errors and js2-parsed-warnings in the mode-line #456

lelit opened this issue Oct 6, 2017 · 0 comments

Comments

@lelit
Copy link
Contributor

lelit commented Oct 6, 2017

In Emacs 26, both comint and the new flymake use a nice display of this kind of information in the mode-line. I'm currently using the following customization:

(add-hook 'js2-parse-finished-hook
          (lambda ()
            (setq mode-name "JS2")
            (when (> (length js2-parsed-errors) 0)
              (setq mode-name
                    (list mode-name
                          ":"
                          (propertize (format "%dE" (length js2-parsed-errors))
                                      'face 'error))))
            (when (> (length js2-parsed-warnings) 0)
              (setq mode-name
                    (list mode-name
                          ":"
                          (propertize (format "%dW" (length js2-parsed-warnings))
                                      'face 'warning))))
            (force-mode-line-update)))

but it would be more consistent and nicer using the standard properties to decorate the details, possibly attaching a menu offering next-error and previous-error (flymake binds those to mouse-4 and mouse-5...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant