[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
identifiing strings and comments in program source files (to skip them o
identifiing strings and comments in program source files (to skip them over)
Tue, 25 Apr 2006 23:14:34 +0200
isn't it a good idea to use the face property (get-text-property (point)
'face) to decide if the point is after a string or comment?
I have a mode what uses font-lock-mode and highlights everything nicely. I
think I could use this (= the face set by font-lock-mode) for identifiing
if e.g. a search stopped in a string or comment. (I know font-lock-mode
must be enabled for this.) This way I could omit reparsing the buffer (with
parse-partial-sexp) e.g. in a function what searches something "real" (=
strings and comments should be skipped).
What do you think: can a robust solution be built using this approach?
- identifiing strings and comments in program source files (to skip them over),
Peter Tury <=