I think the issue you describe is fixed upstream in current version (11.91) of AUCTeX. For me,
xparse.dtx is fontified like this:
Please update your AUCTeX and try it again. I admit that the solution just works in
.dtx files and not in
.sty. This should be fixed; maybe you can submit a bug report.
AUCTeX is capable to parse your
.sty in order to find out which package(s) you're using and load the respective style file(s). Just add the following line to your
After that, you can hit
C-c C-n to parse the file. With this line in your
(setq TeX-parse-self t)
AUCTeX parses your file directly when you open it.