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: Wed, 12 Feb 2014 09:26:40 -0500 Message-ID: References: <87r47bi1e5.fsf@yandex.ru> <52F96284.50507@yandex.ru> <52FAE12B.6060101@yandex.ru> <52FAF761.2020801@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1392215218 4431 80.91.229.3 (12 Feb 2014 14:26:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Feb 2014 14:26:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 12 15:27:01 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 1WDamB-0006MG-88 for ged-emacs-devel@m.gmane.org; Wed, 12 Feb 2014 15:26:59 +0100 Original-Received: from localhost ([::1]:39386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDamA-0003B6-S9 for ged-emacs-devel@m.gmane.org; Wed, 12 Feb 2014 09:26:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDam1-0003A2-86 for emacs-devel@gnu.org; Wed, 12 Feb 2014 09:26:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDalt-0002Jg-Nd for emacs-devel@gnu.org; Wed, 12 Feb 2014 09:26:49 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:37626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDalt-0002Jb-Jr for emacs-devel@gnu.org; Wed, 12 Feb 2014 09:26:41 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpaAU/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFFFpaAU/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYHCxQYDSSIHgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="47405489" Original-Received: from 69-165-160-20.dsl.teksavvy.com (HELO pastel.home) ([69.165.160.20]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 12 Feb 2014 09:26:41 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id F3185600CC; Wed, 12 Feb 2014 09:26:40 -0500 (EST) In-Reply-To: <52FAF761.2020801@yandex.ru> (Dmitry Gutov's message of "Wed, 12 Feb 2014 06:24:01 +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:169556 Archived-At: >>> One option is to have a hook that takes a (POS . PPSS) pair, which >>> syntax-ppss intends to use as a starting point for parsing, and return >>> a new such pair to use instead, where the returned position should >>> always be >= POS. > A problem: suppose point is in a primary mode region, and POS is > in a submode region above it. Then we can't use the value of PPSS at all. I don't understand the problem. Of course your hook would return a completely different PPSS to use along with the new buffer position from where to start parsing. > Does the hook re-scan the buffer from the beginning? I don't understand the question. > I suppose this could be handled if `syntax-ppss-flush-cache' removed or > modified the cache entries where NEXT-BOUNDARY is after BEG. Exactly. > And by modified, I mean set NEXT-BOUNDARY to BEG. Yes, something like that. Stefan