There are questions tagged multiple languages, and there are many of them. Occasionally, I come across some where it's an issue. Not a huge issue, but an issue nevertheless. There are two instances of this issue:

  1. The question applies to multiple languages, but the code sample is in a particular language. This currently requires manual re-highlighting with

    <!-- language: lang-therightlanguage -->
    as far as I know. I'd like to be able to just move the right language to the front.

  2. The question involves two components but is really about one particular tag. Take this question for example. It's tagged both and but takes priority. It shouldn't. It can be solved using PHP, but it's not about PHP, it's about JavaScript. And "php" appears in the title, which I can't fix with a comment unless I'm missing something. It's possible that the tag should be removed entirely, but that's not the question right now :)

So, can there be a way to prioritize or rearrange tags? Maybe by appending a ! to the end of the tag name, for example? Or is there a better way to go about this?

share|improve this question
    
the solution is to remove PHP, since the question has nothing to do with PHP. Looks like someone else already made that edit before I could... –  Jeff Atwood Dec 3 '11 at 1:17
2  
@JeffAtwood: *Ahem* “ It's possible that the php tag should be removed entirely, but that's not the question right now :) ” I know, it should be removed. But I'd like to know what to do if that's not the case. –  minitech Dec 3 '11 at 1:20
add comment

1 Answer

up vote 2 down vote accepted

The question applies to multiple languages, but the code sample is in a particular language. This currently requires manual re-highlighting

That's usually not true: when two different language tags occur on a question, the syntax highlighter switches back to autodetecting the language. So you should only have trouble when the language actually being used can't be auto-detected (for instance: VB).

The title thing is a can of worms, but as Jeff notes in a comment it's easy to avoid if you exclude tags that aren't actually relevant. And if all the code is in JavaScript, it's pretty hard to argue that the question is about PHP... Still, if all else fails, just edit the title: instead of a stupid prefix, work both tags in organically. Example:

How to avoid writing $(document).ready() in each JavaScript file in my PHP app?

If you do this, the system won't prefix the title with either tag.

share|improve this answer
    
Really? I didn't know that. Thanks, I'll do that from now on, even if if people tend to hate tagged titles (that doesn't apply here). –  minitech Dec 3 '11 at 1:44
    
@minitech If you write the title as suggested by Shog9, that is fine; what is not liked are titles similar to "PHP, JavaScript: How to avoid writing $(document).ready()." –  kiamlaluno Dec 3 '11 at 1:49
    
@kiamlaluno: Yup, exactly. That doesn't apply here, since it's integrated and there is more than one. –  minitech Dec 3 '11 at 1:51
    
@minitech Oh, I thought you meant here, on Meta Stack Overflow. I now see you meant here, as in "in the suggested title." Doh! :-) –  kiamlaluno Dec 3 '11 at 1:53
    
@kiamlaluno: Oh. Oops :P Guess that's terrible phrasing :) –  minitech Dec 3 '11 at 2:13
    
see this question, stackoverflow.com/q/21235430/17447. c# on its title makes it suck. but that tag in unavoidable. I think something should be done on the prioritization of tags. –  naveen Jan 20 at 13:39
    
What's the problem there, @naveen? The only other language used in that question is SQL, and only in one small place. Regardless, the process I describe in this answer doesn't apply to that question since c# is the only tag on it where syntax highlighting isn't set to "none"! –  Shog9 Jan 20 at 16:49
add comment

You must log in to answer this question.

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