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: /srv/bzr/emacs/trunk r101338: * lisp/emacs-lisp/syntax.el (syntax-ppss): More sanity check to catch Date: Fri, 14 Feb 2014 09:23:07 -0500 Message-ID: References: <87r47bi1e5.fsf@yandex.ru> <52F96284.50507@yandex.ru> <52FAE12B.6060101@yandex.ru> <52FC3BEE.60604@yandex.ru> <52FCD2B4.5080006@yandex.ru> <52FD9F1D.50205@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1392387798 1714 80.91.229.3 (14 Feb 2014 14:23:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2014 14:23:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 14 15:23:26 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WEJfq-0006fY-03 for ged-emacs-devel@m.gmane.org; Fri, 14 Feb 2014 15:23:26 +0100 Original-Received: from localhost ([::1]:52012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEJfp-0000Z0-Hq for ged-emacs-devel@m.gmane.org; Fri, 14 Feb 2014 09:23:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEJfg-00007U-4D for emacs-devel@gnu.org; Fri, 14 Feb 2014 09:23:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEJfY-00011N-9N for emacs-devel@gnu.org; Fri, 14 Feb 2014 09:23:16 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:44764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEJfY-00011D-5V for emacs-devel@gnu.org; Fri, 14 Feb 2014 09:23:08 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFLd+SX/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFFLd+SX/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="47639033" Original-Received: from 75-119-228-151.dsl.teksavvy.com (HELO pastel.home) ([75.119.228.151]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Feb 2014 09:23:07 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 3CAB6600AA; Fri, 14 Feb 2014 09:23:07 -0500 (EST) In-Reply-To: <52FD9F1D.50205@yandex.ru> (Dmitry Gutov's message of "Fri, 14 Feb 2014 06:44:13 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169606 Archived-At: >> Just `set-buffer' might be faster, indeed, but mostly because it's >> written in C (e.g. it also has to iterate through the local variables to >> save the old value and reload the new value for some of them). > Not the 100+ of them, though? It does iterate over the whole list, yes. It ignores most elements, tho. >> Hmm... I wonder why mmm-save-local-variables is defined the way it is. >> It doesn't seem to make use of `buffer-local-variables', even though it's >> the most natural starting point. E.g. there shouldn't be a need to list >> explicitly all the c-* variables. Maybe the author didn't know about >> buffer-local-variables (or it didn't exist back then)? > I'm not quite sure, but this way we only save the variables that are known > to be safe in the multiple-mode context. The way I see it, it's rather "this way we can only work for those major modes we've been taught to handle". I'm really interested in adding something like mmm-mode (or mumamo or web-mode) into Emacs. It'll have to start in GNU ELPA, I think, but in any case before it can make it into Emacs it will have to be structured such that new major modes can be handled without having to modify mmm-mode. > And also don't touch anything mmm-mode itself introduced. This is the list that we can trivially know, so it's OK if we have to handle these specially. BTW, I really don't know yet what will work best. Maybe the "save&restore only those vars we've been told" as is currently done is indeed the best option. But in that case it shouldn't be done via a variable listing those symbols, but e.g. by adding a special property to those symbols. > Now that I've checked, parsing the buffer into regions is definitely the > slowest part (followed by fontification, which takes about 40% of the time > in the current test example): Does mmm-mode parse the buffer lazily? Is fontification done "the jit-lock way"? Stefan