Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

display error message to minibuffer when goto next/prev error. #206

Merged
merged 2 commits into from
Apr 5, 2014

Conversation

notogawa
Copy link
Contributor

@notogawa notogawa commented Apr 4, 2014

When goto-next/prev-error, this PR automatically display error massage in the current line to minibuffer.
Enable us to check the message immediately without open new buffer by M-?.
ghc-init with ghc-display-error-to-minibuffer activate this feature.

@kazu-yamamoto
Copy link
Collaborator

This code could be improved.

  • M-n is always bound to ghc-goto-next-error.
  • defvar ghc-display-error:
  • ghc-goto-next-error. changes its behavior according to:
    -- nil is the current behavior
    -- 'minibuf to display error messages to minibuffer
    -- 'other-buffer to display error message to another buffer (as if M-? follows).

@alanz
Copy link
Collaborator

alanz commented Apr 5, 2014

On the topic of M-n, would it make sense to have an option to prioritise errors over warnings? Sometimes I have a file with lots of warnings (via -wall) and only one or two errors. I want to sort out the errors first, then the warnings.

@notogawa
Copy link
Contributor Author

notogawa commented Apr 5, 2014

alanz, I think your topic should be another issue.

kazu-yamamoto added a commit that referenced this pull request Apr 5, 2014
display error message to minibuffer when goto next/prev error.
@kazu-yamamoto kazu-yamamoto merged commit 2f7a36e into DanielG:master Apr 5, 2014
@kazu-yamamoto
Copy link
Collaborator

Looks good. Merged. Thanks.

@kazu-yamamoto
Copy link
Collaborator

@alanz Does GHC provide both warnings and errors at the same time? If so, please give an example.

@notogawa notogawa deleted the display-minibuf branch April 5, 2014 11:48
@alanz
Copy link
Collaborator

alanz commented Apr 5, 2014

I have seen it on occasion, can't reproduce one now. Will keep my eye out
and report when it happens.

It might be a project wide thing, where if e.g. there is an error in an exe
but and you are editing a lib file. I am basing this on seeing something
like

(Haskell 2:54 ...) in my emacs mode line, indicating 2 errors and 54
warnings

On Sat, Apr 5, 2014 at 1:32 PM, Kazu Yamamoto notifications@github.comwrote:

@alanz https://github.com/alanz Does GHC provide both warnings and
errors at the same time? If so, please give an example.

Reply to this email directly or view it on GitHubhttps://github.com//pull/206#issuecomment-39635505
.

@alanz
Copy link
Collaborator

alanz commented Apr 7, 2014

Attached is a screenshot showing the problem. I was editing the file on the right which is imported by most of the rest of the project and provides types, and changed one of the types. The file I was editing (Utils.hs) has no errors, only warnings, but various other files, including the one on the left then have errors.

As you can see in the highlighted area both errors and warnings are reported, although the errors are for the project as a whole. I suspect it relates to the emacs code not properly updating the warning/error count per buffer.

screenshot from 2014-04-06 15 46 13-annotated

PS, I spent a few minutes trying to reproduce this in a simpler environment without success, I can try again if it is needed

@kazu-yamamoto
Copy link
Collaborator

OK. I will make errors come first.

@alanz
Copy link
Collaborator

alanz commented Apr 8, 2014

Well, for a given file it will be either warnings or errors. In that
specific case there were warnings in the active file, but errors in the
wider project. So I suspect the current behaviour is fine, the question is
more whether the right information is being displayed in the modeline.

On Tue, Apr 8, 2014 at 12:05 AM, Kazu Yamamoto notifications@github.comwrote:

OK. I will make errors come first.

Reply to this email directly or view it on GitHubhttps://github.com//pull/206#issuecomment-39789824
.

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

Successfully merging this pull request may close these issues.

4 participants