From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Why js2-mode in Emacs 23.2? Date: Mon, 10 Aug 2009 04:55:49 +0200 Message-ID: References: <7b501d5c0908091634ndfba631vd9db6502db301097@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1249873007 16495 80.91.229.12 (10 Aug 2009 02:56:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Aug 2009 02:56:47 +0000 (UTC) Cc: Daniel Colascione , Emacs-Devel devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 10 04:56:40 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MaL3v-0005gI-UZ for ged-emacs-devel@m.gmane.org; Mon, 10 Aug 2009 04:56:40 +0200 Original-Received: from localhost ([127.0.0.1]:60825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaL3v-0002zQ-HU for ged-emacs-devel@m.gmane.org; Sun, 09 Aug 2009 22:56:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaL3D-0002W2-J4 for emacs-devel@gnu.org; Sun, 09 Aug 2009 22:55:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaL39-0002U9-6r for emacs-devel@gnu.org; Sun, 09 Aug 2009 22:55:55 -0400 Original-Received: from [199.232.76.173] (port=58775 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaL38-0002U6-U0 for emacs-devel@gnu.org; Sun, 09 Aug 2009 22:55:50 -0400 Original-Received: from mail-yw0-f186.google.com ([209.85.211.186]:57242) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MaL38-0005Ku-Fd for emacs-devel@gnu.org; Sun, 09 Aug 2009 22:55:50 -0400 Original-Received: by ywh16 with SMTP id 16so4440648ywh.24 for ; Sun, 09 Aug 2009 19:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=gqnYl8Y8qBr6XyhHxcPJihx8MeLFA9fAro3egcTYL18=; b=h9xLI0gMQ8a7yJBJo87LKqVEU9gQ3WTNE7LZD6j1S6w9laC/1E8u9SMLzOCwZXXCOs tC+DNJ4ksR1KCKjLEOaQr5JsPj20O+x9gPAWqKIhIA9xznyakJqzKgWVQ1/i5yzzwA5P YPz93ROKv4uCrHJgCpz8tOSXLg9kzk0DiDrS0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=DHivrpBHaX4maZFqs7vQuHYXCckScLDDmpVjoEe+TJWgaC24WrvKK5tQfGZHpuuVD9 bn66OFMiS0TeZf6toubuQKP+DHIAL6zKJdhubFeLeSuCu5YLqKLtLlneEgPnfsYspft0 GKWBMeaqPTaisk2P86DAJ7vy6q0SjVjI4tNsQ= Original-Received: by 10.100.174.20 with SMTP id w20mr2894749ane.65.1249872949862; Sun, 09 Aug 2009 19:55:49 -0700 (PDT) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113928 Archived-At: On Mon, Aug 10, 2009 at 4:47 AM, Stefan Monnier w= rote: >> =C2=A0 ;; Important to fontify the whole buffer syntactically! If we don= 't, >> =C2=A0 ;; then we might have regular expression literals that aren't mar= ked >> =C2=A0 ;; as strings, which will screw up parse-partial-sexp, scan-lists= , >> =C2=A0 ;; etc. and and produce maddening "unbalanced parenthesis" errors= . >> =C2=A0 ;; When we attempt to find the error and scroll to the portion of >> =C2=A0 ;; the buffer containing the problem, JIT-lock will apply the >> =C2=A0 ;; correct syntax to the regular expresion literal and the proble= m >> =C2=A0 ;; will mysteriously disappear. > > Yes, this is a general problem. =C2=A0Basically font-lock-syntactic-keywo= rds > 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. I am not sure I understand this, but thinking of it again, could not Daniel use a font-lock-fontify-region-function that first does a fontification without keywords (if it is there it is needed). Or otherwise use what I suggested before.