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: Mon, 10 Feb 2014 11:18:41 -0500 Message-ID: References: <87r47bi1e5.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1392049196 29948 80.91.229.3 (10 Feb 2014 16:19:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Feb 2014 16:19:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 10 17:20:03 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 1WCtaV-0002BU-3t for ged-emacs-devel@m.gmane.org; Mon, 10 Feb 2014 17:20:03 +0100 Original-Received: from localhost ([::1]:56334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCtaU-00036J-IA for ged-emacs-devel@m.gmane.org; Mon, 10 Feb 2014 11:20:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCtZt-0002Yh-NU for emacs-devel@gnu.org; Mon, 10 Feb 2014 11:19:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCtZD-0006Dj-LS for emacs-devel@gnu.org; Mon, 10 Feb 2014 11:19:25 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:44903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCtZD-0006DJ-H7 for emacs-devel@gnu.org; Mon, 10 Feb 2014 11:18:43 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+KAF/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLY0ag3ADiGGcGYFegxWBSQ X-IPAS-Result: Av4EABK/CFHO+KAF/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLY0ag3ADiGGcGYFegxWBSQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="47202802" Original-Received: from 206-248-160-5.dsl.teksavvy.com (HELO pastel.home) ([206.248.160.5]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 10 Feb 2014 11:18:42 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id CF098616C6; Mon, 10 Feb 2014 11:18:41 -0500 (EST) In-Reply-To: <87r47bi1e5.fsf@yandex.ru> (Dmitry Gutov's message of "Mon, 10 Feb 2014 14:43:30 +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:169508 Archived-At: >> - ;; Simple sanity check. >> + ;; Simple sanity checks. >> + (< (point) pos) ; backward-paragraph can fail here. > Why `<' and not `<='? IIRC the reason was so that (syntax-ppss) called from a place like a "column-0 just before an open paren" can correctly indicate if this open paren is within a string/comment while at the same time parsing the subsequent text assuming that this open paren was outside of any string/comment. Maybe there is another reason, but that's the one I remember. Not a terribly strong reason, admittedly. > In mmm-mode, we call the default font-lock-fontify-region function with > bounds of each subregion as arguments, and we also try to limit > `syntax-ppss' to these regions, so the `syntax-begin-function' brings > point to the beginning of the current subregion. But there's no guarantee syntax-begin-function will be used at all, so I'm not sure how important changing this test is. Is it really sufficient to make syntax-ppss understand mmm's sub-modes? Stefan