-
Notifications
You must be signed in to change notification settings - Fork 13
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
Flycheck mixes code and text in org buffer #3
Comments
Right. Flycheck checks full buffers and. It doesn't understand mixed code. The fix might be simple if flycheck allows checking for regions then flycheck function could be re-bound to sniff only inner modes, but it would be very hard if there is no such provision. |
Uninformed question here: how hard would it be for inner mode buffers to only contain the text in that inner section rather than the full buffer text? For instance, imagine you had some file, file.org: file.org:
Where the file.org[c] file would only consist of
It seems like this could solve a number of existing as well as potential issues related to the one brought up here and that wouldn't rely on the capabilities of external tools. I believe I experienced a thematically-similar issue when using I appreciate that I understand nothing of how polymode is implemented so please let me know if that's the case. However, I am curious about this. |
Polymode relies on indirect buffers. All the inner mode buffers are inirect buffers derived from the initial buffer. Unfortunately, all indirect buffers must contain all the text of the initial buffer and all the changes in the indirect buffers automatically propagate to the initial buffer. I don't know any obvious way to make the text in the indirrect buffers differ from the initial buffer as in your example. @vspinu On a side note, I am currently working (very very slowly, though) on a way to achieve indirect buffer-like functionality, which operates on regions of text. How feasible would it be to adapt polymode to such kind of functionality? |
That's for sure not possible and I don't believe it's useful. In most of the non-trivial cases code in one chunk depends on the code in previous chunks. So isolating it in separate buffer is useless even for the flycheck example here. What flycheck support for polymode should do, is to send to flycheck a temporary buffer/file with all the other spans except of the curent mode's ones commented out. This part should be straightforward enough. Unfortunately I am so busy till the end of the year and maybe beyond that I won't be able to look at this any time soon. |
Is there a way to disable |
I'd be happy to help with that. But commenting out may not be enough, since some checkers return errors as an offset from the start of the buffer, not as a line and column number. Here's what I use for now, which disables Flycheck in indirect buffers.
|
When flycheck is enabled in the major mode of code blocks, it actually checks all the org buffer when in poly-org mode.
As a result, many flycheck errors are actually triggering on the text in buffer.
The text was updated successfully, but these errors were encountered: