From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#36006: electric-pair-mode fails to balance in certain cases Date: Thu, 10 Feb 2022 08:50:04 +0100 Message-ID: <87ee4bcg9f.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21929"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 36006@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 10 09:16:02 2022 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 1nI4cU-0005Tx-Dk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 09:16:02 +0100 Original-Received: from localhost ([::1]:39898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nI4cT-0002dZ-00 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 03:16:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nI4Ef-0004Nh-Ko for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 02:51:25 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nI4EI-0004wZ-BJ for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 02:51:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nI4EH-0004h5-RI for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 02:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Feb 2022 07:51: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.164447941717964 (code B ref 36006); Thu, 10 Feb 2022 07:51:01 +0000 Original-Received: (at 36006) by debbugs.gnu.org; 10 Feb 2022 07:50:17 +0000 Original-Received: from localhost ([127.0.0.1]:53648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nI4DY-0004ff-QM for submit@debbugs.gnu.org; Thu, 10 Feb 2022 02:50:17 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:45056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nI4DW-0004fK-SA for 36006@debbugs.gnu.org; Thu, 10 Feb 2022 02:50:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QF89cqrGM5myn8oraV4/xx6Ap1GDgY7SBw/e8gsAO7E=; b=pQTBc+rmbzuZzBwpyvwFp2Z/oc TNsOiiCQwhG1p7l3/3TYGISvf8xXZQ9K9l7RuBuPhFrCr2WrYSgiBFOn0d3l6+aUMjsETnSp76PHx fNjEvI4JEvSBvtcBo7q28h8AgcFUORO36H+VXiJt/g4nu27/rJe3VWPzT90tYYNOmOAg=; Original-Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nI4DN-00047f-0c; Thu, 10 Feb 2022 08:50:08 +0100 X-Now-Playing: Melanie de Biasio's _No Deal remixed_: "Sweet Darling Pain (Chassol Remix)" In-Reply-To: (Gregory Heytings's message of "Fri, 28 Aug 2020 08:00:05 +0000") 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:226547 Archived-At: Gregory Heytings writes: > A more specific note: removing `(put-text-property > ... (string-to-syntax "."))' in `sgml--syntax-propertize-ppss' also > fixes the bug. So this bug is indeed specific to html-mode/sgml-mode. This problem is still present in Emacs 29. I guess the issue here is that electric-pair-mode works by letting the user insert the '>' before the final
, and then fixes things up (by removing the extra '>' and moving point), but this defeats that: (defun sgml--syntax-propertize-ppss (pos) "Return PPSS at POS, fixing the syntax of any lone `>' along the way." (cl-assert (>= pos (car sgml--syntax-propertize-ppss))) (let ((ppss (parse-partial-sexp (car sgml--syntax-propertize-ppss) pos -1 nil (cdr sgml--syntax-propertize-ppss)))) (while (eq -1 (car ppss)) (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax ".")) ;; Hack attack: rather than recompute the ppss from ;; (car sgml--syntax-propertize-ppss), we manually "fix it". (setcar ppss 0) (setq ppss (parse-partial-sexp (point) pos -1 nil ppss))) (setcdr sgml--syntax-propertize-ppss ppss) (setcar sgml--syntax-propertize-ppss pos) ppss)) Because it's marking the extra '>' as punctuation? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no