From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Patch: Syntax and Hard Newlines Date: Tue, 28 Nov 2006 23:57:04 -0500 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1164776257 15002 80.91.229.2 (29 Nov 2006 04:57:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 29 Nov 2006 04:57:37 +0000 (UTC) Cc: rudalics@gmx.at, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 29 05:57:34 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GpHVj-0001MF-Da for ged-emacs-devel@m.gmane.org; Wed, 29 Nov 2006 05:57:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpHVi-0000jp-FL for ged-emacs-devel@m.gmane.org; Tue, 28 Nov 2006 23:57:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GpHVO-0000h6-QQ for emacs-devel@gnu.org; Tue, 28 Nov 2006 23:57:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GpHVM-0000ep-D0 for emacs-devel@gnu.org; Tue, 28 Nov 2006 23:57:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpHVM-0000ee-7Y for emacs-devel@gnu.org; Tue, 28 Nov 2006 23:57:08 -0500 Original-Received: from [209.226.175.188] (helo=tomts25-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GpHVK-00059p-LV; Tue, 28 Nov 2006 23:57:06 -0500 Original-Received: from pastel.home ([70.53.194.10]) by tomts25-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20061129045705.DRFA1747.tomts25-srv.bellnexxia.net@pastel.home>; Tue, 28 Nov 2006 23:57:05 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id D97B995E9; Tue, 28 Nov 2006 23:57:04 -0500 (EST) Original-To: "Herbert Euler" In-Reply-To: (Herbert Euler's message of "Wed\, 29 Nov 2006 12\:06\:12 +0800") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) 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:63021 Archived-At: > many times so that got a Perl file of 268274172 bytes (257 MB). I > then evaluated the following forms: [...] > Can I conclude from this result that `parse-sexp-lookup-properties' > has no effect over syntax parsing? I believe so, yes. Although I wonder why you did (let (old-time time-diff (parse-sexp-lookup-properties nil)) (save-window-excursion (switch-to-buffer "1.pl") (font-lock-mode -1) (goto-char 268273054) (jit-lock-mode nil) (font-lock-mode 1) (setq old-time (current-time)) (parse-partial-sexp 1 (point)) (setq time-diff (time-subtract (current-time) old-time))) rather than (with-current-buffer (find-file-noselect "1.pl") (font-lock-mode -1) (setq font-lock-support-mode nil) (font-lock-mode 1) (let ((old-time (current-time)) (parse-sexp-lookup-properties nil)) (parse-partial-sexp (point-min) (point-max)) (time-subtract (current-time) old-time))) The main difference is that:/ your code did: - misused switch-to-buffer and generally fiddled unnecessarily with windows - failed to disable jit-lock, so the buffer probably had no syntax-table (or face) property set anywhere while running parse-partial-sexp. - did not bind parse-sexp-lookup-properties right before running parse-partial-sexp which is safer: perl-mode sets parse-sexp-lookup-properties via font-lock-defaults, so your let-binding of parse-sexp-lookup-properties to nil outside may be overridden when turning on font-lock-mode. But I believe that this did not affect your measurements because font-lock-mode had been turned ON before, so when you turned it on the second time, font-lock-set-defaults didn't do anything. Stefan