From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dario Gjorgjevski Newsgroups: gmane.emacs.bugs Subject: bug#36006: electric-pair-mode fails to balance in certain cases Date: Fri, 22 Nov 2019 13:28:48 +0100 Message-ID: References: <87woi80yfw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="225029"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36006@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 22 13:29:38 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iY848-000wOM-8m for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Nov 2019 13:29:36 +0100 Original-Received: from localhost ([::1]:50202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iY845-0001Dy-3Q for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Nov 2019 07:29:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46827) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iY83l-0001DI-BH for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 07:29:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iY83d-0001bR-WB for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 07:29:12 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45069) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iY83b-0001aC-KB for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 07:29:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iY83b-0000Gt-Cx for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 07:29:03 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87woi80yfw.fsf@gmail.com> Resent-From: Dario Gjorgjevski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Nov 2019 12:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36006 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 36006-submit@debbugs.gnu.org id=B36006.15744257401032 (code B ref 36006); Fri, 22 Nov 2019 12:29:01 +0000 Original-Received: (at 36006) by debbugs.gnu.org; 22 Nov 2019 12:29:00 +0000 Original-Received: from localhost ([127.0.0.1]:53890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iY83X-0000Ga-QW for submit@debbugs.gnu.org; Fri, 22 Nov 2019 07:29:00 -0500 Original-Received: from mail-wm1-f45.google.com ([209.85.128.45]:36953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iY83U-0000GJ-Cr for 36006@debbugs.gnu.org; Fri, 22 Nov 2019 07:28:57 -0500 Original-Received: by mail-wm1-f45.google.com with SMTP id f129so6051277wmf.2 for <36006@debbugs.gnu.org>; Fri, 22 Nov 2019 04:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version; bh=zx0eAYNgu6ES7GbXIu4Y+Y4kHKqs2Hf6w0zW4ygl6cc=; b=cyAsZ+PZZfkb8tYQiFdD2Ze86BxeV3w4Jz1HUD8plk3CdnPJx3BWm4G0fyOd08S1CO 6PJaXlwuXZlg2BEqo6AjDL/+0JxZeb/SQlUpV6gYW7OSNEcq2NtzC5BJkwl7dalLt2E8 N5zF3I972Y2ujqJHogeV/BgAwVxSYslolEUayp8V5uMYLyXpUM+QgpSmNwZPubAyX3Xr 6WIq4dhzWsiRA7RaZNVhQJvcdAeeHnbXEEk1udgBKFbHPl4TH8NVgNa+FtdugP0OqXPe dWglc5cpklWNklrg5yehY36RUYjJ/hWe4l+JWr1QK29EDk0MwUAlkmcyJzxFnRTGvrci pArg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=zx0eAYNgu6ES7GbXIu4Y+Y4kHKqs2Hf6w0zW4ygl6cc=; b=VmoShtvduKNMmcweFvAZ4eWbV9giil+i5mxgyFjkA4OPbQM0lVqvPYARgEQDFir1eT u68n/01/uFR5qkTkwO5Xhz3xq1p9X6pZtrwN1+56hqC9KFbP7YCReoFTnxDQzOlzxAgA 2vzRBavMuGZ+4vr/yM6r4ByezyYCftwu89qWzn204NsLG4zvCo66SCenP22h1p5nOmDe r65lNd/uhVm2+EjzQhjgqjuCmUrZgG4awStjtvggbv4BN74+XRwXm8pzeA0svfpIDQdj Tv/dm7sJCHvD0ZzvhPTLNuPaTRS8C6+5HXzpG/Ie36tAiyeqaZLtHQ9XkwLYfW7PHZFy hG3A== X-Gm-Message-State: APjAAAXeyioAImgYCApQ7/3lOXbeolTBJfKGte2INqdWkZvM2iEZ+I6H Ic9peeqnGM7UKj7FbPO943wxb2xx X-Google-Smtp-Source: APXvYqwj0n2crJMoH2lzWYd8pfL1eme8fhM5+8dcwvPP2HjNH1YamS8r7Agxjux0q8vQqszunhAj2A== X-Received: by 2002:a7b:c4c8:: with SMTP id g8mr15327263wmk.36.1574425729976; Fri, 22 Nov 2019 04:28:49 -0800 (PST) Original-Received: from ZALANDO-31298 ([185.85.220.254]) by smtp.gmail.com with ESMTPSA id r2sm3408822wma.44.2019.11.22.04.28.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Nov 2019 04:28:49 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172225 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable (It=E2=80=99s been so long since I last looked into the bug...) > It doesn't happen in emacs-26, which has the same > electric-pair--with-uncached-syntax call, so it's not just that alone. > I suspect this could be related to the recent changes to mark ">" > outside of tags with punctuation syntax (technically, a > b > is valid, only "<" needs to be escaped as <). You=E2=80=99re right. The problem is that electric-pair--with-uncached-syn= tax let-binds syntax-propertize-function to ignore, causing the syntax of ">" to not be updated. Applying the attached patch fixes the issue. However, in what cases would we want syntax-propertize-function to be let-bound to ignore? Best regards, Dario --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Leave-syntax-propertize-function-unchanged.patch Content-Description: Do not let-bind syntax-propertize-function to ignore in electric-pair--with-uncached-syntax >From 6de30e0cdc97475b3aac2a35bec1fcf1ac0af84f Mon Sep 17 00:00:00 2001 From: Dario Gjorgjevski Date: Fri, 22 Nov 2019 13:19:39 +0100 Subject: [PATCH] Leave syntax-propertize-function unchanged * lisp/elec-pair.el (electric-pair--with-uncached-syntax): Do not let-bind syntax-propertize-function. --- lisp/elec-pair.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index f3cbee7048..6e528b2dfd 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -246,8 +246,7 @@ electric-pair--with-uncached-syntax cache is flushed from position START, defaulting to point." (declare (debug ((form &optional form) body)) (indent 1)) (let ((start-var (make-symbol "start"))) - `(let ((syntax-propertize-function #'ignore) - (,start-var ,(or start '(point)))) + `(let ((,start-var ,(or start '(point)))) (unwind-protect (with-syntax-table ,table ,@body) -- 2.17.1 --=-=-=--