Skip to content

Highlight error, undefined with font-lock-warning-face. #386

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

Closed
wants to merge 1 commit into from

Conversation

ikirill
Copy link
Contributor

@ikirill ikirill commented Dec 1, 2014

Both are very special symbols; this is similar to emacs-lisp-mode, for
example.

Both are very special symbols; this is similar to emacs-lisp-mode, for
example.
@gracjan
Copy link
Contributor

gracjan commented Mar 15, 2015

I am partial to this one. I understand that it is good to highlight keywords that should not appear in production code but then error and undefined aren't real keywords and also there are plenty of other functions that should not appear in production code like head or fromJust.

Meanwhile there is also throw, throwIO and friends that signal local errors in code and those would also be worth highlighting.

@ivan-m
Copy link
Contributor

ivan-m commented Mar 15, 2015

I think undefined is worth highlighting as a warning; I'm not so sure about error but it would probably be worth it.

I think adding every single partial function to be marked like this might be a bit excessive though.

But if this is meant to be a face for warnings (i.e. "are you really sure you want to have this here?") then throw and throwIO probably don't belong (as they are valid to use within user code, and preferable to using error).

@gracjan
Copy link
Contributor

gracjan commented Jun 18, 2015

We are working on #724, so your simple fix will be obsolete. We need a more principled approach.

@gracjan gracjan closed this Jun 18, 2015
@themattchan
Copy link

themattchan commented Aug 4, 2016

Why have these definitions been removed from the master?

@gracjan
Copy link
Contributor

gracjan commented Aug 4, 2016

I sense you would like to have these definitions back, if so please create a PR and include test cases. Thanks.

@mrBliss
Copy link
Contributor

mrBliss commented Aug 8, 2016

@themattchan you can add the following lines to your config to revert these changes:

(font-lock-add-keywords
  'haskell-mode
  '(("\\_<\\(error\\|undefined\\)\\_>" . 'font-lock-warning-face)))

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

Successfully merging this pull request may close these issues.

5 participants