vermiculus / sx.el

Stack Exchange for Emacs
http://stackapps.com/q/3950
709 stars 40 forks source link

syntax highlighting for code #297

Open ChillarAnand opened 9 years ago

ChillarAnand commented 9 years ago

sx

it will be good if there is syntax highlighting for code.

Malabarba commented 9 years ago

There usually is, it's just a little hard to identify whether a block is code or text, and what language sould be used to highlight in that case. For instance, we don't yet check for language tags, we just use some reasonable heuristics.

Could you provide a link to that post so that we can figure out what to do?

ChillarAnand commented 9 years ago

@Malabarba http://stackoverflow.com/questions/31167228/python-list-to-dict-conversion-confusion

thanks for amazing sx.el!!

Malabarba commented 9 years ago

Ok thanks. This is indeed one of those cases that would be solved if we took question tags into consideration. @vermiculus and I have been very busy lately, but I promise we'll get to it at some point!

stardiviner commented 8 years ago

Will it be slow if we toggle syntax highlight on big source code block? Like Org-mode, it will slow down.

Malabarba commented 8 years ago

@stardiviner No, it shouldn't be slow because we only perform syntax highlighting once (when the question buffer is first created), whereas typical major-modes usually have to do it on every redisplay.

stardiviner commented 8 years ago

I see. That's great.

ylluminarious commented 7 years ago

Any progress on this? It seems like it should be fairly easy to implement and it would really help when reading posts that have a lot of code.

vermiculus commented 7 years ago

No progress as of yet that I'm aware of (both of us are very busy and really can only find the time for things we need at this moment), but pull requests are welcome!

ylluminarious commented 7 years ago

@vermiculus Alright. Do you think you could give any advice on where to start for implementing this?

vermiculus commented 7 years ago

You're going to want to start around sx-question-mode--insert-markdown.