[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why js2-mode in Emacs 23.2?

From: Stefan Monnier
Subject: Re: Why js2-mode in Emacs 23.2?
Date: Sun, 09 Aug 2009 22:47:07 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

>   ;; Important to fontify the whole buffer syntactically! If we don't,
>   ;; then we might have regular expression literals that aren't marked
>   ;; as strings, which will screw up parse-partial-sexp, scan-lists,
>   ;; etc. and and produce maddening "unbalanced parenthesis" errors.
>   ;; When we attempt to find the error and scroll to the portion of
>   ;; the buffer containing the problem, JIT-lock will apply the
>   ;; correct syntax to the regular expresion literal and the problem
>   ;; will mysteriously disappear.

Yes, this is a general problem.  Basically font-lock-syntactic-keywords
should be moved out of font-lock into syntax.el (and provide a new
feature like (syntax-ensure-properties BEG END) to request application
of those rules) and things like syntax-ppss, indentation, forward-sexp,
... should make sure it's applied to the portion of the buffer they
look at.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]