Closed dkimbel closed 6 years ago
@Techowl I am pretty much an emacs newbie too :) Could you please open PR? I will try to see if I can come up with a better solution starting from it or else merge it.
@abailly Sure thing! I just opened a pull request at https://github.com/idris-hackers/idris-mode/pull/477.
The Font Lock stuff is pretty hairy, unfortunately, because it tries to support both .lidr files and .idr files. I suspect that what you've written can't be a whole lot simpler without redoing the whole approach.
When writing the mode (and adding the |||
syntax), I hadn't even considered |||
not being at the start of a line! Just goes to show how languages are extra fun :-)
Thanks! I'm closing this issue, since the fix at https://github.com/idris-hackers/idris-mode/pull/477 has been merged.
It looks like
|||
documentation comments only receive syntax highlighting when they start a line or are preceded exclusively by whitespace. So, for instance, the documentation comments in the Type-Driven Development with Idris code blurb below are not fully highlighted.By tweaking
idris-syntax.el
locally, I was able to get highlighting to work for that code.The change I made was to mostly duplicate
idris-syntax.el
's lines 234-236 in a newapply-partially
block on line 237:I'm very much an Emacs newbie -- there's most likely a more elegant solution. I wasn't able to find a straightforward update that wouldn't still require the earlier
line-start
call using the same regex pattern, though.If you'd like me to open a PR with that update, I can -- also, if you have any pointers on a better solution, I'd be very happy to make changes. In any case, thanks for
idris-mode
and your work on Idris itself!