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 02:55:25 +0200 Message-ID: References: <7b501d5c0908091634ndfba631vd9db6502db301097@mail.gmail.com> <98AB9911-447B-45CA-811C-AB0659D897EE@merrillpress.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249865744 2364 80.91.229.12 (10 Aug 2009 00:55:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Aug 2009 00:55:44 +0000 (UTC) Cc: Emacs-Devel devel To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 10 02:55:37 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 1MaJAm-0000uA-9d for ged-emacs-devel@m.gmane.org; Mon, 10 Aug 2009 02:55:36 +0200 Original-Received: from localhost ([127.0.0.1]:43942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaJAl-0004zA-Sv for ged-emacs-devel@m.gmane.org; Sun, 09 Aug 2009 20:55:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaJAh-0004z5-Fh for emacs-devel@gnu.org; Sun, 09 Aug 2009 20:55:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaJAc-0004vn-68 for emacs-devel@gnu.org; Sun, 09 Aug 2009 20:55:30 -0400 Original-Received: from [199.232.76.173] (port=46274 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaJAc-0004vb-1l for emacs-devel@gnu.org; Sun, 09 Aug 2009 20:55:26 -0400 Original-Received: from mail-yw0-f186.google.com ([209.85.211.186]:37208) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MaJAb-0000ja-Na for emacs-devel@gnu.org; Sun, 09 Aug 2009 20:55:25 -0400 Original-Received: by ywh16 with SMTP id 16so4366299ywh.24 for ; Sun, 09 Aug 2009 17:55:25 -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=Sp3Xt/IgNN61rsCr73a1UrE3vG3Ks7cfb7TOOW10KjU=; b=u1hd1UrnQb04X9/nXjj7Maq3lfXbjnexG2NPOzlt750dxw6L8tvYlik8FJQiDW59F+ PyCwgcgURuq91DRJktFDGoY/LjwRnPpL4W9oMIptrR6mcy5fUbTWMEsG4RiMUd+ZqmEW N73ShICnfFeLt/kyRjX5G/srQEGALbPoywMcI= 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=UvD+OpWoir7W/kHkyPANH0BOlUvxGTmuEHOwaaakrlYC108LQkXcwwdGzXEGk71NsP FRhStVRieZSbGV1PENngdWP9rnx7wcjhmEEJYcsHD7p0yx0yQK2nJkkFMWIOSRx4y/TF OIzXi27yCpN+wpaqDvyWqYHMDuQNPDpOzsxNs= Original-Received: by 10.100.3.7 with SMTP id 7mr2819724anc.99.1249865725151; Sun, 09 Aug 2009 17:55:25 -0700 (PDT) In-Reply-To: <98AB9911-447B-45CA-811C-AB0659D897EE@merrillpress.com> 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:113912 Archived-At: On Mon, Aug 10, 2009 at 2:46 AM, Daniel Colascione wrote: > On Aug 9, 2009, at 8:17 PM, Lennart Borgman wrote: >> >> Could not JIT-lock do a second pass? > >>> Is there another way to solve the problem? Can mumamo tell espresso to >>> ignore certain parts of the buffer? >> >> Well, it does, but espresso kind of ignores that ... ;-) >> >> Just telling it where to scan will however not help since >> espresso-mode will be called every time a user enters a chunk with >> espresso-mode. > > A second pass when? I see. It will not help here. > The problem is that functions that have nothing to do > with fontification operate improperly unless correct text properties are > attached to certain bits of the buffer. You can handle this by checking for fontification and do it when necessary and tell JIT lock you have done it. See mlinks.el in nXhtml for an example of how to do it. (Look in the repository, I have just implemented this.) Maybe you can take that functionality and makes it into a separate library. I have not had time to do that but I think it would be good. > Consider the regular expression /}/. syntactic-keywords are used to mark the > whole expression as a string. If forward-sexp encounters that expression > before the expression is marked as a string, then it'll interpret the '}' > incorrectly. When the user actually enters a '}', we fontify it correctly. > However, when we first start up, we need to fonyify the whole buffer so that > we don't trip over > one of these regular expressions if we look at it before jit-lock gets > around to it. > > Can espresso just perform the regexp-marking scan 1) on only the region > given to it by mumamo, and 2) only once, with some kind of indication given > by mumamo of whether we're seen this particular chunk before? I think the recipe above will work for mumamo too. >>> As for define-derived-mode: nope, espresso-mode doesn't use that. >> >> It is a minor change but will help keeping it upto date later. > > So just use define-derived-mode to inherit from fundamental-mode? Yes. (Or from nil.)