From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ikumi Keita Newsgroups: gmane.emacs.bugs Subject: bug#41522: 26.3; Narrowing can prevent syntax propertization Date: Tue, 26 May 2020 02:02:15 +0900 Message-ID: <9801.1590426135@localhost> References: <14765.1590396129@localhost> <8f0d1e94-f918-4315-d5d5-ac1ee4df3477@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="112443"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41522@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 25 19:03:19 2020 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 1jdGVS-000T7Z-PK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 19:03:18 +0200 Original-Received: from localhost ([::1]:48726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdGVR-0004ZV-Pq for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 13:03:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdGVC-0004XK-Gg for bug-gnu-emacs@gnu.org; Mon, 25 May 2020 13:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdGVC-0004uR-78 for bug-gnu-emacs@gnu.org; Mon, 25 May 2020 13:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdGVC-0003Qw-3X for bug-gnu-emacs@gnu.org; Mon, 25 May 2020 13:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 May 2020 17:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41522 X-GNU-PR-Package: emacs Original-Received: via spool by 41522-submit@debbugs.gnu.org id=B41522.159042614213150 (code B ref 41522); Mon, 25 May 2020 17:03:02 +0000 Original-Received: (at 41522) by debbugs.gnu.org; 25 May 2020 17:02:22 +0000 Original-Received: from localhost ([127.0.0.1]:42368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdGUY-0003Q2-0i for submit@debbugs.gnu.org; Mon, 25 May 2020 13:02:22 -0400 Original-Received: from smtp1a.inetd.co.jp ([210.129.88.11]:58132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdGUV-0003Ps-Jk for 41522@debbugs.gnu.org; Mon, 25 May 2020 13:02:20 -0400 Original-Received: from localhost (42-146-134-146.rev.home.ne.jp [42.146.134.146]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 106192E; Tue, 26 May 2020 02:02:17 +0900 (JST) In-reply-to: <8f0d1e94-f918-4315-d5d5-ac1ee4df3477@yandex.ru> Comments: In-reply-to Dmitry Gutov message dated "Mon, 25 May 2020 18:04:01 +0300." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.3 Content-ID: <9797.1590426135.1@localhost> 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:180991 Archived-At: Hi Dmitry, thanks for your reply. >>>>> Dmitry Gutov writes: > Our current stance on the matter is that, in the simple case, code > should call syntax-ppss from "widened" state. I suppose that this means that the code should call syntax-ppss (or something like it) "before" narrowing is done, right? This code works for me ---------------------------------------------------------------------- (progn (goto-char (point-max)) (syntax-propertize (point)) ; <- (narrow-to-region (point) (- (point) 50)) (syntax-ppss) (widen)) ---------------------------------------------------------------------- while these don't: ---------------------------------------------------------------------- (progn (goto-char (point-max)) (narrow-to-region (point) (- (point) 50)) (syntax-ppss) (widen) (syntax-ppss) ; <- ) ---------------------------------------------------------------------- ---------------------------------------------------------------------- (progn (goto-char (point-max)) (narrow-to-region (point) (- (point) 50)) (syntax-ppss) (widen) (syntax-propertize (point)) ; <- ) ---------------------------------------------------------------------- > And the code which doesn't should be fixed. Or if it really need to do > that (for some reason), it should take care to handle any undesired > sife-effects itself. Hmm, then elisp programmers have to check whether each function used in the code uses narrowing+syntactic functions inside it if this kind of problem happens. I feel it a bit troublesome but at the same time I understand it is very difficult to solve this problem cleanly. OK, I try to be aware of this matter afterwards. Thanks for your advice! Regards, Ikumi Keita