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

cannot open a file when a long flycheck message is displayed #648

Closed
soonhokong opened this Issue May 26, 2015 · 29 comments

Comments

Projects
None yet
3 participants
@soonhokong

soonhokong commented May 26, 2015

Reproduce Steps

  1. Set up an example checker for text-mode:

    (flycheck-define-checker example-checker
                         "Example Checker"
                         :command ("echo" "1:1:"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n")
                         :error-patterns
                         ((error line ":" column ":"
                                 (message (one-or-more (zero-or-more not-newline) "\n"))))
                         :modes text-mode)
    (add-to-list 'flycheck-checkers 'example-checker)
  2. Open a text file, turn on flycheck-mode. Place cursor on the first line, it shows the long flycheck error message.
    screen shot 2015-05-26 at 11 32 59 am

  3. Open a CPP file (test.cpp) via find-file.
    screen shot 2015-05-26 at 11 34 34 am

Bug

It does not show the opened test.cpp file with an error message "Buffer test.txt is not a CC Mode buffer (c-set-style)". Note that the file test.cpp is added to the buffer list. If we run the find-file command again, it shows the file.

It shows the same problem when I try to open a file where flycheck-mode is enabled. Manually disabling flycheck-mode for a certain type of files resolves the issue. It seems there is a conflict between showing a long flycheck message and opening another buffer and enabling flycheck-mode for that buffer.

Env

  • OSX 10.10
  • Emacs 24.5.1

I have team members who reported me the same issue. They're using Ubuntu-12.04 and Emacs 24.4.

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented May 26, 2015

@soonhokong Please reproduce this issue in a clean Emacs session with emacs -q, to rule out an issues caused by other extensions and packages installed in your Emacs. In particular, I'd like to avoid that your lean-flycheck.el library is loaded.


I mean no offense, but much of what you do in this library is wrong or broken or both, to a degree that if you had opened this issue with a lean file as example I'd have closed it right away without further investigation as upstream bug. Specifically:

  • eval around flycheck-define-checker breaks byte compilation and scoping. Please use flycheck-define-command-checker if you need to create :command dynamically.
  • lean-flycheck-command is entirely redundant: M-x flycheck-mode does exactly the same.
  • What is the purpose of lean-flycheck-toggle-use and lean-flycheck-use? Are you aware that flycheck-mode is variable, too, which you can use to check whether Flycheck is active in the current buffer?
  • Please don't use an advice to increment error columns. Flycheck has :error-filters and there is even a built-in one exactly for your use case: :error-filter flycheck-increment-error-columsn. Generally never use advises at all in libraries or modes. They are for user configuration, or as a very last resort only.
  • Why exactly do you need lean-flycheck-delete-temporaries? Flycheck deletes its own temporaries again after each check.
  • What is lean-flycheck-error-list-buffer-width for?!

Please excuse my rather harsh tone, but I feel a little frustrated to see such blatant mistakes that is prone to cause issues for users of my library, and that could have easily been avoided by reading the documentation and the code of Flycheck (there are comprehensive docstrings, and a lot of built-in syntax checkers to serve as examples), or by simply asking me.

I urge you to fix these issues. As long as your code is in this shape, you are on your own: I'll refuse to fix, or even care for, any Flycheck issues reported in relation to Lean Mode.

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented May 26, 2015

@soonhokong Following your instructions, I failed to reproduce this issue in Emacs 24.5 and 25.1, using clean emacs -Q sessions. Please verify that you are indeed able to reproduce this issue in emacs -Q.

@soonhokong

This comment has been minimized.

soonhokong commented May 26, 2015

@lunaryorn, thanks for the suggestions for lean-flycheck.el. I'll work on them as soon as possible.

Please verify that you are indeed able to reproduce this issue in emacs -Q.

I can confirm that I can't reproduce the problem with emacs -Q either. There must be some configuration problems in my c++ mode setup.

@soonhokong soonhokong closed this May 26, 2015

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented May 26, 2015

I might be able to help with this if you could show me a backtrace for this error. You can obtain one by enabling debugging with M-x toggle-debug-on-error.

@soonhokong

This comment has been minimized.

soonhokong commented May 26, 2015

@lunaryorn, I really appreciate your comments and suggestions. I understand your concerns and frustrations because sometimes I have similar feelings when I work on my own open-source projects.

As you may notice, I've made two commits to fix the two issues that you pointed out:

  • eval around flycheck-define-checker breaks byte compilation and scoping. Please use flycheck-define-command-checker if you need to create :command dynamically. (via soonhokong/lean@13908ee)
  • Please don't use an advice to increment error columns. Flycheck has :error-filters and there is even a built-in one exactly for your use case: :error-filter flycheck-increment-error-columsn. Generally never use advises at all in libraries or modes. They are for user configuration, or as a very last resort only. (via soonhokong/lean@67c01ff)

For the following items, I have some excuses. If you still think that they are unreasonable, please let me know. I'm really happy to know.

  • lean-flycheck-command is entirely redundant: M-x flycheck-mode does exactly the same.

(lean-flycheck-command) returns :command part of syntax checker. An example is ("/Users/soonhok/lean/bin/linja" "--flycheck" source-inplace).

  • What is the purpose of lean-flycheck-toggle-use and lean-flycheck-use? Are you aware that flycheck-mode is variable, too, which you can use to check whether Flycheck is active in the current buffer?

lean-flycheck-use is a custom variable in Lean mode which indicates whether users want to use flycheck or not.

  • Why exactly do you need lean-flycheck-delete-temporaries? Flycheck deletes its own temporaries again after each check.

When a Lean file is compiled, it generates some auxiliary files such as (.clean) and index (.ilean). I don't think flycheck automatically detects those files and remove them. Is there such a feature?

  • What is lean-flycheck-error-list-buffer-width for?!

We try to detect the current buffer-width of flycheck-error window and send it to Lean so that the error messages can be pretty-printed (hopefully) in a better shape.

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented May 30, 2015

@soonhokong Sorry, I meant lean-toggle-flycheck-mode. This command is entirely redundant with flycheck-mode, so you can safely remove it.

Please also remove lean-flycheck-use: It's not a major mode's business to enable minor modes on behalf of some customization options. If a user wants Flycheck they should enable Global Flycheck Mode explicitly, as per Flycheck's documentation.

And finally please consider removing lean-flycheck-error-list-buffer-width, too: It is a flaky and unreliable hack. The width of the error list can change at any time, unrelated to any ongoing syntax check, and Flycheck messages may be displayed in many places other than the error list. It's not a syntax checker's business to try and guess how error messages are displayed in an editor. Just let Flycheck do the display, and if there's something to improve, please open a separate issue on Flycheck to discuss improvements to the display of error messages.

With regards to temporary files: Flycheck provides no feature to remove auxiliary temporary files, because it has no chance to detect these. However, letting the checker generate arbitrary files is the wrong approach in my opinion. Is there no option to tell lean to omit the generation of these files, or at least write them to some other directory? In that case, you could use the temporary-directory argument to move the output out of the way (take a look at the erlang for an example).

@soonhokong

This comment has been minimized.

soonhokong commented May 30, 2015

@lunaryorn, thanks for suggestions. I'll definitely do another round of clean-up soon by following your suggestions.

@soonhokong

This comment has been minimized.

soonhokong commented May 30, 2015

By the way, I found a way to reproduce the problem for which I opened this issue. I made sure that it can be reproduced with emacs -q. Here is the steps:

  1. Open emacs with -q option. Save two text files, namely, text1.txt and text2.txt.

  2. Copy & paste the following in a scratch buffer, and do eval-buffer.

    (package-initialize)
    (require 'flycheck)
    (flycheck-define-command-checker 'example-checker
             "Example Checker"
             :command '("echo" "1:1:"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"                                   
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
                   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n")
             :error-patterns
             '((error line ":" column ":"
                 (message (one-or-more (zero-or-more not-newline) "\n"))))
             :modes 'text-mode)
    (add-to-list 'flycheck-checkers 'example-checker)
    (add-hook 'text-mode-hook (lambda () (flycheck-mode t)))
  3. Open text1.txt
    screen shot 2015-05-30 at 11 07 06 am

  4. Open text2.txt. emacs is not showing it while text2.txt is in the buffer list.

I can reproduce it on my mac (OSX 10.10 + emacs-24.4) and Linux machine (Ubuntu-12.04 + emacs-24.3).

@lunaryorn lunaryorn added kind: bug and removed status: invalid labels May 30, 2015

@lunaryorn lunaryorn reopened this May 30, 2015

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented May 30, 2015

I'll take look then. Reopening.

@lunaryorn lunaryorn modified the milestone: 0.24 Jun 8, 2015

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Jul 6, 2015

@soonhokong I've tried but I failed to reproduce in Emacs 25.1, with emacs -Q and your recipe, using the latest Flycheck version on MELPA.

If you still see this issue, please follow my advice from above, and enable the debugger to obtain a backtrace. Please paste the resulting backtrace in a comment.

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Jul 20, 2015

@soonhokong Closing due to inactivity. If you can provide a traceback of this error please add a comment, and I'll reopen the issue.

@soonhokong

This comment has been minimized.

soonhokong commented Dec 14, 2015

@lunaryorn, sorry for the very late response. I just tried to reproduce the issue again, and was able to reproduce it. Here is my environment:

  • Ubuntu-12.04
  • GNU Emacs 25.1.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2015-12-13

Here is the screencast that I recorded. I also notice that it requires a smaller terminal width to reproduce the problem. I hope this helps.

@cpitclaudel

This comment has been minimized.

Member

cpitclaudel commented Dec 14, 2015

Hi @soonhokong. I had a look at this, but I can't reproduce it either (on Linux Mint). Could you maybe use M-x toggle-debug-on-error to see if the debugger reports an error after your first attempt to open the second file?

@soonhokong

This comment has been minimized.

soonhokong commented Dec 14, 2015

Could you maybe use M-x toggle-debug-on-error to see if the debugger reports an error after your first attempt to open the second file?

It doesn't trigger the debugger. It gives nothing to the *Messages* buffer either.

@soonhokong

This comment has been minimized.

soonhokong commented Dec 14, 2015

I'm happy to share a digital ocean VM where I installed Ubuntu-14.04 + emacs-25-1.50.2 + flycheck (20151212). If you want this, please send me an email (soonhok at cs/cmu/edu)

@soonhokong

This comment has been minimized.

soonhokong commented Dec 14, 2015

One observation: please make sure that you don't have test2.txt in your *Buffer List* when you make the first attempt. At the second attempt, I think it works because the buffer for test2.txt is already there (which is created by the first attempt).

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Dec 14, 2015

@soonhokong I don't think a VM will help us. I'd rather prefer if you could compile a recipe to reproduce this issue in emacs -Q.

This would allow us to reproduce the issue in our own Emacs setup, and it would rule out your Emacs configuration as a factor.

@lunaryorn lunaryorn reopened this Dec 14, 2015

@lunaryorn lunaryorn removed this from the 0.24 milestone Dec 14, 2015

@lunaryorn lunaryorn added blocked and removed status: invalid labels Dec 14, 2015

@soonhokong

This comment has been minimized.

soonhokong commented Dec 14, 2015

it would rule out your Emacs configuration as a factor.

I'm sure that my emacs configuration is not a factor, because I can reproduce it in a fresh VM. I only added MELPA to install flycheck, nothing else.

I'd rather prefer if you could compile a recipe to reproduce this issue in emacs -Q.

OK. Here it is:

  • Prepare two text files - test1.txt and test2.txt

  • Run emacs -Q

  • Evaluate the following elisp in your scratch buffer:

    (package-initialize)
    (require 'flycheck)
    (flycheck-define-command-checker 'example-checker
         "Example Checker"
         :command '("echo" "1:1:"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n")
         :error-patterns
         '((error line ":" column ":"
             (message (one-or-more (zero-or-more not-newline) "\n"))))
         :modes 'text-mode)
    (add-to-list 'flycheck-checkers 'example-checker)
    (add-hook 'text-mode-hook (lambda () (flycheck-mode t)))
  • Open test1.txt, locate the cursor at the first word so that emacs shows *Flycheck error messages* buffer.

  • Try to open test2.txt (via C-c C-f). It will fail to switch the buffer from test1.txt to test2.txt.

Here is the screencast that I mentioned above.

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Dec 14, 2015

@soonhokong Ah, sorry, I hadn't seen that the screencast actually implied emacs -q—note, though, that I generally prefer emacs -Q with uppercase q because that also disables all system-wide Emacs packages, i.e. those installed with apt-get.

You've also said that the problem requires a “smaller terminal width”. Can you define that more precisely, i.e. give a number of columns and rows the terminal should have?

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Dec 14, 2015

@soonhokong Oh, I'm indeed able to reproduce the issue with your recipe. I don't know why I failed to reproduce it initially; I'm sorry to have bothered you with pointless comments and stupid questions. I should have tried harder to reproduce. Sorry.

I'm not sure where the problem comes from. I've tried a couple of things while the error shows with test1.txt open, including

  • M-: (setq flycheck-display-errors-function nil)
  • M-: (remove-hook 'post-command-hook 'flycheck-hide-error-buffer 'local)

but none of these enabled me to successfully switch to text2.txt while the buffer was open. I must admit that I'm really really lost here.

I'll try to step through this issue with a mixture of edebug, debug-on-entry and debug-on-quit, hoping that I'll be able to isolate the cause, but that'll be a somewhat longer task and it'll take a while until I'll be able to save some time for this issue. The days before Christmas are just too busy for me 😞

I know that you've waited for a long time already, but I'm afraid I have to ask you to still be patient and wait for us to fix this issue. Unless someone else comes up with a fix, it'll likely take quite some time before we are able to isolate and fix the issue. 😞

I'm sorry. A patch or a pull request, or any piece of information however small that helps us to identify the cause of this issue would be awesome ☺️

@lunaryorn lunaryorn added ready and removed blocked labels Dec 14, 2015

@soonhokong

This comment has been minimized.

soonhokong commented Dec 14, 2015

@lunaryorn, Great! Thanks for all the efforts. I really appreciate.

I know that you've waited for a long time already, but I'm afraid I have to ask you to still be patient and wait for us to fix this issue. Unless someone else comes up with a fix, it'll likely take quite some time before we are able to isolate and fix the issue.

I totally understand. Please take your time and make a comment here if you find anything.

I'm sorry. A patch or a pull request, or any piece of information however small that helps us to identify the cause of this issue would be awesome ☺️

I'll try to investigate it on my side as well.

@cpitclaudel

This comment has been minimized.

Member

cpitclaudel commented Dec 14, 2015

@soonhokong Thanks for your perseverance. Indeed, I can reproduce this too. Yay!

@soonhokong, @lunaryorn I think I know what's going on. Here's a quick summary:

Opening test2 calls the following sequence of functions:
find-file > find-file-noselect > find-file-noselect-1 > after-find-file > normal-mode > set-auto-mode > set-auto-mode-0 > text-mode > run-mode-hooks > run-hooks (change-major-mode-after-body-hook text-mode-hook) > flycheck-mode > flycheck-clear > flycheck-hide-error-buffer > quit-window > quit-restore-window > select-window.

Now here's the documentation of select-window:

Select WINDOW which must be a live window.
Also make WINDOW’s frame the selected frame and WINDOW that frame’s
selected window.  In addition, make WINDOW’s buffer current and set its
buffer’s value of ‘point’ to the value of WINDOW’s ‘window-point’.

The import part is make WINDOW’s buffer current. This is crucial, because it changes the value of (current-buffer) (from test2 to test1), which is what find-file-noselect returns, which is in turn what find-file displays.

In more details, the whole sequence of calls happens inside a (with-current-buffer macro, wrapped around the code of find-file-noselect-1, which sets the current buffer to the buffer newly created by find-file-noselect:

(defun find-file-noselect-1 (buf filename nowarn rawfile truename number)
  (with-current-buffer buf
    ...
    (after-find-file error (not nowarn))
    (current-buffer)))

Thus everything in ... happens with the right current-buffer, but then after-find-file changes the current buffer to the original test1 buffer (this happens deep down the call chain, through select-window).

Since find-file-noselect passes on the return value of find-file-noselect-1, and since find-file then calls switch-to-buffer on that return value, test1 just gets re-displayed.

@cpitclaudel

This comment has been minimized.

Member

cpitclaudel commented Dec 14, 2015

Btw, the reason this happens only once and the second call to find-file succeeds is that a different code path is taken in quit-restore-window.

@cpitclaudel

This comment has been minimized.

Member

cpitclaudel commented Dec 14, 2015

Here's a patch that fixes the issue for me:

@@ -4141,7 +4141,8 @@ Hide the error buffer if there is no error under point."
   (-when-let* ((buffer (flycheck-error-message-buffer))
                (window (get-buffer-window buffer)))
     (unless (flycheck-overlays-at (point))
-      (quit-window nil window))))
+      (save-selected-window
+        (quit-window nil window)))))

I have no idea whether that's actually what we want to do, though.

@soonhokong, could you maybe try it? The simplest way would be to add this to the end of your minimal example and run it again.

(defun flycheck-hide-error-buffer ()
  "Hide the Flycheck error buffer if necessary.

Hide the error buffer if there is no error under point."
  (-when-let* ((buffer (flycheck-error-message-buffer))
               (window (get-buffer-window buffer)))
    (unless (flycheck-overlays-at (point))
      (save-selected-window
        (quit-window nil window)))))
@soonhokong

This comment has been minimized.

soonhokong commented Dec 14, 2015

@cpitclaudel, it works!!!

@cpitclaudel

This comment has been minimized.

Member

cpitclaudel commented Dec 14, 2015

Great news. I'll be happy to have @lunaryorn's opinion on this fix; window configurations are not my speciality at all. Thanks a lot for reporting this bug; it was a pretty tricky one.

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Dec 14, 2015

@cpitclaudel Jesus, what a mess. Thank you soooo much for diving head first into this and coming out with a great solution 👍 That's so awesome 😍

I think that your fix is sound, please feel free to push it to master. But please add a comment that explains why we have save-selected-window here and add the URL of this issue. Just so I don't forget why it was there in a year from now and accidentally "optimise" it away ☺️

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Dec 14, 2015

@soonhokong Thank you for pushing us through this bug, and for your patience!

@soonhokong

This comment has been minimized.

soonhokong commented Dec 14, 2015

@lunaryorn and @cpitclaudel, thanks a lot for paying attention to this issue. I appreciate all the efforts!

@lunaryorn lunaryorn removed the ready label Dec 16, 2015

lunaryorn added a commit that referenced this issue Dec 16, 2015

0xbzho added a commit to 0xbzho/asciinema.org-2015-10 that referenced this issue Mar 1, 2016

Flycheck Issue #648
Env: Ubuntu-12.04 + GNU Emacs 25.1.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2015-12-13

* Start emacs with "-q" option
* Load the prepared script ( available%20at%20flycheck/flycheck#648 (comment) )
* Open test1.txt, put the cursor at line 1, column 1.
* Find-file test2.txt. It doesn't work.
* Try again to find-file test2.txt. It works this time.

Note: At step 4, emacs actually opens the test2.file, but it doesn't switch to the buffer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment