From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Syntax tables for multiple modes [was: bug#22983: syntax-ppss returns wrong result.] Date: Sun, 20 Mar 2016 04:19:21 +0200 Message-ID: References: <20160311151512.GD2888@acm.fritz.box> <20160311212410.GG2888@acm.fritz.box> <73903215-f94b-e194-7bfe-0d6350c95769@yandex.ru> <20160311221540.GH2888@acm.fritz.box> <2c301ec9-041d-9172-d628-479062314b23@yandex.ru> <20160314151621.GF1894@acm.fritz.box> <874mc2dqtk.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1458440389 32526 80.91.229.3 (20 Mar 2016 02:19:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Mar 2016 02:19:49 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Vitalie Spinu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 20 03:19:44 2016 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 1ahSxz-0000Pw-CP for ged-emacs-devel@m.gmane.org; Sun, 20 Mar 2016 03:19:43 +0100 Original-Received: from localhost ([::1]:51250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahSxy-0007Pe-EY for ged-emacs-devel@m.gmane.org; Sat, 19 Mar 2016 22:19:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahSxl-0007PN-Ga for emacs-devel@gnu.org; Sat, 19 Mar 2016 22:19:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahSxg-0008UO-Fm for emacs-devel@gnu.org; Sat, 19 Mar 2016 22:19:29 -0400 Original-Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:35205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahSxg-0008UJ-8G for emacs-devel@gnu.org; Sat, 19 Mar 2016 22:19:24 -0400 Original-Received: by mail-wm0-x22b.google.com with SMTP id l68so70732951wml.0 for ; Sat, 19 Mar 2016 19:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=lztDaGx4wqqVxWSxtsl5jQw6yKDvw/1rjFhVZri5fUo=; b=rOZG0BNfaxRdyfgMI8neGGdVMEsFKSxHK+gWZx5vClPNJY/nkvwZfE7KuFD6SWHQwx GZRx1sIuJZ0xPGoXDBYqRVX65Lni1oXdKY/LjRP0rF9r1DX1Gb0nnnMH2WdXuIoulZxp NBYr1D2EI+JBeBZQT7Yvj6pvWAFxZicLBuILott4fV8vD/A1mn8KdziWCIm8NqY4DRzl L640JLwQfKx6ah0OA3p2ydIjkm85kV55StC8I6RfOtbkFudFcxEGw+DBxMvx9lZJlIJ7 ZdA0UFIda1N1zjBNgzjFV33bhHnpIIYyPTYNm2GSXamdpBPNY2L3RCRZQ2UNyonu4BAC 66qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=lztDaGx4wqqVxWSxtsl5jQw6yKDvw/1rjFhVZri5fUo=; b=lQYHPiN/I3qmqcnslJ6ph5nbw+8JsBdJv8f1NJfhJxP3Vej1w/R00NBn+F3TMK5MaO OUJPhtej/UrDI2pOSm98ZJgxqq10Oi9iSOQRNh3hSX5tn6qcTgs1dNPgyMaaaOj0UKF/ Dq9YCHxs+r7EY3c1PZMiIOtJ5Ud/HS/MwU8OGmnDd+Nkywd7uT9t5AgUrwrtvqhlHbDp T3eV5kIzOXW2OILZnNwEm3TjIoU7KvuQxlgsHZV5FQBZQDXO1fFf2Mnouuk7GDi7fYKZ ne+1kc+eo7j+/6nkPAsCkNyZ5cfnc81g3M25NriwJS7rK9jz7ga7YlM+BWjhGioLwGvU yd9w== X-Gm-Message-State: AD7BkJIeg7ye2OskTmcPtkIUivIMIhQyZ3PcrdOiifc71OsIpydZTGPYRDrPXe4hReenxA== X-Received: by 10.194.22.97 with SMTP id c1mr23084174wjf.19.1458440363413; Sat, 19 Mar 2016 19:19:23 -0700 (PDT) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id 8sm5912818wmk.13.2016.03.19.19.19.21 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 19 Mar 2016 19:19:22 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: <874mc2dqtk.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22b 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:201913 Archived-At: On 03/20/2016 12:51 AM, Vitalie Spinu wrote: > You can simulate islands by marking inner spans as comments with comment classes > (11 and 12). Ooh, that's a solid idea. Should be more generic that my "propertize <> as punctuation" approach. > I used those in polymode in the past, but not anymore. It's not > that useful. Most of the parsing that modes do is regex based. I'd say it's still useful. Without the above, I've had indentation problems with sgml-mode. A good mode would use syntax-ppss to check that point is not inside a string or comment. Maybe that's not often done in font-lock, but it's at least common in syntax-propertize and indentation functions. Example: sgml-lexical-context. It performs a search at first, but in the end uses parse-partial-sexp, and returns a value based on that status. > So if a mode > author decides to regexpf for a wiki link on a full buffer after widening it, > islands won't help. Where does widening happens in this case? First, we have font-lock-dont-widen. For indentation, we've introduced prog-indentation-context recently. And indentation functions in programming modes are supposed to call prog-widen instead of widen now. syntax-propertize-function's aren't supposed to call widen at all, I think. > IMO the most useful direction for multi-modes is to add a hard narrowing that > Stephen mentioned in the other thread. `syntax-ppss-dont-widen` goes in that > direction, but it doesn't address the issue of distinguishing between user > narrowing and "hard narrowing" in multi modes. syntax-ppss-dont-widen and prog-indentation-context will be the indicators of the "hard narrowing", I guess.