Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 153 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Possible Duplicate:
Syntax highlighting language hints

Sometimes it happens that the snippet could be interpreted to be in a programming language, when really it's another one. If the snippet is not long enough, a Java snippet could be confused with C++ code, or vice versa.

Is there a way to suggest to the highlighter the programming language used for a snippet?

share|improve this question

marked as duplicate by ChrisF, waiwai933, Grace Note, Andy E, Aarobot Aug 24 '10 at 18:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

The questions are slightly different; in the other one (dated June 30) is asked to add syntax highlighting hints, while this question is asking if it is possible to force the highlighter to use a specific language. As far as I know, the syntax highlighting hints could be already implemented, and I simply don't know how to use them. – kiamlaluno Aug 24 '10 at 15:51
@kia: slightly different isn't usually enough to stop your question being closed as a dupe :-) You can see from the other question that it's not possible to do what you're asking, hence the feature-request tag. – Andy E Aug 24 '10 at 16:05
@Andy E's head: Doe that mean that when a feature request is implemented, the feature request is marked in a particular way? I am quite not familiar on what you do with a feature request when the feature has been implemented. – kiamlaluno Aug 24 '10 at 16:13
@kia, an admin will add the tag [status-completed]; it even shows up in red. – Pops Aug 24 '10 at 18:00
@kiamlaluno Check the feature request for one of two things: the "status-completed" tag, and an answer (usually accepted) that indicates that the feature has been implemented. Usually you'll get both, but in most scenarios at least one of those is present. – Grace Note Aug 24 '10 at 18:01
@Popular Demand, Grace Note: Thank you for your reply. – kiamlaluno Aug 24 '10 at 21:16
up vote 0 down vote accepted

A while ago, I wrote a Greasemonkey script to do this. I haven't updated it since then, so I can't promise it still works; in particular, I never fixed it to work in Chrome.

The reason I haven't touched it is that, to be honest, I have never used it. The automatic highlighting is usually good enough, and when it comes to languages like PostScript, all bets are off anyway (your best choice in that case is probably turning off the syntax highlighting altogether – which the script also supports).

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .