From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#20436: 25.0.50; syntax-multiline not documented Date: Tue, 13 Jul 2021 14:11:36 -0400 Message-ID: References: <871tj6meii.fsf@tromey.com> <87im1eqeos.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40384"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 20436@debbugs.gnu.org, Tom Tromey To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 13 20:12:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3Mt9-000AIM-Ep for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Jul 2021 20:12:11 +0200 Original-Received: from localhost ([::1]:51684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Mt8-0002tw-Dx for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Jul 2021 14:12:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Mt0-0002tk-My for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 14:12:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3Mt0-0002i6-FV for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 14:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3Mt0-0006WJ-BL for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 14:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Jul 2021 18:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20436 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 20436-submit@debbugs.gnu.org id=B20436.162619990825038 (code B ref 20436); Tue, 13 Jul 2021 18:12:02 +0000 Original-Received: (at 20436) by debbugs.gnu.org; 13 Jul 2021 18:11:48 +0000 Original-Received: from localhost ([127.0.0.1]:41930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3Msl-0006Vm-Nh for submit@debbugs.gnu.org; Tue, 13 Jul 2021 14:11:47 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3Msi-0006VV-Fd for 20436@debbugs.gnu.org; Tue, 13 Jul 2021 14:11:45 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 80AF210020E; Tue, 13 Jul 2021 14:11:38 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 269171001F3; Tue, 13 Jul 2021 14:11:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1626199897; bh=ElkDjI0SXln3vy3Xn3j+tgb/I3c6/LV64CO7N7l05PY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=gteHbIuZlnI4rEo3OKngNxKQtZ3q2LZwaRAu3JNaBk0DQYP1u5vAPffHyVnl7QMBL Mv84szwTLGGBNF+SpCmCB2+Vok7LVCIjfcrDcP1KGny/wAVs22smatMonpiCNU9b7O sCqgUygvxmgBACO40Zw+3p1ujTeT/u8bCqCTwEVsi6hSoSFaxh3miM4S+Gha/YOrGz pFjK19brmkp8tLhXzmQQPPUcCPxOanWhKiKHmNxD2PRqsa2HR6+vmhy7fU3Hj1pE5j UxWb/2s8uPpiUZzunhCzkSiE3ysZqwtgZ68bIQOj/OcigHF1fFqfx/4WHPT/hUZBT+ mdutKOenfheHg== Original-Received: from alfajor (unknown [216.154.29.138]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id F04D41203BF; Tue, 13 Jul 2021 14:11:36 -0400 (EDT) In-Reply-To: <87im1eqeos.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 13 Jul 2021 19:57:55 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209865 Archived-At: Lars Ingebrigtsen [2021-07-13 19:57:55] wrote: > Tom Tromey writes: >> I noticed some code in syntax.el for the syntax-multiline property. >> This doesn't seem to be documented anywhere, but I think it should be. > > Looking at this: > > (defun syntax-propertize-multiline (beg end) > "Let `syntax-propertize' pay attention to the syntax-multiline property." > (when (and (> beg (point-min)) > (get-text-property (1- beg) 'syntax-multiline)) > (setq beg (or (previous-single-property-change beg 'syntax-multiline) > (point-min)))) > ;; > (when (get-text-property end 'syntax-multiline) > (setq end (or (text-property-any end (point-max) > 'syntax-multiline nil) > (point-max)))) > (cons beg end)) > > And some of the usage sites... I'm still not quite sure what the > semantics here are. :-) I've added Stefan M to the CCs; perhaps he can > explain and I'll write something up for the manual? Its semantics is implemented by `syntax-propertize-multiline` (whose docstring speaks volumes ;-), so the property is only effective after you've added `syntax-propertize-multiline` to `syntax-propertize-extend-region-functions`. What it does is cause `syntax-propertize` to treat the marked text such that it will always be propertized in a single call rather than two or more separate calls. The most common use for it is when the syntax to use for "FOO" depends on some *later* text "BAR": by placing this property over the whole of "FOO...BAR" you make sure that any change of "BAR" will cause the syntax of "FOO" to be recomputed. Stefan