From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 18 19:52:45 2021 Received: (at submit) by debbugs.gnu.org; 18 Jul 2021 23:52:45 +0000 Received: from localhost ([127.0.0.1]:57645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5GaS-0004Wh-Oe for submit@debbugs.gnu.org; Sun, 18 Jul 2021 19:52:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:50374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5GaR-0004WY-Ap for submit@debbugs.gnu.org; Sun, 18 Jul 2021 19:52:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5GaR-00053n-2D for bug-gnu-emacs@gnu.org; Sun, 18 Jul 2021 19:52:43 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:35393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5GaP-00058O-6r for bug-gnu-emacs@gnu.org; Sun, 18 Jul 2021 19:52:42 -0400 Received: by mail-pl1-x632.google.com with SMTP id n11so8676459plc.2 for ; Sun, 18 Jul 2021 16:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=a4IH4SjrTQXZ06yd8QT+g+wMLPuxOvMEg1VFyWDOI+w=; b=DBSeXrpijli3Or1u7RZaKp7h/ad3fA5bCfHKM7NKpikHhODYCvoWQVWWXaVZv9/Jro 8+HAi13daRZ3LtlhyMRJ2T1HdpifWWCnoibSHIqQNN54jlNxmSzGMSQ8/00+yjkeim7R V5DN9jxzZhncy2mFoMzZWcLrTQFDID1P+P8jUKPH4w/SPl8Iu1aFl5XuZJNRfLz769+b ZSPo8+kWH/9wJc6UU3NXgS4smafmDreOkvHW5jj0fyibiF6LNdCcpr5c8x2CsXXmVhqk 8omXNSuomYGxtEjVwYbeu2wb2u0HFXYHgSEPGvl1e4Rs/oq25xiyMr4epymZp0HtoGQo k0XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=a4IH4SjrTQXZ06yd8QT+g+wMLPuxOvMEg1VFyWDOI+w=; b=RwdRarWVRGtpTfPflbdasR+AD3U6R06j9s/5bhpQbEEzALSwzFVflCJaFO3nsfK/54 xPL1cXxTL12eCJkmIB3pXd1Fx18UQdorGibD51KoXy7NNWV70Vz1JhUWBjpBc9CBoL3w bcRb9seJxrJJoWeLMTtztU/988XKjClWsA66ftyP+1cuhDfZxA6pkGoKn0STVdWtJQGl u+VqN/yyyRIVAOraSlPURtFXYB2ATK56i7LxQeTp+Ulh/yS72pHdBkJfqmYF1HDQAEPt gR1358nT5MhQ43gGjpDFfKed1OMJd+bcBWMq6TyryrpIrIZDDaeaMnQMRhDQ31S/2Uc4 Ys5Q== X-Gm-Message-State: AOAM532tbEaJ0KSQOabdOtJvp30lTCXrruG89Bv/anyfZxiZDC+5GBWQ ATPmxa4kbbFx5i0hxiENrtEHD63nYNt1LQ== X-Google-Smtp-Source: ABdhPJwHtwqnkp1Agfp2r+5iKyb5SSndhjEmobsvy+DeI/xopnqtSMJjPdcHXSIJXrNTzuOHetyBWw== X-Received: by 2002:a17:90a:a087:: with SMTP id r7mr27868295pjp.84.1626652358960; Sun, 18 Jul 2021 16:52:38 -0700 (PDT) Received: from localhost ([2600:1700:7270:7d1f:fa59:71ff:fe00:10cc]) by smtp.gmail.com with ESMTPSA id i12sm13934328pjj.9.2021.07.18.16.52.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jul 2021 16:52:38 -0700 (PDT) From: Allen Li To: bug-gnu-emacs@gnu.org Subject: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file Date: Sun, 18 Jul 2021 16:52:37 -0700 Message-ID: <801r7vgoxm.fsf@felesatra.moe> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=darkfeline@felesatra.moe; helo=mail-pl1-x632.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) To reproduce: 1. emacs -Q 2. C-x C-f /tmp/tmp.html RET 3. M-x electric-pair-local-mode RET 4. < > Expected: Buffer contains <> Actual: Buffer contains <>> By default, typing > should skip over the > inserted by electric-pair-mode when the first < is type (but it doesn't). I tried stepping through with Edebug, but the bug disappears when using Edebug. The difference seems to be in what is returned by electric-pair--balance-info, but that function is big and unfamiliar to me. In GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) of 2021-03-26 built on juergen Windowing system distributor 'The X.Org Foundation', version 11.0.12012000 System Description: Arch Linux From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 22 03:03:48 2021 Received: (at 49629) by debbugs.gnu.org; 22 Jul 2021 07:03:48 +0000 Received: from localhost ([127.0.0.1]:39271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6SkG-0006yY-2g for submit@debbugs.gnu.org; Thu, 22 Jul 2021 03:03:48 -0400 Received: from mail-oi1-f171.google.com ([209.85.167.171]:46684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6SkE-0006yH-DK for 49629@debbugs.gnu.org; Thu, 22 Jul 2021 03:03:47 -0400 Received: by mail-oi1-f171.google.com with SMTP id r80so5539192oie.13 for <49629@debbugs.gnu.org>; Thu, 22 Jul 2021 00:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=BsEu2P9TMPZmXhFqUA7krG6TKSGPFlbJtH97mLZ1DkE=; b=TxXVPnJ7RCjWLMewEBPs+ZlFnAiw8neRygVcHUZLUbGR1l3qi3pdrSzI25M3e3JT5Q brMeBQKoqW1Ie1TfA2DGbAtGomZnCMSwaLqyrVvnKncfLV1apZzl9aRC0OAwGKJMHKaR HC0E37V6qtyyX74Bsmbc/LBimShbZ9iK+kQ6xGPJOmBMLNgslcFXor7C6ZOgoJ8xXgWx MHZqH5KAcGYrxmpFLFKkCTJcjGcbMdd3JvlS7YG7aSumZVFykAgc5GNgkk0u+q8JgCq8 xzhPdj9V2rzQkfRbVm/xrQaZaqYvB21jtJLM3U86IG6DJ4EUOB4af6T5pKyaSfNsSHHf bp9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BsEu2P9TMPZmXhFqUA7krG6TKSGPFlbJtH97mLZ1DkE=; b=h0i/Qfg1YGF3skXe7t9AnzhFALIZl77a7SJptANt5zdjxhLnoyFd9d2gJMj6LDq/Wo 5Sj8y2cLwwqX7BQfi+OkJMIYBGPmrDFpGOfweW/pSkw23ng90Onoxv4Ft0u0jDOM6QsN zEKRcZL7ob8cdkk7YW15+X7S0ZMvt6ny8bNqOwD7Bz7gkuKL7SgrFHI5Bw7vePCEEni+ UXpGTywBllvEf1NQ+EhXrH1By4phNWXNZKb10rKBsjnTcdFhjZ6rGu6kkWIdR/pY8kKZ r/bJe8pVjqz1l4BxYGyis1SHUI3qgXrvjFNUk6yNXYoldimmdOC4HxqzukT/HBGv7U1z Btgg== X-Gm-Message-State: AOAM533eMpT0uWL7cNnzDaALDAlh7riscSgwinNFxLaUsIf0l6vsvM9E GjlYkUTvAxdU3YuPEfGpuqNLLYVa/XUIIoHPtr6+mfIM5/zjpA08 X-Google-Smtp-Source: ABdhPJyUjWJ7NYvqJ0cxxiCL/mPl2swOW9nxK598097IJRsAoAKZ3AO7q3ySUbMDJeptauaAfs5QSGyDkwHaIKLmeXU= X-Received: by 2002:a05:6808:138c:: with SMTP id c12mr8336531oiw.178.1626937420574; Thu, 22 Jul 2021 00:03:40 -0700 (PDT) MIME-Version: 1.0 From: Allen Li Date: Thu, 22 Jul 2021 07:03:29 +0000 Message-ID: Subject: bug#49629: Acknowledgement (27.2; electric-pair-mode doesn't work for angle brackets in HTML file) To: 49629@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49629 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > To reproduce: > > 1. emacs -Q > 2. C-x C-f /tmp/tmp.html RET > 3. M-x electric-pair-local-mode RET > 4. < > > > Expected: > > Buffer contains <> > > Actual: > > Buffer contains <>> > > By default, typing > should skip over the > inserted by > electric-pair-mode when the first < is type (but it doesn't). > > I tried stepping through with Edebug, but the bug disappears when using > Edebug. The difference seems to be in what is returned by > electric-pair--balance-info, but that function is big and unfamiliar to > me. What I've found so far is that using Edebug to step through electric-pair-skip-if-helps-balance, if I manually step past (delete-char -1) and then press g (edebug-go-mode) then the bug disappears. Pressing g before stepping past (delete-char -1) causes the bug. For reference, here is the function: (defun electric-pair-skip-if-helps-balance (char) "Return non-nil if skipping CHAR would benefit parentheses' balance. Works by first removing the character from the buffer, then doing some list calculations, finally restoring the situation as if nothing happened." (pcase (electric-pair-syntax-info char) (`(,syntax ,pair ,_ ,s-or-c) (unwind-protect (progn (delete-char -1) (cond ((eq syntax ?\)) (let* ((pair-data (electric-pair--balance-info -1 s-or-c)) (innermost (car pair-data)) (outermost (cdr pair-data))) (and (cond ((car outermost) (car innermost)) ((car innermost) (not (eq (cdr outermost) pair))))))) ((eq syntax ?\") (electric-pair--inside-string-p char)))) (insert char))))) From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 22 19:35:05 2021 Received: (at 49629) by debbugs.gnu.org; 22 Jul 2021 23:35:05 +0000 Received: from localhost ([127.0.0.1]:41850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6iDZ-0001H9-3h for submit@debbugs.gnu.org; Thu, 22 Jul 2021 19:35:05 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6iDW-0001Gb-9X for 49629@debbugs.gnu.org; Thu, 22 Jul 2021 19:35:03 -0400 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=/80jYltxpjRx/1VtBfiJramDOvR3E0J/2KRdVyPqT1w=; b=trZri2/tzxNBZ+Qgu+aNlFDrJB JMzriPK/dx1T2waNfVWAkKZ+KLIW8/1tsjHkB8A7BccYUjntejoxPKUv0G4Xj1XNh/upM1d/DqS1D Ull+gLEMwxdI/cd8LwM8+EjRec9gTe6MnhT8oPoB3YH74tp724iAh81XrpavqcmwUcaw=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6iDN-00005m-38; Fri, 23 Jul 2021 01:34:55 +0200 From: Lars Ingebrigtsen To: Allen Li Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file References: <801r7vgoxm.fsf@felesatra.moe> X-Now-Playing: Pigface's _Fook_: "I Can Do No Wrong" Date: Fri, 23 Jul 2021 01:34:52 +0200 In-Reply-To: (Allen Li's message of "Thu, 22 Jul 2021 07:03:29 +0000") Message-ID: <87im11gbxf.fsf_-_@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Allen Li writes: > What I've found so far is that using Edebug to step through > electric-pair-skip-if-helps-balance, if I manually step past > (delete-char -1) and then press g (edebug-go-mode) then the bug > disappe [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49629 Cc: 49629@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Allen Li writes: > What I've found so far is that using Edebug to step through > electric-pair-skip-if-helps-balance, if I manually step past > (delete-char -1) and then press g (edebug-go-mode) then the bug > disappears. Pressing g before stepping past (delete-char -1) causes > the bug. If I remember correctly, electric-pair-mode works by doing a lot of magic in `post-self-insert-hook'? In my experience, trying to edebug through code when that hook is running often leads to peculiar results. That is, you have to debug via other means when trying to see what's actually happening here, I think. (I.e., adding `message's all over the place and other tedious things...) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 25 06:08:28 2021 Received: (at 49629) by debbugs.gnu.org; 25 Jul 2021 10:08:29 +0000 Received: from localhost ([127.0.0.1]:47639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7b3c-00054Z-Mo for submit@debbugs.gnu.org; Sun, 25 Jul 2021 06:08:28 -0400 Received: from mail-ot1-f44.google.com ([209.85.210.44]:44974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7b3Z-00054H-Fm for 49629@debbugs.gnu.org; Sun, 25 Jul 2021 06:08:27 -0400 Received: by mail-ot1-f44.google.com with SMTP id o2-20020a9d22020000b0290462f0ab0800so2159361ota.11 for <49629@debbugs.gnu.org>; Sun, 25 Jul 2021 03:08:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1LJLU5kxCTHDGfSORNTbWtpGoGtpIryybTG1IyL3uwc=; b=O0jIFdLzyXoUwrYT1btfZ8RFw6qR3ZqAcIMpOKqtgL9bsPU9uD6K6T/8EcOw4u8GHm eeun1zMoZiDdPjZX9Uhz1ESFvY7AaVGddTRASUaFq17M4L729AbmavtV85iMMUUTkKLX LGjyXZsXQTVq1N5dvaEXXkL/J5EeLX42Dh98cv0c2zSPs+DQfK1utarEZg3Zgh00Irfh G5LaJjsaNl07FLVrTrgHyeHhH2KsmS3szuvkdvExKbaxdMTySmE4oYMgPDGm8469RL9F TAggbp5UJTy2oTkxO0n5IyOaAvIbvzRTB5Bf6Ug16s5nKARaE2umTffJdhNsdOGHkXtu gDkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1LJLU5kxCTHDGfSORNTbWtpGoGtpIryybTG1IyL3uwc=; b=Rq0ap6LugM9akAcjppWc/GOjAI2v7XMA/slnM+SEj063kwtaOVGhXyIAI2jl1eCW5X 5tdyIx+/hj46Fo5MCVh2KzbGzNeXL4MbB2bWajGODTISag2Q+AU0/jSzS60GpgEHyY2+ jnIiaVRsdzgokXDXiHrHPciC10CtQFi6vpd7wmSoth8JG5owMfX/dLUty5FnW1vz6RMP neQL1Eb7HjkDQyEAOE4rDFWhNehRjCTvP8KnvkDJPxZqS26pAq90fxfznlHDqzyyXqUc qziQ0RAO88+WqAnXhOl0ZQtjAnM4N0I2zc6Xhw4tX6LIL6m9qgPuPN+7VIRa+qlV9Nay sRHA== X-Gm-Message-State: AOAM531aDldm2LDbyEW90ffFdniTpr3EWWxfDyNBU3fmcPCgTDrxR0pX 5M3/g769ljP6bSd+YTKHbZ6nlORhAeGABZeTUBTsxg== X-Google-Smtp-Source: ABdhPJzbVje6RKA/nOfL+EH42mdozkyJOZ3PXsmpczPVTXI7oZlOTLAqB77ZByDJA8SmuP5vYhoTiyQNYGWusXoh8Qk= X-Received: by 2002:a05:6830:2385:: with SMTP id l5mr8535203ots.227.1627207699848; Sun, 25 Jul 2021 03:08:19 -0700 (PDT) MIME-Version: 1.0 References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> In-Reply-To: <87im11gbxf.fsf_-_@gnus.org> From: Allen Li Date: Sun, 25 Jul 2021 10:08:09 +0000 Message-ID: Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file To: Lars Ingebrigtsen Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49629 Cc: 49629@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Thu, Jul 22, 2021 at 11:34 PM Lars Ingebrigtsen wrote: > > Allen Li writes: > > > What I've found so far is that using Edebug to step through > > electric-pair-skip-if-helps-balance, if I manually step past > > (delete-char -1) and then press g (edebug-go-mode) then the bug > > disappears. Pressing g before stepping past (delete-char -1) causes > > the bug. > > If I remember correctly, electric-pair-mode works by doing a lot of > magic in `post-self-insert-hook'? In my experience, trying to edebug > through code when that hook is running often leads to peculiar results. > > That is, you have to debug via other means when trying to see what's > actually happening here, I think. (I.e., adding `message's all over the > place and other tedious things...) Thanks for the advice, kind of. I tried some printf debugging and I noticed that the bug goes away when I add (message "%S" (buffer-substring-no-properties (point-min) (point-max))) to the top of electric-pair--balance-info. Maybe I'm being dense, but I think that expression should not have this kind of side effect. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 28 11:42:44 2021 Received: (at 49629) by debbugs.gnu.org; 28 Jul 2021 15:42:44 +0000 Received: from localhost ([127.0.0.1]:55660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8lhk-0006kn-8M for submit@debbugs.gnu.org; Wed, 28 Jul 2021 11:42:44 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8lhi-0006kb-Iu for 49629@debbugs.gnu.org; Wed, 28 Jul 2021 11:42:43 -0400 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=rsMoXf6TjAn/9S4dM+wDeHzvORB+sIHSlJHp4IsNOxo=; b=T0ImZ/QF6nws3SmlhYtk5/PF1F zOzI0r+1ZrE/c7opPErvwqxq2lXL5wZU/divXkOO8Rqorcj2LgeMO/QfhDuz0RCxxmRM4jL8mP6gO nFlLigrNKhtkWOLwZkAD8X173i+RUBoTY4ZBU9oBwJwFNAC+FjM2Pj7VTFuS0xjnwsCg=; Received: from 2.149.45.105.tmi.telenormobil.no ([2.149.45.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m8lha-00015m-1k; Wed, 28 Jul 2021 17:42:36 +0200 From: Lars Ingebrigtsen To: Allen Li Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> Date: Wed, 28 Jul 2021 17:42:32 +0200 In-Reply-To: (Allen Li's message of "Sun, 25 Jul 2021 10:08:09 +0000") Message-ID: <8735rybg2f.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Allen Li writes: > I tried some printf debugging and I noticed that the bug goes away > when I add (message "%S" (buffer-substring-no-properties (point-min) > (point-max))) to the top of electric-pair--balance-info. M [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49629 Cc: 49629@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Allen Li writes: > I tried some printf debugging and I noticed that the bug goes away > when I add (message "%S" (buffer-substring-no-properties (point-min) > (point-max))) to the top of electric-pair--balance-info. Maybe I'm > being dense, but I think that expression should not have this kind of > side effect. It should not, but it sounds like whatever's going on might be redisplay dependent? In which case it might be better to say (push (buffer-string) my-var) at strategic places in the code instead of messaging, and then examining my-var afterwards. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 01 01:06:55 2021 Received: (at 49629) by debbugs.gnu.org; 1 Aug 2021 05:06:55 +0000 Received: from localhost ([127.0.0.1]:35335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mA3gc-0006Gz-So for submit@debbugs.gnu.org; Sun, 01 Aug 2021 01:06:55 -0400 Received: from mail-oi1-f171.google.com ([209.85.167.171]:34674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mA3ga-0006Gk-3X for 49629@debbugs.gnu.org; Sun, 01 Aug 2021 01:06:53 -0400 Received: by mail-oi1-f171.google.com with SMTP id t128so19957229oig.1 for <49629@debbugs.gnu.org>; Sat, 31 Jul 2021 22:06:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iPBcsuJ4mA3Wwh4s1MBX4/Tm2e0FOaVdajKaWWneWP8=; b=KVlZpPABN/xaZ0ycpUgRSWsJbf6XfyTli3Q2/oU9GnvYMekd3cfL4uNdj5IaVJbm+A XMcGwQ+3GMrcCon+SlRF9Xg/wV5W4SBmD8i19ivtNmFXMQoZByD6YpiEcVxfy4TjsbgS +lsDRvDHWjNFMpX7nGwBjAsc/UY5V7bqCs66Uzz4zqlLsxU/VWTb4D0OyhMFMhdHB1HS dcTvUEr49YWvfwyEnP4DTZN6gW7rhdOIXPWAZ0IexHpnSK90RndMT18Nym4Z4wyQ1Gk3 4uexjW4YtyjJlKa0tvE1cQrKbzeqRNVcB1pIHHlhseTCSVeFjR+IM+/QN+l9CAQ0ihCd Ru5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iPBcsuJ4mA3Wwh4s1MBX4/Tm2e0FOaVdajKaWWneWP8=; b=QMkdn4Ic0tN2pQegVwa3V2tXHEWDEraI944aMXdK2oGzzYmd6HBeUdOe05zAWA+jU3 atRTWuGDhWGynUQpt0Vh9bbpU7Qck99bzGpP19q/Axb9KUtdlJQo0tr+gaPgupWI6zST ZrU8NRbVM2r4VbiZtBu/WCSdzKBkj/gKFk+4sgXmDc+ELtVgM7JYvsyN8zlxxKV/ANm2 NBGJUlr6yoDzaQ43i1k+AmOv9bd4sIYP9pnDdgqtJoN3llp9S0XIEQoPZXShHB6KbFQy tDbL4oN8k6lV/4lsgA7d/4iBuT7Jt1jFPnouLEtFK1NG0J4uoR/beaK+/iMnQ1zzpVE8 9hYg== X-Gm-Message-State: AOAM530TUFyk8i5BxLYAmJpwf2QldYsXmhMO8sd0z+F537Prb+qbZbA/ ddH7Iqdr70Y8TD2AwXXf9RJBT6SW1Z07NEibZ0LvXg== X-Google-Smtp-Source: ABdhPJzoOqPjDf1+VrIZZLEww/VNo4+3q+CsqlBn8lTWwOghfJrWHZ3H17sH4YkPOsQrSXblnEDngU/4PdT4maWPvlg= X-Received: by 2002:a05:6808:138c:: with SMTP id c12mr6902383oiw.178.1627794406383; Sat, 31 Jul 2021 22:06:46 -0700 (PDT) MIME-Version: 1.0 References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> In-Reply-To: <8735rybg2f.fsf@gnus.org> From: Allen Li Date: Sun, 1 Aug 2021 05:06:35 +0000 Message-ID: Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file To: Lars Ingebrigtsen Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49629 Cc: 49629@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, Jul 28, 2021 at 3:42 PM Lars Ingebrigtsen wrote: > > Allen Li writes: > > > I tried some printf debugging and I noticed that the bug goes away > > when I add (message "%S" (buffer-substring-no-properties (point-min) > > (point-max))) to the top of electric-pair--balance-info. Maybe I'm > > being dense, but I think that expression should not have this kind of > > side effect. > > It should not, but it sounds like whatever's going on might be redisplay > dependent? In which case it might be better to say > > (push (buffer-string) my-var) > > at strategic places in the code instead of messaging, and then examining > my-var afterwards. I can't reproduce my previous fix of adding `(message "%S" (buffer-substring-no-properties (point-min) (point-max)))` to the top of `electric-pair--balance-info`. At the time, I had many more `message`s scattered throughout the function, but I could reliably make the bug disappear and reappear by adding/removing this particular `message`. Of course, I don't remember exactly what `message`s I had at the time. Thus, I resorted to actually trying to understand the code. I've tracked down the bug to unexpected behavior from the `scan-sexps` call in this part of `electric-pair--balance-info`: (ended-prematurely-fn ;; called when `scan-sexps' crashed against a parenthesis ;; pointing opposite the direction of travel. After ;; traversing that character, the idea is to travel one sexp ;; in the opposite direction looking for a matching ;; delimiter. #'(lambda () (let* ((pos (point)) (matched (save-excursion (cond ((< direction 0) (condition-case err (eq (char-after pos) (electric-pair--with-uncached-syntax (table) (debug) ;; Added by me (matching-paren (char-before (scan-sexps (point) 1))))) (scan-error nil))) The state of my test buffer at this point is `^

` where ^ is point. The buffer starts as ``, and like the comment states, we move point past the `<` "pointing opposite the direction of travel" and look for a match for the opening `<`. However, the `(scan-sexps (point) 1)` here signals `Scan error: "Unbalanced parentheses", 1, 4`. Again, the buffer state here is `^

`. Since `scan-sexps` is C, I haven't dug into it yet, but it seems like it should work. I also checked `(matching-paren ?<)` and `(matching-paren ?>)` here to see if the syntax table recognizes the angle brackets and it appears to do so, so I don't know why `scan-sexps` is complaining. While I don't know how the `syntax-ppss` cache works, I tried added an extra `syntax-ppss-flush-cache` call to the start of the `electric-pair--with-uncached-syntax`, but that doesn't help. My current hypothesis is some odd behavior in how setting the syntax table works. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 01 06:41:58 2021 Received: (at 49629) by debbugs.gnu.org; 1 Aug 2021 10:41:58 +0000 Received: from localhost ([127.0.0.1]:35723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mA8us-0002T2-FR for submit@debbugs.gnu.org; Sun, 01 Aug 2021 06:41:58 -0400 Received: from quimby.gnus.org ([95.216.78.240]:34682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mA8uq-0002Sj-GH for 49629@debbugs.gnu.org; Sun, 01 Aug 2021 06:41:57 -0400 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=JB7G/gE7HFUk+Dq/nvtBGF3SuSudk0xi9up/ukDpGMI=; b=D2M2r9ISeVzDQ/vyBD4SbiQG5/ S3EXu5dhHoKZi/d37W7gNU1BRk950G01/3yGQD6XtxFqn8EOh0J/yyqSecuBgRlt7zBSb0/gWiKJO YliQRS5zN5vyNjmSp+EXwJ4AnyMeiNpoVXpIAHuXDpAipliE6oHnYmoNwjonUF+pDdRU=; Received: from 2.149.45.105.tmi.telenormobil.no ([2.149.45.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mA8uh-0000tW-Hr; Sun, 01 Aug 2021 12:41:50 +0200 From: Lars Ingebrigtsen To: Allen Li Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> Date: Sun, 01 Aug 2021 12:41:45 +0200 In-Reply-To: (Allen Li's message of "Sun, 1 Aug 2021 05:06:35 +0000") Message-ID: <87tuk978gm.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Allen Li writes: > Thus, I resorted to actually trying to understand the code. Darn, I hate it when that happens. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49629 Cc: 49629@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Allen Li writes: > Thus, I resorted to actually trying to understand the code. Darn, I hate it when that happens. > I've tracked down the bug to unexpected behavior from the `scan-sexps` > call in this part of `electric-pair--balance-info`: I can reproduce exactly what you're seeing -- when edebugging, the problem goes away, etc. I put a (redisplay t) into the function, and that also made the problem go away, but that's as far as I've gotten so far. So the problem does indeed seem to be something related to a cache/table somewhere not having been updated... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 09 05:31:27 2021 Received: (at 49629) by debbugs.gnu.org; 9 Dec 2021 10:31:28 +0000 Received: from localhost ([127.0.0.1]:42520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvGhz-00027i-Gx for submit@debbugs.gnu.org; Thu, 09 Dec 2021 05:31:27 -0500 Received: from mail-ua1-f47.google.com ([209.85.222.47]:44689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvGhw-00027R-UY for 49629@debbugs.gnu.org; Thu, 09 Dec 2021 05:31:26 -0500 Received: by mail-ua1-f47.google.com with SMTP id p2so9790495uad.11 for <49629@debbugs.gnu.org>; Thu, 09 Dec 2021 02:31:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VHc71by0Ylpfhy7gRzi28IyR/+rnExgGv4T25UQXozY=; b=va70MppzolOI0mNBpfk1UzonqARRAMozYPkahaxOSYST2Ke1esPOUdpvpU7Mlge0pT w+kXZ/PrJqdIRAg6yhlNmPlGyB5WJJuSXhpA/tjZ5ZBeQic0O7a9Zf0RRDk+4EO99/g3 IDnOGm9lWB1SB6JdmMmURjxBd2cg6kFncPvwCE/8JmsWlxRVRWnQ92h4GSMtPQt9etGO o62x0IP2iIezl8WEaUDyYmclhAnODxRH0sC85ZOuWT8lvmRkOq6e/v1fuRtnNqhHw9tY cwB3zbft5brtyh8G45M2LVsK+4HNuHZtPwBUJzl2HSUdOgoFctAlSfqtFni51fjqOeWp ch3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VHc71by0Ylpfhy7gRzi28IyR/+rnExgGv4T25UQXozY=; b=0VeWe3wzJ9hLsiqACg6Os1ptHFVdWPfOVzLLdJ6aOUQbPmHIC5rP9KPEl26tSlvSx+ c+rab02iohSZeGWN0+mK5nAEJnArshCmU1YfNM/b1LUtj2PO9W3bSDrNYdtaVZLx43SM DCfM9ylPtgRDOaBVZAOeCjeEEKat7JzFgbDOQ9EB7jZu2SwN+/EII75fwn6IhMokQ2G7 6bHM5H91Ow6Diu5jihrTqFjzTf/aht0nY1B/01VdzkwaYZ/U4gb4ZhHCleOOBlLefaWI TcoGbOxUsjZh46b/zrYwFdLUKtn01cgAi5AEBXkRXTc2dQTmz+GotfjX9GIaz43W8+Y0 Grww== X-Gm-Message-State: AOAM533lScDRbErg8vOSRt5eVsluLOdad4Ynx5R9/MR2JDAYkVsw5MNU Ry4o9F++8H1f0ZSODGo1zep9bu+Yng22bF++PQll+yevip7zmA== X-Google-Smtp-Source: ABdhPJw5CXkXFIJKdkjsL/gvAZCiAwEj+xehwAf6L9nlmTPD2KR8wgwLIt2b1Urw/VwV6M07awZTvsj+w38O4/17zzM= X-Received: by 2002:ab0:2616:: with SMTP id c22mr17879709uao.6.1639045879133; Thu, 09 Dec 2021 02:31:19 -0800 (PST) MIME-Version: 1.0 References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> In-Reply-To: <87tuk978gm.fsf@gnus.org> From: Allen Li Date: Thu, 9 Dec 2021 10:31:08 +0000 Message-ID: Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file To: Lars Ingebrigtsen Content-Type: multipart/alternative; boundary="00000000000065890a05d2b41b33" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49629 Cc: 49629@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000065890a05d2b41b33 Content-Type: text/plain; charset="UTF-8" I have bisected this regression to 7fff418edf56244a1fcf54718523aa9b5cb3a854 I will cc Stefan on the miniscule chance he still remembers anything about this and can save me time. Otherwise, I will see if I can pinpoint the regression (or if I messed up the bisect). Author: Stefan Monnier Date: Fri Nov 29 11:51:48 2019 -0500 * lisp/textmodes/mhtml-mode.el: Fix bug#38372 The `sgml-syntax-propertize-rules` rely on the `sgml--syntax-propertize-ppss` setup by `sgml-syntax-propertize` so it is not correct/safe to use them directly like html used to do. Change `sgml-syntax-propertize` so it can be used by mhtml, and then adjust mhtml-mode accordingly. * lisp/textmodes/mhtml-mode.el: Remove redundant `eval-and-compile`. Only require cl-lib at compile-time. (mhtml--syntax-propertize): New const, extracted from mhtml-syntax-propertize. (mhtml-syntax-propertize): Use `sgml-syntax-propertize`. * lisp/textmodes/sgml-mode.el (sgml--syntax-propertize): New const, extracted from sgml-syntax-propertize. (sgml-syntax-propertize): Add optional `rules-function` arg. lisp/textmodes/mhtml-mode.el | 44 ++++++++++++++++++++------------------------ lisp/textmodes/sgml-mode.el | 13 ++++++++----- 2 files changed, 28 insertions(+), 29 deletions(-) On Sun, Aug 1, 2021 at 10:41 AM Lars Ingebrigtsen wrote: > Allen Li writes: > > > Thus, I resorted to actually trying to understand the code. > > Darn, I hate it when that happens. > > > I've tracked down the bug to unexpected behavior from the `scan-sexps` > > call in this part of `electric-pair--balance-info`: > > I can reproduce exactly what you're seeing -- when edebugging, the > problem goes away, etc. > > I put a > > (redisplay t) > > into the function, and that also made the problem go away, but that's as > far as I've gotten so far. So the problem does indeed seem to be > something related to a cache/table somewhere not having been updated... > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --00000000000065890a05d2b41b33 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I have bisected this regression to=C2=A07fff418edf562= 44a1fcf54718523aa9b5cb3a854

I will cc Stefan on th= e miniscule chance he still remembers anything about this and can save me t= ime.
Otherwise, I will see if I can pinpoint the regression (or i= f I messed up the bisect).

Author: Stefan Monnier = <monnier@iro.umontreal.ca>
Date: =C2=A0 Fri Nov 29 11:51:48 2019 -0500
=C2=A0 =C2=A0 * lis= p/textmodes/mhtml-mode.el: Fix bug#38372
=C2=A0 =C2=A0
=C2=A0 =C2=A0= The `sgml-syntax-propertize-rules` rely on the `sgml--syntax-propertize-pp= ss`
=C2=A0 =C2=A0 setup by `sgml-syntax-propertize` so it is not correct= /safe to use
=C2=A0 =C2=A0 them directly like html used to do.
=C2=A0= =C2=A0
=C2=A0 =C2=A0 Change `sgml-syntax-propertize` so it can be used= by mhtml,
=C2=A0 =C2=A0 and then adjust mhtml-mode accordingly.
=C2= =A0 =C2=A0
=C2=A0 =C2=A0 * lisp/textmodes/mhtml-mode.el: Remove redunda= nt `eval-and-compile`.
=C2=A0 =C2=A0 Only require cl-lib at compile-time= .
=C2=A0 =C2=A0 (mhtml--syntax-propertize): New const, extracted from mh= tml-syntax-propertize.
=C2=A0 =C2=A0 (mhtml-syntax-propertize): Use `sgm= l-syntax-propertize`.
=C2=A0 =C2=A0
=C2=A0 =C2=A0 * lisp/textmodes/s= gml-mode.el (sgml--syntax-propertize): New const,
=C2=A0 =C2=A0 extracte= d from sgml-syntax-propertize.
=C2=A0 =C2=A0 (sgml-syntax-propertize): A= dd optional `rules-function` arg.
=C2=A0lisp/textmodes/mhtml-mode.el | 4= 4 ++++++++++++++++++++------------------------
=C2=A0lisp/textmodes/sgml= -mode.el =C2=A0| 13 ++++++++-----
=C2=A02 files changed, 28 insertions(+= ), 29 deletions(-)

<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Allen Li <darkfeline@fe= lesatra.moe> writes:

> Thus, I resorted to actually trying to understand the code.

Darn, I hate it when that happens.

> I've tracked down the bug to unexpected behavior from the `scan-se= xps`
> call in this part of `electric-pair--balance-info`:

I can reproduce exactly what you're seeing -- when edebugging, the
problem goes away, etc.

I put a

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (redisplay t)

into the function, and that also made the problem go away, but that's a= s
far as I've gotten so far.=C2=A0 So the problem does indeed seem to be<= br> something related to a cache/table somewhere not having been updated...

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--00000000000065890a05d2b41b33-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 09 08:30:34 2021 Received: (at 49629) by debbugs.gnu.org; 9 Dec 2021 13:30:34 +0000 Received: from localhost ([127.0.0.1]:42886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvJVK-0002uL-Ac for submit@debbugs.gnu.org; Thu, 09 Dec 2021 08:30:34 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvJVI-0002u6-C2 for 49629@debbugs.gnu.org; Thu, 09 Dec 2021 08:30:32 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A4D2D80172; Thu, 9 Dec 2021 08:30:26 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4F42D80310; Thu, 9 Dec 2021 08:30:25 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1639056625; bh=JLXjcbFKz0W7ZR69FpkjXoTi91KKTKMxQFCU5Gt9wF0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=X6xmouss8kKWyXiB33+a/0FfFQpRqvJaP23yRd1ILDz3puAvTZT7Y8cWo1jK1s6ds 8C7hqd45Fb1/B5Plg1ycFHR0FwHZFe8m1k0B1cXrFdNoR7AtedRT97Y7FfbqRup/Jb 10yxUdjHXfpxzmjk4gxR3mi26K9qCHKToa4Udif+r8RDgUtO+/hBsSrDTQEAo2JUe2 NjsMkjZoY9110A/rrp2KKxIUtnW4xytVJS5mcSpCQTC98a/llWLGC2zmXodTC61ApK jWnXx2Ufznyimsqk0sxXw1GvUzpXurINkNJsh7JQvyNtIURoSCa9xJ0QJnzWOidCIo go0G1IC6Pz9kQ== Received: from pastel (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1948F120663; Thu, 9 Dec 2021 08:30:25 -0500 (EST) From: Stefan Monnier To: Allen Li Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file Message-ID: References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> Date: Thu, 09 Dec 2021 08:30:24 -0500 In-Reply-To: (Allen Li's message of "Thu, 9 Dec 2021 10:31:08 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.089 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49629 Cc: Lars Ingebrigtsen , 49629@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I have bisected this regression to 7fff418edf56244a1fcf54718523aa9b5cb3a854 > > I will cc Stefan on the miniscule chance he still remembers anything about > this and can save me time. > Otherwise, I will see if I can pinpoint the regression (or if I messed up > the bisect). Hmm... I do vaguely remember the change. I don't see the immediate connection, but... >> I can reproduce exactly what you're seeing -- when edebugging, the >> problem goes away, etc. >> >> I put a >> >> (redisplay t) I suspect that a call to `syntax-propertize` at that same place (or nearby) might do the trick as well? Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 24 05:08:06 2021 Received: (at 49629) by debbugs.gnu.org; 24 Dec 2021 10:08:06 +0000 Received: from localhost ([127.0.0.1]:35714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n0hUc-0003XY-B4 for submit@debbugs.gnu.org; Fri, 24 Dec 2021 05:08:06 -0500 Received: from mail-pj1-f48.google.com ([209.85.216.48]:47065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n0hUY-0003X0-7i for 49629@debbugs.gnu.org; Fri, 24 Dec 2021 05:08:04 -0500 Received: by mail-pj1-f48.google.com with SMTP id rj2-20020a17090b3e8200b001b1944bad25so8012684pjb.5 for <49629@debbugs.gnu.org>; Fri, 24 Dec 2021 02:08:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=G2k/PfUcPS7MJmAscUgDtfa5xlnjL0oN5EuWoODVxos=; b=wCSY0hCKD2XgnfJTtH3s195Ea3Bde5s7kTM14zUGazKRi+1n0n3TBkBCKWUJlxDljy o1kUdxVkBm4i+HlCBw5oup22PdvASYdvgBNFOy0exIz+rCB9c59wIFqrsP9A6ATV0Unv AjJ5v5B55izOJ99AWvB8C4ckX7zi33jPrpaSvsbYnVABPsg6ukGXdHW1ZcWyrFoO4CMf 3GlGTZsA5Toa3fiMnmv0Jn2AIchJjz2txfEfYUKIM8D/zhjWDIiyfNcvOOHn+Y6XRuOg aV0KhhGNWLsGBaZ/Z+S/IRXfvxy4Ee2SfYSngGI5qFi+cBzDn0bFE8J5PSj8Wa4koaQM MbdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=G2k/PfUcPS7MJmAscUgDtfa5xlnjL0oN5EuWoODVxos=; b=eVUuSLM/AK0OdJA9JmMGazxe1kwr+uCuoHApvyHlnvW3hUa2qXTEAzcZ4phtwjHxMU 2WEDA3OxR3eq7RYshpxxlviNEDry55xdeajZlLUWKd2zNB2EMyAymbNZQALuwgHejgHd /9ydKLW2VGpXIDY4EKo88ONh47JndztfYjWxWMM9KNRDM+bGfy2VaTUnj6o9V0JFMa2V EC2famfQzpdhiC7ctFmVx88wjjai8r1hvZiBgk95cIEJsbRLfFq8o/lcG5ly457HaEWm UPUUp5suPhos63f39jA/HyzMDljTHGSuN7gcld3qenulrJ0aCMUoN/fzCj4u+zNr66yI zibQ== X-Gm-Message-State: AOAM531tqJLD67IJ4tdLiwVTfjYVMtNNnRvFiiCYunFQt0KaPizRpQTk 1KSkY5yU5Zag1CoFfDsU5swMOg== X-Google-Smtp-Source: ABdhPJw4+MBpV3WIuK98/EvKi5nqvL61gPO8VaA/H2BN9YrE5o6MK6BToeJUvm3JW+H9Qr7i1Txacw== X-Received: by 2002:a17:902:7b82:b0:143:a6d6:34ab with SMTP id w2-20020a1709027b8200b00143a6d634abmr5821655pll.30.1640340476436; Fri, 24 Dec 2021 02:07:56 -0800 (PST) Received: from localhost ([2600:1700:7270:7d1f:fa59:71ff:fe00:10cc]) by smtp.gmail.com with ESMTPSA id v25sm8693295pfg.175.2021.12.24.02.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Dec 2021 02:07:55 -0800 (PST) From: Allen Li To: Stefan Monnier Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> Date: Fri, 24 Dec 2021 02:07:54 -0800 In-Reply-To: (Stefan Monnier's message of "Thu, 09 Dec 2021 08:30:24 -0500") Message-ID: <80zgoq48p1.fsf@felesatra.moe> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49629 Cc: Lars Ingebrigtsen , 49629@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> I have bisected this regression to 7fff418edf56244a1fcf54718523aa9b5cb3a854 >> >> I will cc Stefan on the miniscule chance he still remembers anything about >> this and can save me time. >> Otherwise, I will see if I can pinpoint the regression (or if I messed up >> the bisect). > > Hmm... I do vaguely remember the change. I don't see the immediate > connection, but... Stefan, I think I found an unrelated regression in your commit and I'd like to double-check with you (or anyone else reading). modified lisp/textmodes/sgml-mode.el @@ -395,16 +395,19 @@ sgml--syntax-propertize-ppss (car (sgml--syntax-propertize-ppss (match-beginning 0))))) (string-to-syntax "."))))) - ))) + ) + "Syntax-propertize rules for sgml text. +These have to be run via `sgml-syntax-propertize'")) -(defun sgml-syntax-propertize (start end) +(defconst sgml--syntax-propertize + (syntax-propertize-rules sgml-syntax-propertize-rules)) + +(defun sgml-syntax-propertize (start end &optional rules-function) "Syntactic keywords for `sgml-mode'." (setq sgml--syntax-propertize-ppss (cons start (syntax-ppss start))) (cl-assert (>= (cadr sgml--syntax-propertize-ppss) 0)) (sgml-syntax-propertize-inside end) - (funcall - (syntax-propertize-rules sgml-syntax-propertize-rules) - start end) + (funcall (or rules-function sgml--syntax-propertize) (point) end) ;; Catch any '>' after the last quote. (sgml--syntax-propertize-ppss end)) In the final `funcall`, the `start` argument was changed to `(point)`. Looking at the overall commit, this seems unintentional to me. Unless this was intentional, I will upload a patch to fix it (this still exists in master). Unfortunately, this does not fix the bug I am interested in, but may as well fix it while I'm here. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 24 09:23:21 2021 Received: (at 49629) by debbugs.gnu.org; 24 Dec 2021 14:23:21 +0000 Received: from localhost ([127.0.0.1]:35917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n0lTc-0004EW-Pz for submit@debbugs.gnu.org; Fri, 24 Dec 2021 09:23:20 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n0lTX-0004E4-5M for 49629@debbugs.gnu.org; Fri, 24 Dec 2021 09:23:19 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 36D068051E; Fri, 24 Dec 2021 09:23:09 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D31C180172; Fri, 24 Dec 2021 09:23:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1640355787; bh=ErlRjyDFC+N+wX7Pc5O8LNRkdp4JX4qdhV399qH7WIg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ehD1y89xNiOpTLnZ9vhBS0Krx8rKd/pIIg+hHeU12AHPuuOOp6NWaq5IvwwZJcyKc hqg6g9qlVZ6F0AbmRMpilSOQwC7Z5TuCOqeKOEzsq3ZhqfCzoFyP7l/nkT2Ora4QNM tjkqUtjVbj/bobY7pvgWKk65yPzNdbKBrUI2e9j+ELj9JPfNq5cd4th8rTj8HQ9McD P24LMUW84Q0i2uvFDtupao3EOtFTxQjung5zC0eRgIjLf8FoAw/aSgMoYGv8adlVz2 WWJpIUm+yv1awOClMuhlx79V24etzuEyVD60wcmratR03c7r+XgkYFxgzvZba/5q8o Xi0IHAl9HGsEw== Received: from pastel (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A07D71202C1; Fri, 24 Dec 2021 09:23:07 -0500 (EST) From: Stefan Monnier To: Allen Li Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file Message-ID: References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> <80zgoq48p1.fsf@felesatra.moe> Date: Fri, 24 Dec 2021 09:23:06 -0500 In-Reply-To: <80zgoq48p1.fsf@felesatra.moe> (Allen Li's message of "Fri, 24 Dec 2021 02:07:54 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.081 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49629 Cc: Lars Ingebrigtsen , 49629@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > -(defun sgml-syntax-propertize (start end) > +(defconst sgml--syntax-propertize > + (syntax-propertize-rules sgml-syntax-propertize-rules)) > + > +(defun sgml-syntax-propertize (start end &optional rules-function) > "Syntactic keywords for `sgml-mode'." > (setq sgml--syntax-propertize-ppss (cons start (syntax-ppss start))) > (cl-assert (>= (cadr sgml--syntax-propertize-ppss) 0)) > (sgml-syntax-propertize-inside end) > - (funcall > - (syntax-propertize-rules sgml-syntax-propertize-rules) > - start end) > + (funcall (or rules-function sgml--syntax-propertize) (point) end) > ;; Catch any '>' after the last quote. > (sgml--syntax-propertize-ppss end)) > > In the final `funcall`, the `start` argument was changed to `(point)`. > Looking at the overall commit, this seems unintentional to me. No, this was intentional: `start` is used by passing it to `syntax-ppss` which will move point to `start`. After that some of the text may/will be handled by `sgml-syntax-propertize-inside` which indicates it by moving point past the part that it handled (if any) and the (or rules-function sgml--syntax-propertize) should only apply to the remaining part. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 26 04:42:10 2022 Received: (at 49629) by debbugs.gnu.org; 26 Jun 2022 08:42:10 +0000 Received: from localhost ([127.0.0.1]:46693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5NqM-0006aE-0O for submit@debbugs.gnu.org; Sun, 26 Jun 2022 04:42:10 -0400 Received: from mail-ej1-f47.google.com ([209.85.218.47]:45704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5NqJ-0006Zq-83 for 49629@debbugs.gnu.org; Sun, 26 Jun 2022 04:42:08 -0400 Received: by mail-ej1-f47.google.com with SMTP id h23so12973822ejj.12 for <49629@debbugs.gnu.org>; Sun, 26 Jun 2022 01:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oH15y1VkoqG0996ZyRqYWsUSBYs6Z+nO1wM2p6rYWzY=; b=HzPzyArOxWlpuXfZU5JwouH+fSi69r7hB1IKrA5aTxoNU+uft/978RYXG5cMcVDEVz G02JEXEIlRYYD3UCh+g0N4hzNV0Q6lpd3PjCorZZR1OqZXb3gc3EEZNk2q79Y+nNLY5i SNIHjkWWzuvC9evda50nQHeFXjH1AI4u3wpISYr4f7qAK3IWKruwpVL2VnPnlNQlAQV1 Gay5Kq/DUEKBeYRXUdAjqGZ4eJvxRyFlPUlSmNXc+kyJcmSUEFosnt6QcV1wesmG3OHg Y7z6fjXqUdaL4enYegDxUdQpTdeGeeDRXp/m5zpFl+lXFF4EDbphCNNbaz0+p36T1Dsj RlkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oH15y1VkoqG0996ZyRqYWsUSBYs6Z+nO1wM2p6rYWzY=; b=5lcz9yU5Vo7qijzOF4u1K9Jy4X0eq6Sxvi80sivY+h4gPKxBOcBQaTAezECi0P6Kx/ Iwin0sMNTBWqUBSWAlGAfgzFMd9fjt2xg2+QymWt5Rt2YsziMUOpu49zufoLRsfKu2Dw tQGpwscbToec+/HGIDyhnZfGXtKLpZardHTyv5NCriapB03u92Tb6jBwYdwCQBugvr76 zbLDi4kdsur72tLzNetQ/vpd5fpDL4FebQnzuzPFZn8/2FSH8vPBmruyun9/ZpyiPw6U +l60E3+inUoIPkfSiybTNM8hOXYnfVa9EzT41cKkJgNsPLryUVRISVCNvovMk7r+EN32 WX5w== X-Gm-Message-State: AJIora9MlHdKMl7e23GPQtymothtAdmx/mGjH0lYdbZoFRr0ftBuYjwp vstL7P6TsSxSJQrJ6J9v6ubSzRzzKGIdPXHD1Gryqw== X-Google-Smtp-Source: AGRyM1uPZCNBmR+qGQwpM0Ob8+XaZDKPN8hFXHNCXLMvHmdynbBEQGFlQef8Qjwc8z4YGYlP+/eZ6qQF1KWbFgzkfVU= X-Received: by 2002:a17:906:2086:b0:715:7983:a277 with SMTP id 6-20020a170906208600b007157983a277mr7150367ejq.386.1656232921207; Sun, 26 Jun 2022 01:42:01 -0700 (PDT) MIME-Version: 1.0 References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> In-Reply-To: From: Allen Li Date: Sun, 26 Jun 2022 01:41:49 -0700 Message-ID: Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file To: Lars Ingebrigtsen Content-Type: multipart/alternative; boundary="000000000000ef319905e255c63b" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49629 Cc: 49629@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000ef319905e255c63b Content-Type: text/plain; charset="UTF-8" On Thu, Dec 9, 2021 at 2:31 AM Allen Li wrote: > I have bisected this regression to 7fff418edf56244a1fcf54718523aa9b5cb3a854 > > I will cc Stefan on the miniscule chance he still remembers anything about > this and can save me time. > Otherwise, I will see if I can pinpoint the regression (or if I messed up > the bisect). > Posting an update (or non-update) on this. This regression did seem to be introduced by 7fff418edf56244a1fcf54718523aa9b5cb3a854, however I'm pretty sure there's nothing wrong with the commit itself, it's just that jiggling the code around made this regression reliably occur. > > Author: Stefan Monnier > Date: Fri Nov 29 11:51:48 2019 -0500 > * lisp/textmodes/mhtml-mode.el: Fix bug#38372 > > The `sgml-syntax-propertize-rules` rely on the > `sgml--syntax-propertize-ppss` > setup by `sgml-syntax-propertize` so it is not correct/safe to use > them directly like html used to do. > > Change `sgml-syntax-propertize` so it can be used by mhtml, > and then adjust mhtml-mode accordingly. > > * lisp/textmodes/mhtml-mode.el: Remove redundant `eval-and-compile`. > Only require cl-lib at compile-time. > (mhtml--syntax-propertize): New const, extracted from > mhtml-syntax-propertize. > (mhtml-syntax-propertize): Use `sgml-syntax-propertize`. > > * lisp/textmodes/sgml-mode.el (sgml--syntax-propertize): New const, > extracted from sgml-syntax-propertize. > (sgml-syntax-propertize): Add optional `rules-function` arg. > lisp/textmodes/mhtml-mode.el | 44 > ++++++++++++++++++++------------------------ > lisp/textmodes/sgml-mode.el | 13 ++++++++----- > 2 files changed, 28 insertions(+), 29 deletions(-) > > On Sun, Aug 1, 2021 at 10:41 AM Lars Ingebrigtsen wrote: > >> Allen Li writes: >> >> > Thus, I resorted to actually trying to understand the code. >> >> Darn, I hate it when that happens. >> >> > I've tracked down the bug to unexpected behavior from the `scan-sexps` >> > call in this part of `electric-pair--balance-info`: >> >> I can reproduce exactly what you're seeing -- when edebugging, the >> problem goes away, etc. >> >> I put a >> >> (redisplay t) >> >> into the function, and that also made the problem go away, but that's as >> far as I've gotten so far. So the problem does indeed seem to be >> something related to a cache/table somewhere not having been updated... >> >> -- >> (domestic pets only, the antidote for overdose, milk.) >> bloggy blog: http://lars.ingebrigtsen.no >> > --000000000000ef319905e255c63b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Dec 9, 2021 at 2:31 AM Allen Li &= lt;darkfeline@felesatra.moe> wrote:
=
I h= ave bisected this regression to=C2=A07fff418edf56244a1fcf54718523aa9b5cb3a8= 54

I will cc Stefan on the miniscule chance he sti= ll remembers anything about this and can save me time.
Otherwise,= I will see if I can pinpoint the regression (or if I messed up the bisect)= .

Posting an update (or non-upd= ate) on this.=C2=A0 This regression did seem to be introduced by 7fff418edf= 56244a1fcf54718523aa9b5cb3a854, however I'm pretty sure there's not= hing wrong with the commit itself, it's just that jiggling the code aro= und made this regression reliably occur.
=C2=A0

= Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date: =C2=A0 Fri Nov 29 1= 1:51:48 2019 -0500
=C2=A0 =C2=A0 * lisp/textmodes/mhtml-mode.el: Fix bug= #38372
=C2=A0 =C2=A0
=C2=A0 =C2=A0 The `sgml-syntax-propertize-rules= ` rely on the `sgml--syntax-propertize-ppss`
=C2=A0 =C2=A0 setup by `sgm= l-syntax-propertize` so it is not correct/safe to use
=C2=A0 =C2=A0 them= directly like html used to do.
=C2=A0 =C2=A0
=C2=A0 =C2=A0 Change `= sgml-syntax-propertize` so it can be used by mhtml,
=C2=A0 =C2=A0 and th= en adjust mhtml-mode accordingly.
=C2=A0 =C2=A0
=C2=A0 =C2=A0 * lisp= /textmodes/mhtml-mode.el: Remove redundant `eval-and-compile`.
=C2=A0 = =C2=A0 Only require cl-lib at compile-time.
=C2=A0 =C2=A0 (mhtml--syntax= -propertize): New const, extracted from mhtml-syntax-propertize.
=C2=A0 = =C2=A0 (mhtml-syntax-propertize): Use `sgml-syntax-propertize`.
=C2=A0 = =C2=A0
=C2=A0 =C2=A0 * lisp/textmodes/sgml-mode.el (sgml--syntax-proper= tize): New const,
=C2=A0 =C2=A0 extracted from sgml-syntax-propertize.=C2=A0 =C2=A0 (sgml-syntax-propertize): Add optional `rules-function` arg= .
=C2=A0lisp/textmodes/mhtml-mode.el | 44 ++++++++++++++++++++----------= --------------
=C2=A0lisp/textmodes/sgml-mode.el =C2=A0| 13 ++++++++----= -
=C2=A02 files changed, 28 insertions(+), 29 deletions(-)

=
On Sun, Au= g 1, 2021 at 10:41 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
Allen Li <darkfeline@felesatra.moe>= ; writes:

> Thus, I resorted to actually trying to understand the code.

Darn, I hate it when that happens.

> I've tracked down the bug to unexpected behavior from the `scan-se= xps`
> call in this part of `electric-pair--balance-info`:

I can reproduce exactly what you're seeing -- when edebugging, the
problem goes away, etc.

I put a

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (redisplay t)

into the function, and that also made the problem go away, but that's a= s
far as I've gotten so far.=C2=A0 So the problem does indeed seem to be<= br> something related to a cache/table somewhere not having been updated...

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--000000000000ef319905e255c63b-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 26 05:38:48 2022 Received: (at 49629) by debbugs.gnu.org; 26 Jun 2022 09:38:48 +0000 Received: from localhost ([127.0.0.1]:46740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5Oj9-0007xL-Ct for submit@debbugs.gnu.org; Sun, 26 Jun 2022 05:38:48 -0400 Received: from mail-ed1-f41.google.com ([209.85.208.41]:37753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5Oj7-0007x7-Lv for 49629@debbugs.gnu.org; Sun, 26 Jun 2022 05:38:46 -0400 Received: by mail-ed1-f41.google.com with SMTP id c65so9166135edf.4 for <49629@debbugs.gnu.org>; Sun, 26 Jun 2022 02:38:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R3opLtT7j5zLdn8E8zB9etfnOy795SXBoDonZ0o/ATU=; b=lJCz8KY30Qo+/HnHrbGFUzBN03+vtoRwqL69dGrB3qqWDHn/5Dvl5z3dlcZZdYquQW gNRoEptPNIi/fzZ5W2tpjzG6k6Wrer0u4Venc9K9nD5FMjgwOfHB62u7KDOXc9qT7ZBY P56cetDrWofHpa8zMielWXu6R/NWkbBSHdVRzQHMcAOgJzu7PyZJ2ZIDO3/UUbrlmKsd iQiZKD+K9TfPvj6DhCsxAStyrmHj22gnI5Mz6rB/I4WtPCD5a58pHKnyrpGYWkDyATcu drdb/DyHb3aIVhQnpVkZcsg2tPytyKz2gr/xowkAYThaq2HCMMuoluVIwfJNTjjMkFZy bo3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R3opLtT7j5zLdn8E8zB9etfnOy795SXBoDonZ0o/ATU=; b=pZl0V5dYKe1+SUvxbUmBDq4HPvTba9JcqILbsnku0gb8TPczqnOcy9lvQEPlv36CEl Cck2bYNO5Y5cKVdeDvOtOv/JtWhfMW19AIXn3JbJcdOXBit0ZWf27Fmf/u90oih+ET/k MFCyRUSL0SFRBMBd1dB2Qc+nfwHltQZjbV4DFNH4rz/Zzf/nQUjayo+TNiDukkPyLaNd 7GrR1MM7ZLmbj60InZRAQg1yA7md2NOK9ofY96uQ/WRaA4mDEJZF+y/g58kK9tq3Z2vt NYIC9gqilGU8faZKRrqZDwTo7KH9Vwt+1Z5sX6oi5dvzgAQpLfwa29xGPEUS98SGNLyZ wVlw== X-Gm-Message-State: AJIora9pHU6e0xAj6dLKrQOL93/FP/O2jWRNtuYTT0cA0qeAXNTeqoMT ZagYFdCoPEmUAm3V+c2WeMQz9Dj1TirI1BDr48t7gg== X-Google-Smtp-Source: AGRyM1ulS60iwec0TcQ/3GD/WoQK0T7wvySLS/DF5i5m0IAD2iLVQhEhURi8GmkP9I8stBkj8tbulmrOhjZkqP73dH4= X-Received: by 2002:a05:6402:22a1:b0:437:78c2:d02b with SMTP id cx1-20020a05640222a100b0043778c2d02bmr5897290edb.64.1656236319486; Sun, 26 Jun 2022 02:38:39 -0700 (PDT) MIME-Version: 1.0 References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> In-Reply-To: From: Allen Li Date: Sun, 26 Jun 2022 02:38:28 -0700 Message-ID: Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file To: Lars Ingebrigtsen Content-Type: multipart/mixed; boundary="0000000000007d268b05e256918f" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49629 Cc: Noam Postavsky , 49629@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000007d268b05e256918f Content-Type: multipart/alternative; boundary="0000000000007d268a05e256918d" --0000000000007d268a05e256918d Content-Type: text/plain; charset="UTF-8" I *think* I've fixed this, but it's complicated. Also I could be completely wrong. For what it's worth, I can reproduce the bug without the patch and cannot with the patch, which see attached. `electric-pair--with-uncached-syntax` hides `syntax-propertize-function`, and `mhtml-mode` uses `syntax-propertize-function`. AFAIU, let-binding `syntax-propertize-function` may or may not clear the cached syntax applied by said function, leading to the current heisenbug. If this sounds sensible, then a slightly different patch is needed, because `electric-pair--with-uncached-syntax` is used in some contexts where hiding `syntax-propertize-function` is the correct behavior. See second attached patch for an attempt at this approach. +Noam Postavsky since they added `electric-pair--with-uncached-syntax` On Sun, Jun 26, 2022 at 1:41 AM Allen Li wrote: > On Thu, Dec 9, 2021 at 2:31 AM Allen Li wrote: > >> I have bisected this regression >> to 7fff418edf56244a1fcf54718523aa9b5cb3a854 >> >> I will cc Stefan on the miniscule chance he still remembers anything >> about this and can save me time. >> Otherwise, I will see if I can pinpoint the regression (or if I messed up >> the bisect). >> > > Posting an update (or non-update) on this. This regression did seem to be > introduced by 7fff418edf56244a1fcf54718523aa9b5cb3a854, however I'm pretty > sure there's nothing wrong with the commit itself, it's just that jiggling > the code around made this regression reliably occur. > > >> >> Author: Stefan Monnier >> Date: Fri Nov 29 11:51:48 2019 -0500 >> * lisp/textmodes/mhtml-mode.el: Fix bug#38372 >> >> The `sgml-syntax-propertize-rules` rely on the >> `sgml--syntax-propertize-ppss` >> setup by `sgml-syntax-propertize` so it is not correct/safe to use >> them directly like html used to do. >> >> Change `sgml-syntax-propertize` so it can be used by mhtml, >> and then adjust mhtml-mode accordingly. >> >> * lisp/textmodes/mhtml-mode.el: Remove redundant `eval-and-compile`. >> Only require cl-lib at compile-time. >> (mhtml--syntax-propertize): New const, extracted from >> mhtml-syntax-propertize. >> (mhtml-syntax-propertize): Use `sgml-syntax-propertize`. >> >> * lisp/textmodes/sgml-mode.el (sgml--syntax-propertize): New const, >> extracted from sgml-syntax-propertize. >> (sgml-syntax-propertize): Add optional `rules-function` arg. >> lisp/textmodes/mhtml-mode.el | 44 >> ++++++++++++++++++++------------------------ >> lisp/textmodes/sgml-mode.el | 13 ++++++++----- >> 2 files changed, 28 insertions(+), 29 deletions(-) >> >> On Sun, Aug 1, 2021 at 10:41 AM Lars Ingebrigtsen wrote: >> >>> Allen Li writes: >>> >>> > Thus, I resorted to actually trying to understand the code. >>> >>> Darn, I hate it when that happens. >>> >>> > I've tracked down the bug to unexpected behavior from the `scan-sexps` >>> > call in this part of `electric-pair--balance-info`: >>> >>> I can reproduce exactly what you're seeing -- when edebugging, the >>> problem goes away, etc. >>> >>> I put a >>> >>> (redisplay t) >>> >>> into the function, and that also made the problem go away, but that's as >>> far as I've gotten so far. So the problem does indeed seem to be >>> something related to a cache/table somewhere not having been updated... >>> >>> -- >>> (domestic pets only, the antidote for overdose, milk.) >>> bloggy blog: http://lars.ingebrigtsen.no >>> >> --0000000000007d268a05e256918d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I *think* I've fixed this, but it's complicat= ed.=C2=A0 Also I could be completely wrong.=C2=A0 For what it's worth, = I can reproduce the bug without the patch and cannot with the patch, which = see attached.

`electric-pair--with-uncached-syntax= ` hides `syntax-propertize-function`, and `mhtml-mode` uses `syntax-propert= ize-function`. AFAIU, let-binding=C2=A0 `syntax-propertize-function` may or= may not clear the cached syntax applied by said function, leading to the c= urrent heisenbug.

If this sounds sensible, then a = slightly different patch is needed, because `electric-pair--with-uncached-s= yntax` is used in some contexts where hiding `syntax-propertize-function` i= s the correct behavior.

See second attached patch = for an attempt at this approach.

+Noam Postavsky=C2=A0since they added `electric-pair--with-u= ncached-syntax`

On Sun, Jun 26, 2022 at 1:41 AM Allen Li <darkfeline@= felesatra.moe> wrote:
On Thu, Dec 9, 2021 at 2:31 AM= Allen Li <darkfeline@felesatra.moe> wrote:
I have bisected this regression to=C2=A07fff418edf56244a1fcf5471852= 3aa9b5cb3a854

I will cc Stefan on the miniscule ch= ance he still remembers anything about this and can save me time.
Otherwise, I will see if I can pinpoint the regression (or if I messed up = the bisect).

Posting an update = (or non-update) on this.=C2=A0 This regression did seem to be introduced by= 7fff418edf56244a1fcf54718523aa9b5cb3a854, however I'm pretty sure ther= e's nothing wrong with the commit itself, it's just that jiggling t= he code around made this regression reliably occur.
=C2=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">

=
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date: =C2=A0 F= ri Nov 29 11:51:48 2019 -0500
=C2=A0 =C2=A0 * lisp/textmodes/mhtml-mode.= el: Fix bug#38372
=C2=A0 =C2=A0
=C2=A0 =C2=A0 The `sgml-syntax-prope= rtize-rules` rely on the `sgml--syntax-propertize-ppss`
=C2=A0 =C2=A0 se= tup by `sgml-syntax-propertize` so it is not correct/safe to use
=C2=A0 = =C2=A0 them directly like html used to do.
=C2=A0 =C2=A0
=C2=A0 =C2= =A0 Change `sgml-syntax-propertize` so it can be used by mhtml,
=C2=A0 = =C2=A0 and then adjust mhtml-mode accordingly.
=C2=A0 =C2=A0
=C2=A0 = =C2=A0 * lisp/textmodes/mhtml-mode.el: Remove redundant `eval-and-compile`.=
=C2=A0 =C2=A0 Only require cl-lib at compile-time.
=C2=A0 =C2=A0 (mh= tml--syntax-propertize): New const, extracted from mhtml-syntax-propertize.=
=C2=A0 =C2=A0 (mhtml-syntax-propertize): Use `sgml-syntax-propertize`.<= br>=C2=A0 =C2=A0
=C2=A0 =C2=A0 * lisp/textmodes/sgml-mode.el (sgml--syn= tax-propertize): New const,
=C2=A0 =C2=A0 extracted from sgml-syntax-pro= pertize.
=C2=A0 =C2=A0 (sgml-syntax-propertize): Add optional `rules-fun= ction` arg.
=C2=A0lisp/textmodes/mhtml-mode.el | 44 ++++++++++++++++++++= ------------------------
=C2=A0lisp/textmodes/sgml-mode.el =C2=A0| 13 ++= ++++++-----
=C2=A02 files changed, 28 insertions(+), 29 deletions(-)
=

= On Sun, Aug 1, 2021 at 10:41 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
Allen Li <darkfeline@felesa= tra.moe> writes:

> Thus, I resorted to actually trying to understand the code.

Darn, I hate it when that happens.

> I've tracked down the bug to unexpected behavior from the `scan-se= xps`
> call in this part of `electric-pair--balance-info`:

I can reproduce exactly what you're seeing -- when edebugging, the
problem goes away, etc.

I put a

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (redisplay t)

into the function, and that also made the problem go away, but that's a= s
far as I've gotten so far.=C2=A0 So the problem does indeed seem to be<= br> something related to a cache/table somewhere not having been updated...

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--0000000000007d268a05e256918d-- --0000000000007d268b05e256918f Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Fix-regression.patch" Content-Disposition: attachment; filename="0001-Fix-regression.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l4v37b1j0 RnJvbSA1ZGQ0MmMxMDhiNDkwOTc2MjRjMTYzN2E1NjJlODM5NTM3NTJiMGNmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbGxlbiBMaSA8ZGFya2ZlbGluZUBmZWxlc2F0cmEubW9lPgpE YXRlOiBTdW4sIDI2IEp1biAyMDIyIDAxOjQ3OjE5IC0wNzAwClN1YmplY3Q6IFtQQVRDSF0gRml4 IHJlZ3Jlc3Npb24KCi0tLQogbGlzcC9lbGVjLXBhaXIuZWwgfCAzICstLQogMSBmaWxlIGNoYW5n ZWQsIDEgaW5zZXJ0aW9uKCspLCAyIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3AvZWxl Yy1wYWlyLmVsIGIvbGlzcC9lbGVjLXBhaXIuZWwKaW5kZXggOTY0ZDIxZjExYy4uYjk0ZWFiMDY2 ZiAxMDA2NDQKLS0tIGEvbGlzcC9lbGVjLXBhaXIuZWwKKysrIGIvbGlzcC9lbGVjLXBhaXIuZWwK QEAgLTI0Niw4ICsyNDYsNyBAQCBlbGVjdHJpYy1wYWlyLS13aXRoLXVuY2FjaGVkLXN5bnRheAog Y2FjaGUgaXMgZmx1c2hlZCBmcm9tIHBvc2l0aW9uIFNUQVJULCBkZWZhdWx0aW5nIHRvIHBvaW50 LiIKICAgKGRlY2xhcmUgKGRlYnVnICgoZm9ybSAmb3B0aW9uYWwgZm9ybSkgYm9keSkpIChpbmRl bnQgMSkpCiAgIChsZXQgKChzdGFydC12YXIgKG1ha2Utc3ltYm9sICJzdGFydCIpKSkKLSAgICBg KGxldCAoKHN5bnRheC1wcm9wZXJ0aXplLWZ1bmN0aW9uICMnaWdub3JlKQotICAgICAgICAgICAo LHN0YXJ0LXZhciAsKG9yIHN0YXJ0ICcocG9pbnQpKSkpCisgICAgYChsZXQgKCgsc3RhcnQtdmFy ICwob3Igc3RhcnQgJyhwb2ludCkpKSkKICAgICAgICAodW53aW5kLXByb3RlY3QKICAgICAgICAg ICAgKHdpdGgtc3ludGF4LXRhYmxlICx0YWJsZQogICAgICAgICAgICAgICxAYm9keSkKLS0gCjIu MzYuMQoK --0000000000007d268b05e256918f Content-Type: text/x-patch; charset="US-ASCII"; name="0001-elec-pair-Fix-bug-incorrectly-hiding-syntax-properti.patch" Content-Disposition: attachment; filename="0001-elec-pair-Fix-bug-incorrectly-hiding-syntax-properti.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l4v4720s1 RnJvbSA5NWMyMDkxOWJiNjlkNDZlNmY0NGE5ZTMzMGM3OGU2ZjFkNGE2YThiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbGxlbiBMaSA8ZGFya2ZlbGluZUBmZWxlc2F0cmEubW9lPgpE YXRlOiBTdW4sIDI2IEp1biAyMDIyIDAyOjMyOjQ3IC0wNzAwClN1YmplY3Q6IFtQQVRDSF0gZWxl Yy1wYWlyOiBGaXggYnVnIGluY29ycmVjdGx5IGhpZGluZwogc3ludGF4LXByb3BlcnRpemUtZnVu Y3Rpb24KCk5vdGFibHksIHRoaXMgY2F1c2VzIGVsZWN0cmljLXBhaXItbW9kZSB0byBvZnRlbiBt aXNiZWhhdmUgaW4gSFRNTApmaWxlcyB3aGVuIHBhaXJpbmcgYW5nbGUgYnJhY2tldHMuCi0tLQog bGlzcC9lbGVjLXBhaXIuZWwgfCAyMiArKysrKysrKysrKysrKy0tLS0tLS0tCiAxIGZpbGUgY2hh bmdlZCwgMTQgaW5zZXJ0aW9ucygrKSwgOCBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNw L2VsZWMtcGFpci5lbCBiL2xpc3AvZWxlYy1wYWlyLmVsCmluZGV4IDk2NGQyMWYxMWMuLjkxNWE2 ZDYzMzMgMTAwNjQ0Ci0tLSBhL2xpc3AvZWxlYy1wYWlyLmVsCisrKyBiL2xpc3AvZWxlYy1wYWly LmVsCkBAIC0yMzcsMTYgKzIzNywyMSBAQCBlbGVjdHJpYy1wYWlyLS1pbnNlcnQKICAgICAgICAg KGVsZWN0cmljLWxheW91dC1hbGxvdy1kdXBsaWNhdGUtbmV3bGluZXMgdCkpCiAgICAgKHNlbGYt aW5zZXJ0LWNvbW1hbmQgMSkpKQogCi0oY2wtZGVmbWFjcm8gZWxlY3RyaWMtcGFpci0td2l0aC11 bmNhY2hlZC1zeW50YXggKCh0YWJsZSAmb3B0aW9uYWwgc3RhcnQpICZyZXN0IGJvZHkpCisoY2wt ZGVmbWFjcm8gZWxlY3RyaWMtcGFpci0td2l0aC11bmNhY2hlZC1zeW50YXggKCh0YWJsZSAmb3B0 aW9uYWwgc3RhcnQgZnVuYykgJnJlc3QgYm9keSkKICAgIkxpa2UgYHdpdGgtc3ludGF4LXRhYmxl JywgYnV0IGZsdXNoIHRoZSBgc3ludGF4LXBwc3MnIGNhY2hlIGFmdGVyd2FyZHMuCiBVc2UgdGhp cyBpbnN0ZWFkIG9mICh3aXRoLXN5bnRheC10YWJsZSBUQUJMRSBCT0RZKSB3aGVuIEJPRFkKIGNv bnRhaW5zIGNvZGUgd2hpY2ggbWF5IHVwZGF0ZSB0aGUgYHN5bnRheC1wcHNzJyBjYWNoZS4gIFRo aXMKIGluY2x1ZGVzIGNhbGxpbmcgYHBhcnNlLXBhcnRpYWwtc2V4cCcgYW5kIGFueSBzZXhwLWJh c2VkIG1vdmVtZW50CiBmdW5jdGlvbnMgd2hlbiBgcGFyc2Utc2V4cC1sb29rdXAtcHJvcGVydGll cycgaXMgbm9uLW5pbC4gIFRoZQotY2FjaGUgaXMgZmx1c2hlZCBmcm9tIHBvc2l0aW9uIFNUQVJU LCBkZWZhdWx0aW5nIHRvIHBvaW50LiIKLSAgKGRlY2xhcmUgKGRlYnVnICgoZm9ybSAmb3B0aW9u YWwgZm9ybSkgYm9keSkpIChpbmRlbnQgMSkpCi0gIChsZXQgKChzdGFydC12YXIgKG1ha2Utc3lt Ym9sICJzdGFydCIpKSkKLSAgICBgKGxldCAoKHN5bnRheC1wcm9wZXJ0aXplLWZ1bmN0aW9uICMn aWdub3JlKQorY2FjaGUgaXMgZmx1c2hlZCBmcm9tIHBvc2l0aW9uIFNUQVJULCBkZWZhdWx0aW5n IHRvIHBvaW50LgorRlVOQyBpcyBhbiBvcHRpb25hbCBmdW5jdGlvbiB0byBzZXQgdG8gYHN5bnRh eC1wcm9wZXJ0aXplLWZ1bmN0aW9uJy4iCisgIChkZWNsYXJlIChkZWJ1ZyAoKGZvcm0gJm9wdGlv bmFsIGZvcm0gZm9ybSkgYm9keSkpIChpbmRlbnQgMSkpCisgIChsZXQgKChzdGFydC12YXIgKG1h a2Utc3ltYm9sICJzdGFydCIpKQorICAgICAgICAoZnVuYy12YXIgKG1ha2Utc3ltYm9sICJmdW5j IikpKQorICAgIGAobGV0ICgoc3ludGF4LXByb3BlcnRpemUtZnVuY3Rpb24gKGxldCAoKCxmdW5j LXZhciAsZnVuYykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChp ZiAsZnVuYy12YXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICxmdW5jLXZhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN5 bnRheC1wcm9wZXJ0aXplLWZ1bmN0aW9uKSkpCiAgICAgICAgICAgICgsc3RhcnQtdmFyICwob3Ig c3RhcnQgJyhwb2ludCkpKSkKICAgICAgICAodW53aW5kLXByb3RlY3QKICAgICAgICAgICAgKHdp dGgtc3ludGF4LXRhYmxlICx0YWJsZQpAQCAtMjcyLDcgKzI3Nyw3IEBAIGVsZWN0cmljLXBhaXIt LXN5bnRheC1wcHNzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocG9pbnQpKSkpKQog ICAgIChpZiBzLW9yLWMtc3RhcnQKICAgICAgICAgKGVsZWN0cmljLXBhaXItLXdpdGgtdW5jYWNo ZWQtc3ludGF4IChlbGVjdHJpYy1wYWlyLXRleHQtc3ludGF4LXRhYmxlCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy1vci1jLXN0YXJ0KQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtb3ItYy1zdGFydCAjJ2lnbm9y ZSkKICAgICAgICAgICAocGFyc2UtcGFydGlhbC1zZXhwIHMtb3ItYy1zdGFydCBwb3MpKQogICAg ICAgOzsgSEFDSyEgY2MtbW9kZSBhcHBhcmVudGx5IGhhcyBzb21lIGBzeW50YXgtcHBzcycgYnVn cwogICAgICAgKGlmIChtZW1xIG1ham9yLW1vZGUgJyhjLW1vZGUgYysrIG1vZGUpKQpAQCAtMzI2 LDcgKzMzMSw3IEBAIGVsZWN0cmljLXBhaXItLWJhbGFuY2UtaW5mbwogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChjb25kaXRpb24tY2FzZSBuaWwKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKGVxIChjaGFyLWFmdGVyIHBvcykKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChlbGVjdHJpYy1wYWlyLS13aXRoLXVuY2FjaGVkLXN5bnRheAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0YWJsZSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGFibGUgKHBvaW50KSAoaWYg c3RyaW5nLW9yLWNvbW1lbnQgIydpZ25vcmUpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAobWF0Y2hpbmctcGFyZW4KICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChjaGFyLWJlZm9yZQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChzY2FuLXNleHBzIChwb2ludCkgMSkpKSkpCkBAIC0zNTYsNyArMzYx LDggQEAgZWxlY3RyaWMtcGFpci0tYmFsYW5jZS1pbmZvCiAgICAgKHNhdmUtZXhjdXJzaW9uCiAg ICAgICAod2hpbGUgKG5vdCBvdXRlcm1vc3QpCiAgICAgICAgIChjb25kaXRpb24tY2FzZSBlcnIK LSAgICAgICAgICAgIChlbGVjdHJpYy1wYWlyLS13aXRoLXVuY2FjaGVkLXN5bnRheCAodGFibGUp CisgICAgICAgICAgICAoZWxlY3RyaWMtcGFpci0td2l0aC11bmNhY2hlZC1zeW50YXgKKyAgICAg ICAgICAgICAgICAodGFibGUgKHBvaW50KSAoaWYgc3RyaW5nLW9yLWNvbW1lbnQgIydpZ25vcmUp KQogICAgICAgICAgICAgICAoc2Nhbi1zZXhwcyAocG9pbnQpIChpZiAoPiBkaXJlY3Rpb24gMCkK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBvaW50LW1heCkKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgtIChwb2ludC1tYXgpKSkpCi0tIAoyLjM2 LjEKCg== --0000000000007d268b05e256918f-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 26 08:17:56 2022 Received: (at 49629) by debbugs.gnu.org; 26 Jun 2022 12:17:56 +0000 Received: from localhost ([127.0.0.1]:46880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5RD9-0005nI-ST for submit@debbugs.gnu.org; Sun, 26 Jun 2022 08:17:56 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5RD7-0005n4-RA for 49629@debbugs.gnu.org; Sun, 26 Jun 2022 08:17:54 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E10A6440B72; Sun, 26 Jun 2022 08:17:47 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9955B440984; Sun, 26 Jun 2022 08:17:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656245866; bh=cbNka9Qpgc7aBemEbRC5HV1nbW5zzNVaY5Y7GZ+3tRM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=SAXlZqG5Wtd6Wl8QLbUEspB1BUMs35hSbtQY3uxnRq8rP3JH3gdqqz+9/3DJtuYYm mFE/zO1oMWX+m7cTu2jCJDMd8rUwBbOQ2/f9FHTW5dX0tQnsxyjH+oLstpUowd9RLT l77vxdmrxuYO0SFAkiTk8Edk12yqvvPeSYAliuvrTtybOmfzTZLztFmBNemyzik2AD K8ua1LTedKYSnyEAlqV07ZQQmK7HCb+1+ZOIyxool3DOfQB4oj8fhR3tYmILivOcZ5 uKXEYEW+B0xr5+XmqpfATGw5joXYeXl74EcS57l7yYmKHI8z0PQGHhDlC+irIX3vXI BnexP/NrjwzzA== Received: from alfajor (165.63.10.93.rev.sfr.net [93.10.63.165]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CB193120317; Sun, 26 Jun 2022 08:17:45 -0400 (EDT) From: Stefan Monnier To: Allen Li Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file Message-ID: References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> Date: Sun, 26 Jun 2022 08:17:43 -0400 In-Reply-To: (Allen Li's message of "Sun, 26 Jun 2022 02:38:28 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.119 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49629 Cc: Lars Ingebrigtsen , 49629@debbugs.gnu.org, Noam Postavsky X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I *think* I've fixed this, but it's complicated. Also I could be > completely wrong. For what it's worth, I can reproduce the bug without the > patch and cannot with the patch, which see attached. AFAICT you've indeed found the origin of the problem. > If this sounds sensible, then a slightly different patch is needed, because > `electric-pair--with-uncached-syntax` is used in some contexts where hiding > `syntax-propertize-function` is the correct behavior. I think the code deserves a comment when/where it overrides `syntax-propertize-function` to explain why it's needed. AFAICT it was introduced in commit 89cfdbf729bc731331358e0efc69547547aa3ca2 but that commit doesn't explain why it bound it to nil (which I later changed to `ignore`). Furthermore, the cache could be filled with entries before `start` while the syntax-table (and/or `syntax-propertize-function`) is temporarily changed, so the flush doesn't seem sufficient. [ It's unlikely, because usually the cache will have been pre-filled via font-lock and friends, but it can still occur in corner cases. ] IIUC we use `with-syntax-table` there specifically when we want to provide text-mode style paren matching within comments and strings. Maybe a good way to avoid problem with syntax-ppss/properties is to narrow the buffer to the comment/string at the same time as we `with-syntax-table` and let-bind `syntax-propertize-function`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 26 20:33:58 2022 Received: (at 49629) by debbugs.gnu.org; 27 Jun 2022 00:33:58 +0000 Received: from localhost ([127.0.0.1]:49314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5chS-0002T9-Cw for submit@debbugs.gnu.org; Sun, 26 Jun 2022 20:33:58 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:37565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5chO-0002Su-Mx for 49629@debbugs.gnu.org; Sun, 26 Jun 2022 20:33:57 -0400 Received: by mail-ed1-f49.google.com with SMTP id c65so10831197edf.4 for <49629@debbugs.gnu.org>; Sun, 26 Jun 2022 17:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jbbHhY7ggAmp2LuwABj7Yb1d0V2H+4fAUL3p/XpcBBg=; b=Pf1dnKPeVSBf0hgmK0vil17BIXnzh3CgD+TdjgzjKR2ARklnY6F+CGquJvPh9BJZ2h KsOWsFshmj2zzfYvTwCsK7j37bBjusUqS/S54q9kbCjcu5i9zPBIe0ZxO2RbPI93SfR3 2lKnrQ5z60cmIRkOkFUSRbVx7QYDs4zDeiLv5VZ82/4BqMZuFJ6RFtlcgPHkObzJr+Zt LawWDClrGbMOjx7KhsiyJkhrsQDne5d7JA180F4Mw3tiM3qlpB/vr0/0C+U0f9ok/Wwn uGzZJHRBrnZlG+lrXEIaEeGdTCBIZYb2OQVUN5UH9llyUXrbxDWP4757hSYzJRqKfkCz A/Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jbbHhY7ggAmp2LuwABj7Yb1d0V2H+4fAUL3p/XpcBBg=; b=o/TpY5l7gNAUM1NwOBm10IKhGaHWGMLhf+S8D07nUyeg3H9GOtDaCIpXS6gpY2WIEd 6PiYSJ8rtChuc6A+SlzAJSPvxOhF7WALgR65z3gjbUwHe1Yl356a9IKL6HKzIq1tD2el 554BPVCZA5D4KVa9HB7y7T6RW1Vldb6zg/be+yZjF3XpBxlZfNC54M/7FQD/t2R0lqgy yW63X06ZBvgqu4NVJsPMvwvONN4Ogdqt7oKCPN8uhoZMXUciEdHLC7sbRocoCZWXNNq2 nk2/Gab+CJNZq/xy1/7jeXQ1KtuFXXly21SCN/uNxfNUKXCuUHeVnQIjpsKqbMfbZjiF DR1g== X-Gm-Message-State: AJIora/EFt3mzXwqwcmTLUiChBnympgpK+YygE1Cu3dUk5B1FujUeV/s EbEzvpuahVAF/oKzQW5Qd9tmGx1jNpBgwcDoAtXu4A== X-Google-Smtp-Source: AGRyM1toHpAwhNoKiEaspTY6yRes4eC2MBpgJTONOaEMAouEt2H3fKDuQGCH05t1Ap+WwqQrrfeQjLqn57O8LOm9rRQ= X-Received: by 2002:a05:6402:22a1:b0:437:78c2:d02b with SMTP id cx1-20020a05640222a100b0043778c2d02bmr9555269edb.64.1656290028828; Sun, 26 Jun 2022 17:33:48 -0700 (PDT) MIME-Version: 1.0 References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> In-Reply-To: From: Allen Li Date: Sun, 26 Jun 2022 17:33:37 -0700 Message-ID: Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file To: Stefan Monnier Content-Type: multipart/alternative; boundary="000000000000d04b9805e26312d2" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49629 Cc: Lars Ingebrigtsen , 49629@debbugs.gnu.org, Noam Postavsky X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000d04b9805e26312d2 Content-Type: text/plain; charset="UTF-8" On Sun, Jun 26, 2022 at 5:17 AM Stefan Monnier wrote: > > I *think* I've fixed this, but it's complicated. Also I could be > > completely wrong. For what it's worth, I can reproduce the bug without > the > > patch and cannot with the patch, which see attached. > > AFAICT you've indeed found the origin of the problem. > > > If this sounds sensible, then a slightly different patch is needed, > because > > `electric-pair--with-uncached-syntax` is used in some contexts where > hiding > > `syntax-propertize-function` is the correct behavior. > > I think the code deserves a comment when/where it overrides > `syntax-propertize-function` to explain why it's needed. > AFAICT it was introduced in commit > 89cfdbf729bc731331358e0efc69547547aa3ca2 but that commit doesn't explain > why it bound it to nil (which I later changed to `ignore`). > > Furthermore, the cache could be filled with entries before `start` while > the syntax-table (and/or `syntax-propertize-function`) is temporarily > changed, so the flush doesn't seem sufficient. [ It's unlikely, because > usually the cache will have been pre-filled via font-lock and friends, > but it can still occur in corner cases. ] > > IIUC we use `with-syntax-table` there specifically when we want to > provide text-mode style paren matching within comments and strings. > Maybe a good way to avoid problem with syntax-ppss/properties is to > narrow the buffer to the comment/string at the same time as we > `with-syntax-table` and let-bind `syntax-propertize-function`. > Thanks. Two observations: FIrst, changing `syntax-propertize-function` from nil to `ignore` was wrong IIUC. If the function is set, then it is wholly responsible for applying syntax table. When set to nil the default behavior is used, but when set to `ignore`, that should mean that no syntax is applied at all. In practice, I don't know what behavior that causes. Second, since `electric-pair--with-uncached-syntax` appears to be used for doing text-mode matching (as you've also observed), maybe we should de-generalize it to do only that. I think that allows us to make some simplifying assumptions about the state of the world. > > > Stefan > > --000000000000d04b9805e26312d2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Jun 26, 2022 at 5:17 AM Stefan Mo= nnier <monnier@iro.umontreal= .ca> wrote:
> I *think* I've fixed this, but it= 9;s complicated.=C2=A0 Also I could be
> completely wrong.=C2=A0 For what it's worth, I can reproduce the b= ug without the
> patch and cannot with the patch, which see attached.

AFAICT you've indeed found the origin of the problem.

> If this sounds sensible, then a slightly different patch is needed, be= cause
> `electric-pair--with-uncached-syntax` is used in some contexts where h= iding
> `syntax-propertize-function` is the correct behavior.

I think the code deserves a comment when/where it overrides
`syntax-propertize-function` to explain why it's needed.
AFAICT it was introduced in commit
89cfdbf729bc731331358e0efc69547547aa3ca2 but that commit doesn't explai= n
why it bound it to nil (which I later changed to `ignore`).

Furthermore, the cache could be filled with entries before `start` while the syntax-table=C2=A0 (and/or `syntax-propertize-function`) is temporarily=
changed, so the flush doesn't seem sufficient.=C2=A0 [ It's unlikel= y, because
usually the cache will have been pre-filled via font-lock and friends,
but it can still occur in corner cases.=C2=A0 ]

IIUC we use `with-syntax-table` there specifically when we want to
provide text-mode style paren matching within comments and strings.
Maybe a good way to avoid problem with syntax-ppss/properties is to
narrow the buffer to the comment/string at the same time as we
`with-syntax-table` and let-bind `syntax-propertize-function`.

Thanks.=C2=A0 Two observations:

FIrst, changing `syntax-propertize-function` from nil to `ignore` was= wrong IIUC.=C2=A0 If the function is set, then it is wholly responsible fo= r applying syntax table.=C2=A0 When set to nil the default behavior is used= , but when set to `ignore`, that should mean that no syntax is applied at a= ll.=C2=A0 In practice, I don't know what behavior that causes.
=C2=A0
Second, since `electric-pair--with-uncached-syntax` appe= ars to be used for doing text-mode matching (as you've also observed), = maybe we should de-generalize it to do only that.=C2=A0 I think that allows= us to make some simplifying assumptions about the state of the world.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--000000000000d04b9805e26312d2-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 27 08:39:43 2022 Received: (at 49629) by debbugs.gnu.org; 27 Jun 2022 12:39:43 +0000 Received: from localhost ([127.0.0.1]:50252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5o1n-0007wJ-8K for submit@debbugs.gnu.org; Mon, 27 Jun 2022 08:39:43 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5o1l-0007w6-Dc for 49629@debbugs.gnu.org; Mon, 27 Jun 2022 08:39:41 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 82A05100182; Mon, 27 Jun 2022 08:39:35 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 130E8100134; Mon, 27 Jun 2022 08:39:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656333574; bh=4K1Dx5vQFgAshmwX+YIIKPctIc4BHD/wUbIqVY0c784=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=RvNWHfr4nyq0prNM7vQQLcJaCqHFRouKeNfACFgjwTaiL47qHD7ZkWoZTABviOgyW en5lfFpTA8DKch80L6gXjOoxGy4z1878FtoB5niU1ia/REhskhbS+kE7iT75Dw+OEu SYerXvT6xzaQT49g63IjRxiu1sudG1PCxcAZ7L+E1WyC2Jd2N7p9qe38AbD7UOdKb+ IfgxuLd5ti+kqyPRBIfXg0VBBWX9okIR01wUCHbm3nn8yRbxYj+/1xzpjd77FYjLqZ iswX8iAW54sUPvwpAKfv1Z4KQnRmjarMZqqFx7GmuawdschSfktIVRenOyaQL44ZXg Sgx32WY7udbLA== Received: from alfajor (smb-adp04.hotspot.hub-one.net [213.174.99.154]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 36BBA1201B3; Mon, 27 Jun 2022 08:39:33 -0400 (EDT) From: Stefan Monnier To: Allen Li Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file Message-ID: References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> Date: Mon, 27 Jun 2022 08:39:31 -0400 In-Reply-To: (Allen Li's message of "Sun, 26 Jun 2022 17:33:37 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.095 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49629 Cc: Lars Ingebrigtsen , 49629@debbugs.gnu.org, Noam Postavsky X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > FIrst, changing `syntax-propertize-function` from nil to `ignore` was wrong > IIUC. If the function is set, then it is wholly responsible for applying > syntax table. When set to nil the default behavior is used, but when set > to `ignore`, that should mean that no syntax is applied at all. In > practice, I don't know what behavior that causes. The two behave identically (IOW the "default behavior" is the same as that of `ignore`). > Second, since `electric-pair--with-uncached-syntax` appears to be used for > doing text-mode matching (as you've also observed), maybe we should > de-generalize it to do only that. I think that allows us to make some > simplifying assumptions about the state of the world. Sounds good. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 02 06:48:53 2022 Received: (at 49629) by debbugs.gnu.org; 2 Jul 2022 10:48:53 +0000 Received: from localhost ([127.0.0.1]:39904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7agH-0004Kh-7J for submit@debbugs.gnu.org; Sat, 02 Jul 2022 06:48:53 -0400 Received: from mail-ej1-f49.google.com ([209.85.218.49]:40575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7agC-0004KQ-TD for 49629@debbugs.gnu.org; Sat, 02 Jul 2022 06:48:51 -0400 Received: by mail-ej1-f49.google.com with SMTP id dn9so2941377ejc.7 for <49629@debbugs.gnu.org>; Sat, 02 Jul 2022 03:48:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4tBe8yFPdx9vtALFr0dFA4Lz4sKYiFRyXvz3QSDzP20=; b=7ijH784H1H4aQvGU9ADA4C8IwIP0k/OnOCYDzz20Nkc+FTTo6xM1Ktq1DnmeM4OJKh 09KTXQRs00JksUVMW6LZSTRShG3yF5MRP724JfSsVTfASx0S7FnVEx/6N8bwRzuHlC6m ANPwLxRqm0aR56XfMOfcsU+gkKdaPqTlRN3r/rnzsS0jmb1wyrb2BokRg9CHJpvhFvhr ExxRdTXALPmEWQVO6LpgnBRQOYJr7dixNGl1jNNBNN7ijVNzRtY8lv2l+Pb3kSgY+oek iRsir9/Q9jHNIheUAYIdt5rLSZjiiCKWWCfB3Dqf/fbwfmW9QLNWGUsIk51+HbguUWqB 40SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4tBe8yFPdx9vtALFr0dFA4Lz4sKYiFRyXvz3QSDzP20=; b=jGPdekMaJ0pnjDLo8Xl9i1jbAO8zRvUZOmYR19SxXYGSoI2t+GVHfiZM6+g4fw3j1E hDAsuxXz4StmdDj22ez1bpfGhyx3LA7YAYo9R0+5eK83l3RiZUoNIg2VjShsfeaUmK5E 2v35M313KnyaOzq5bj0zZmpBhzZb0lOESa8clgUTFW7NgoSe56V+loVvJwqY4evKMt9G KZqklSJX/rpIXv5oR4xcAcWNwHeN6HTBoDeYKqALE01FXdR9DYX6Z8G2q5hSeZ8TNHk2 I53zw4vZeo3qugFCkwEJT5AxomD8y1rklRg/uxQyY3mch1tjXzxv0G+QT75aaSPYWBve m0Qg== X-Gm-Message-State: AJIora//7ayMpBd4PGzl0njJpspnyNYYoa7QDqTaibwZomSgRJO1VB50 H4lSo56sASVTruxP+7f90NBjbScshsAlc7NM7pi83A== X-Google-Smtp-Source: AGRyM1vkaNVwMyfmzQQwdgxMCH9Gq/tgZvK+jyzOM0tOhLehVY7qyIjpIpCdxJbfgle4DM8Ux0MdaRGMEa8fWk+qxOQ= X-Received: by 2002:a17:907:30cb:b0:722:e898:c9c8 with SMTP id vl11-20020a17090730cb00b00722e898c9c8mr19027838ejb.465.1656758923001; Sat, 02 Jul 2022 03:48:43 -0700 (PDT) MIME-Version: 1.0 References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> In-Reply-To: From: Allen Li Date: Sat, 2 Jul 2022 03:48:31 -0700 Message-ID: Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file To: Stefan Monnier Content-Type: multipart/mixed; boundary="00000000000015c40b05e2d03fba" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49629 Cc: Lars Ingebrigtsen , 49629@debbugs.gnu.org, Noam Postavsky X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000015c40b05e2d03fba Content-Type: multipart/alternative; boundary="00000000000015c40905e2d03fb8" --00000000000015c40905e2d03fb8 Content-Type: text/plain; charset="UTF-8" How does the attached patch look? I did not clear the syntax patch for the entire buffer because I was worried of the performance impact. We assume that we won't be touching the part of the buffer before the specified start. IIUC there is no issue keeping the cached state from before start using the original table, as we only want to consider the text succeeding start as text. On Mon, Jun 27, 2022 at 5:39 AM Stefan Monnier wrote: > > FIrst, changing `syntax-propertize-function` from nil to `ignore` was > wrong > > IIUC. If the function is set, then it is wholly responsible for applying > > syntax table. When set to nil the default behavior is used, but when set > > to `ignore`, that should mean that no syntax is applied at all. In > > practice, I don't know what behavior that causes. > > The two behave identically (IOW the "default behavior" is the same as > that of `ignore`). > > > Second, since `electric-pair--with-uncached-syntax` appears to be used > for > > doing text-mode matching (as you've also observed), maybe we should > > de-generalize it to do only that. I think that allows us to make some > > simplifying assumptions about the state of the world. > > Sounds good. > > > Stefan > > --00000000000015c40905e2d03fb8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
How does the attached patch look?

I did not clear the syntax patch=C2=A0for the entire buffer because I= was worried of the performance impact.
We assume that we won'= ;t be touching the part of the buffer before the specified start.
IIUC there is no issue keeping the cached state from before start using th= e original table,
as we only want to consider the text succeeding= start as text.

On Mon, Jun 27, 2022 at 5:39 AM Stefan Monnier <monnier@iro.umontreal.ca> wrote= :
> FIrst, ch= anging `syntax-propertize-function` from nil to `ignore` was wrong
> IIUC.=C2=A0 If the function is set, then it is wholly responsible for = applying
> syntax table.=C2=A0 When set to nil the default behavior is used, but = when set
> to `ignore`, that should mean that no syntax is applied at all.=C2=A0 = In
> practice, I don't know what behavior that causes.

The two behave identically (IOW the "default behavior" is the sam= e as
that of `ignore`).

> Second, since `electric-pair--with-uncached-syntax` appears to be used= for
> doing text-mode matching (as you've also observed), maybe we shoul= d
> de-generalize it to do only that.=C2=A0 I think that allows us to make= some
> simplifying assumptions about the state of the world.

Sounds good.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--00000000000015c40905e2d03fb8-- --00000000000015c40b05e2d03fba Content-Type: text/x-patch; charset="US-ASCII"; name="0001-elec-pair-Fix-bug-incorrectly-hiding-syntax-properti.patch" Content-Disposition: attachment; filename="0001-elec-pair-Fix-bug-incorrectly-hiding-syntax-properti.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l53rc1og0 RnJvbSBmYzNhODVmYzgzZmEzZmQ1NGE3MzAwMjU3NWQzMzllNmJiNzQyM2IyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbGxlbiBMaSA8ZGFya2ZlbGluZUBmZWxlc2F0cmEubW9lPgpE YXRlOiBTdW4sIDI2IEp1biAyMDIyIDAyOjMyOjQ3IC0wNzAwClN1YmplY3Q6IFtQQVRDSF0gZWxl Yy1wYWlyOiBGaXggYnVnIGluY29ycmVjdGx5IGhpZGluZwogc3ludGF4LXByb3BlcnRpemUtZnVu Y3Rpb24KClRoZSBtYWluIGJ1ZyB0aGF0IHRoaXMgaXMgZml4aW5nIGlzIGBzeW50YXgtcHJvcGVy dGl6ZS1mdW5jdGlvbicgYmVpbmcKaGlkZGVuIGluIGBlbGVjdHJpYy1wYWlyLS1iYWxhbmNlLWlu Zm8nIHdoZW4gdGhlIG9yaWdpbmFsIHN5bnRheCB0YWJsZQppcyB0byBiZSB1c2VkLCBub3QgYGVs ZWN0cmljLXBhaXItdGV4dC1zeW50YXgtdGFibGUnLgoKTm90YWJseSwgdGhpcyBjYXVzZXMgYGVs ZWN0cmljLXBhaXItbW9kZScgdG8gb2Z0ZW4gbWlzYmVoYXZlIGluIEhUTUwKZmlsZXMgd2hlbiBw YWlyaW5nIGFuZ2xlIGJyYWNrZXRzLgoKVGhpcyBjb21taXQgYWxzbyBmbHVzaGVzIHRoZSBjYWNo ZSBiZWZvcmUgaW5zdGFsbGluZwpgZWxlY3RyaWMtcGFpci10ZXh0LXN5bnRheC10YWJsZScsIHRv IHByZXZlbnQgY2FjaGVkIHN5bnRheCBmb3IgdGhlCm9yaWdpbmFsIHRhYmxlIGZyb20gYWZmZWN0 aW5nIHRoaW5ncy4KLS0tCiBsaXNwL2VsZWMtcGFpci5lbCB8IDgyICsrKysrKysrKysrKysrKysr KysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgNDMgaW5zZXJ0 aW9ucygrKSwgMzkgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9lbGVjLXBhaXIuZWwg Yi9saXNwL2VsZWMtcGFpci5lbAppbmRleCBiYmVkOTU1YTM5Li5kYWIzN2M1MTEwIDEwMDY0NAot LS0gYS9saXNwL2VsZWMtcGFpci5lbAorKysgYi9saXNwL2VsZWMtcGFpci5lbApAQCAtMTg4LDYg KzE4OCwyNSBAQCBlbGVjdHJpYy1wYWlyLWNvbnNlcnZhdGl2ZS1pbmhpYml0CiAgICA7OyBJIGFs c28gZmluZCBpdCBvZnRlbiBwcmVmZXJhYmxlIG5vdCB0byBwYWlyIG5leHQgdG8gYSB3b3JkLgog ICAgKGVxIChjaGFyLXN5bnRheCAoZm9sbG93aW5nLWNoYXIpKSA/dykpKQogCisoY2wtZGVmbWFj cm8gZWxlY3RyaWMtcGFpci0td2l0aC10ZXh0LXN5bnRheCAoKCZvcHRpb25hbCBzdGFydCkgJnJl c3QgYm9keSkKKyAgIlJ1biBCT0RZIHdpdGggYGVsZWN0cmljLXBhaXItdGV4dC1zeW50YXgtdGFi bGUnIGFjdGl2ZS4KK1RoaXMgZW5zdXJlcyB0aGF0IGFsbCBzeW50YXggcmVsYXRlZCB2YWx1ZXMg YXJlIHNldCBwcm9wZXJseSBhbmQgdGhlCitgc3ludGF4LXBwc3MnIGNhY2hlIGlzIGNsZWFyZWQg YmVmb3JlIGFuZCBhZnRlci4KK0luIHBhcnRpY3VsYXIsIHRoaXMgbXVzdCBiZSB1c2VkIHdoZW4g Qk9EWSBjb250YWlucyBjb2RlIHdoaWNoIG1heQordXBkYXRlIHRoZSBgc3ludGF4LXBwc3MnIGNh Y2hlLiAgVGhpcyBpbmNsdWRlcyBjYWxsaW5nCitgcGFyc2UtcGFydGlhbC1zZXhwJyBhbmQgYW55 IHNleHAtYmFzZWQgbW92ZW1lbnQgZnVuY3Rpb25zIHdoZW4KK2BwYXJzZS1zZXhwLWxvb2t1cC1w cm9wZXJ0aWVzJyBpcyBub24tbmlsLiAgVGhlIGNhY2hlIGlzIGZsdXNoZWQgZnJvbQorcG9zaXRp b24gU1RBUlQsIGRlZmF1bHRpbmcgdG8gcG9pbnQuIgorICAoZGVjbGFyZSAoZGVidWcgKCgmb3B0 aW9uYWwgZm9ybSkgYm9keSkpIChpbmRlbnQgMSkpCisgIChsZXQgKChzdGFydC12YXIgKG1ha2Ut c3ltYm9sICJzdGFydCIpKSkKKyAgICBgKGxldCAoKHN5bnRheC1wcm9wZXJ0aXplLWZ1bmN0aW9u IG5pbCkKKyAgICAgICAgICAgKCxzdGFydC12YXIgLChvciBzdGFydCAnKHBvaW50KSkpKQorICAg ICAgIChzeW50YXgtcHBzcy1mbHVzaC1jYWNoZSAsc3RhcnQtdmFyKQorICAgICAgICh1bndpbmQt cHJvdGVjdAorICAgICAgICAgICAod2l0aC1zeW50YXgtdGFibGUgZWxlY3RyaWMtcGFpci10ZXh0 LXN5bnRheC10YWJsZQorICAgICAgICAgICAgICxAYm9keSkKKyAgICAgICAgIChzeW50YXgtcHBz cy1mbHVzaC1jYWNoZSAsc3RhcnQtdmFyKSkpKSkKKwogKGRlZnVuIGVsZWN0cmljLXBhaXItc3lu dGF4LWluZm8gKGNvbW1hbmQtZXZlbnQpCiAgICJDYWxjdWxhdGUgYSBsaXN0IChTWU5UQVggUEFJ UiBVTkNPTkRJVElPTkFMIFNUUklORy1PUi1DT01NRU5ULVNUQVJUKS4KIApAQCAtMjAyLDEzICsy MjEsMTIgQEAgZWxlY3RyaWMtcGFpci1zeW50YXgtaW5mbwogICAgICAgICAgKHBvc3Qtc3RyaW5n LW9yLWNvbW1lbnQgKG50aCA4IChzeW50YXgtcHBzcyAocG9pbnQpKSkpCiAgICAgICAgICAoc3Ry aW5nLW9yLWNvbW1lbnQgKGFuZCBwb3N0LXN0cmluZy1vci1jb21tZW50CiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBwcmUtc3RyaW5nLW9yLWNvbW1lbnQpKQotICAgICAgICAgKHRh YmxlIChpZiBzdHJpbmctb3ItY29tbWVudAotICAgICAgICAgICAgICAgICAgICBlbGVjdHJpYy1w YWlyLXRleHQtc3ludGF4LXRhYmxlCi0gICAgICAgICAgICAgICAgICAoc3ludGF4LXRhYmxlKSkp Ci0gICAgICAgICAodGFibGUtc3ludGF4LWFuZC1wYWlyICh3aXRoLXN5bnRheC10YWJsZSB0YWJs ZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsaXN0IChjaGFyLXN5bnRheCBj b21tYW5kLWV2ZW50KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChv ciAobWF0Y2hpbmctcGFyZW4gY29tbWFuZC1ldmVudCkKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY29tbWFuZC1ldmVudCkpKSkKKyAgICAgICAgICh0YWJsZS1z eW50YXgtYW5kLXBhaXIgKGNsLWZsZXQgKChmICgpIChsaXN0IChjaGFyLXN5bnRheCBjb21tYW5k LWV2ZW50KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKG9yIChtYXRjaGluZy1wYXJlbiBjb21tYW5kLWV2ZW50KQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQtZXZlbnQp KSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGlmIHN0cmluZy1vci1jb21t ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlbGVjdHJpYy1wYWly LS13aXRoLXRleHQtc3ludGF4ICgpIChmKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChmKSkpKQogICAgICAgICAgKGZhbGxiYWNrIChpZiBzdHJpbmctb3ItY29tbWVudAog ICAgICAgICAgICAgICAgICAgICAgICAoYXBwZW5kIGVsZWN0cmljLXBhaXItdGV4dC1wYWlycwog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZWN0cmljLXBhaXItcGFpcnMpCkBAIC0y MzcsMjIgKzI1NSw2IEBAIGVsZWN0cmljLXBhaXItLWluc2VydAogICAgICAgICAoZWxlY3RyaWMt bGF5b3V0LWFsbG93LWR1cGxpY2F0ZS1uZXdsaW5lcyB0KSkKICAgICAoc2VsZi1pbnNlcnQtY29t bWFuZCAxKSkpCiAKLShjbC1kZWZtYWNybyBlbGVjdHJpYy1wYWlyLS13aXRoLXVuY2FjaGVkLXN5 bnRheCAoKHRhYmxlICZvcHRpb25hbCBzdGFydCkgJnJlc3QgYm9keSkKLSAgIkxpa2UgYHdpdGgt c3ludGF4LXRhYmxlJywgYnV0IGZsdXNoIHRoZSBgc3ludGF4LXBwc3MnIGNhY2hlIGFmdGVyd2Fy ZHMuCi1Vc2UgdGhpcyBpbnN0ZWFkIG9mICh3aXRoLXN5bnRheC10YWJsZSBUQUJMRSBCT0RZKSB3 aGVuIEJPRFkKLWNvbnRhaW5zIGNvZGUgd2hpY2ggbWF5IHVwZGF0ZSB0aGUgYHN5bnRheC1wcHNz JyBjYWNoZS4gIFRoaXMKLWluY2x1ZGVzIGNhbGxpbmcgYHBhcnNlLXBhcnRpYWwtc2V4cCcgYW5k IGFueSBzZXhwLWJhc2VkIG1vdmVtZW50Ci1mdW5jdGlvbnMgd2hlbiBgcGFyc2Utc2V4cC1sb29r dXAtcHJvcGVydGllcycgaXMgbm9uLW5pbC4gIFRoZQotY2FjaGUgaXMgZmx1c2hlZCBmcm9tIHBv c2l0aW9uIFNUQVJULCBkZWZhdWx0aW5nIHRvIHBvaW50LiIKLSAgKGRlY2xhcmUgKGRlYnVnICgo Zm9ybSAmb3B0aW9uYWwgZm9ybSkgYm9keSkpIChpbmRlbnQgMSkpCi0gIChsZXQgKChzdGFydC12 YXIgKG1ha2Utc3ltYm9sICJzdGFydCIpKSkKLSAgICBgKGxldCAoKHN5bnRheC1wcm9wZXJ0aXpl LWZ1bmN0aW9uICMnaWdub3JlKQotICAgICAgICAgICAoLHN0YXJ0LXZhciAsKG9yIHN0YXJ0ICco cG9pbnQpKSkpCi0gICAgICAgKHVud2luZC1wcm90ZWN0Ci0gICAgICAgICAgICh3aXRoLXN5bnRh eC10YWJsZSAsdGFibGUKLSAgICAgICAgICAgICAsQGJvZHkpCi0gICAgICAgICAoc3ludGF4LXBw c3MtZmx1c2gtY2FjaGUgLHN0YXJ0LXZhcikpKSkpCi0KIChkZWZ1biBlbGVjdHJpYy1wYWlyLS1z eW50YXgtcHBzcyAoJm9wdGlvbmFsIHBvcyB3aGVyZSkKICAgIkxpa2UgYHN5bnRheC1wcHNzJywg YnV0IHNvbWV0aW1lcyBmYWxsYmFjayB0byBgcGFyc2UtcGFydGlhbC1zZXhwJy4KIApAQCAtMjcx LDggKzI3Myw3IEBAIGVsZWN0cmljLXBhaXItLXN5bnRheC1wcHNzCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoc2tpcC1zeW50YXgtZm9yd2FyZCAiID4hIikKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChwb2ludCkpKSkpCiAgICAgKGlmIHMtb3ItYy1zdGFydAotICAgICAg ICAoZWxlY3RyaWMtcGFpci0td2l0aC11bmNhY2hlZC1zeW50YXggKGVsZWN0cmljLXBhaXItdGV4 dC1zeW50YXgtdGFibGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBzLW9yLWMtc3RhcnQpCisgICAgICAgIChlbGVjdHJpYy1wYWlyLS13aXRoLXRleHQtc3lu dGF4IChzLW9yLWMtc3RhcnQpCiAgICAgICAgICAgKHBhcnNlLXBhcnRpYWwtc2V4cCBzLW9yLWMt c3RhcnQgcG9zKSkKICAgICAgIDs7IEhBQ0shIGNjLW1vZGUgYXBwYXJlbnRseSBoYXMgc29tZSBg c3ludGF4LXBwc3MnIGJ1Z3MKICAgICAgIChpZiAobWVtcSBtYWpvci1tb2RlICcoYy1tb2RlIGMr KyBtb2RlKSkKQEAgLTMwMSw5ICszMDIsNiBAQCBlbGVjdHJpYy1wYWlyLS1iYWxhbmNlLWluZm8K IElmIHBvaW50IGlzIG5vdCBlbmNsb3NlZCBieSBhbnkgbGlzdHMsIHJldHVybiAoKHQpIC4gKHQp KS4iCiAgIChsZXQqIChpbm5lcm1vc3QKICAgICAgICAgIG91dGVybW9zdAotICAgICAgICAgKHRh YmxlIChpZiBzdHJpbmctb3ItY29tbWVudAotICAgICAgICAgICAgICAgICAgICBlbGVjdHJpYy1w YWlyLXRleHQtc3ludGF4LXRhYmxlCi0gICAgICAgICAgICAgICAgICAoc3ludGF4LXRhYmxlKSkp CiAgICAgICAgICAoYXQtdG9wLWxldmVsLW9yLWVxdWl2YWxlbnQtZm4KICAgICAgICAgICA7OyBj YWxsZWQgd2hlbiBgc2Nhbi1zZXhwcycgcmFuIHBlcmZlY3RseSwgd2hlbiBpdCBmb3VuZAogICAg ICAgICAgIDs7IGEgcGFyZW50aGVzaXMgcG9pbnRpbmcgaW4gdGhlIGRpcmVjdGlvbiBvZiB0cmF2 ZWwuCkBAIC0zMjUsMTEgKzMyMywxMiBAQCBlbGVjdHJpYy1wYWlyLS1iYWxhbmNlLWluZm8KICAg ICAgICAgICAgICAgICAgICAgICAgIChjb25kICgoPCBkaXJlY3Rpb24gMCkKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChlcSAoY2hhci1hZnRlciBwb3MpCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoZWxlY3RyaWMtcGFpci0td2l0aC11bmNhY2hlZC1zeW50 YXgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGFibGUpCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtYXRjaGluZy1wYXJlbgot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNoYXItYmVmb3JlCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNjYW4tc2V4cHMgKHBv aW50KSAxKSkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbC1m bGV0ICgoZiAoKSAobWF0Y2hpbmctcGFyZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNoYXItYmVmb3JlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2Nhbi1zZXhwcyAocG9p bnQpIDEpKSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaWYg c3RyaW5nLW9yLWNvbW1lbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChlbGVjdHJpYy1wYWlyLS13aXRoLXRleHQtc3ludGF4ICgpIChmKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZikpKSkKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChzY2FuLWVycm9yIG5pbCkpKQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKHQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBJbiB0aGlz IGNhc2UsIG5vIG5lZWQgdG8gdXNlCkBAIC0zNDMsNyArMzQyLDkgQEAgZWxlY3RyaWMtcGFpci0t YmFsYW5jZS1pbmZvCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChvcGVu ZXIgKGNoYXItYWZ0ZXIgc3RhcnQpKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChhbmQgc3RhcnQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGVxIChj aGFyLWJlZm9yZSBwb3MpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAob3IgKHdpdGgtc3ludGF4LXRhYmxlIHRhYmxlCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAob3IgKGlmIHN0cmluZy1vci1jb21tZW50CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlbGVjdHJpYy1wYWlyLS13aXRo LXRleHQtc3ludGF4ICgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG1hdGNoaW5nLXBhcmVuIG9wZW5lcikpCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWF0Y2hpbmctcGFyZW4gb3BlbmVyKSkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVuZXIpKSkpKSkp KQogICAgICAgICAgICAgICAgICAgICAgKGFjdHVhbC1wYWlyIChpZiAoPiBkaXJlY3Rpb24gMCkK QEAgLTM1NiwxMSArMzU3LDE0IEBAIGVsZWN0cmljLXBhaXItLWJhbGFuY2UtaW5mbwogICAgIChz YXZlLWV4Y3Vyc2lvbgogICAgICAgKHdoaWxlIChub3Qgb3V0ZXJtb3N0KQogICAgICAgICAoY29u ZGl0aW9uLWNhc2UgZXJyCi0gICAgICAgICAgICAoZWxlY3RyaWMtcGFpci0td2l0aC11bmNhY2hl ZC1zeW50YXggKHRhYmxlKQotICAgICAgICAgICAgICAoc2Nhbi1zZXhwcyAocG9pbnQpIChpZiAo PiBkaXJlY3Rpb24gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBv aW50LW1heCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgtIChwb2ludC1t YXgpKSkpCi0gICAgICAgICAgICAgIChmdW5jYWxsIGF0LXRvcC1sZXZlbC1vci1lcXVpdmFsZW50 LWZuKSkKKyAgICAgICAgICAgIChjbC1mbGV0ICgoZiAoKQorICAgICAgICAgICAgICAgICAgICAg ICAgIChzY2FuLXNleHBzIChwb2ludCkgKGlmICg+IGRpcmVjdGlvbiAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwb2ludC1tYXgpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgtIChwb2ludC1tYXgpKSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgKGZ1bmNhbGwgYXQtdG9wLWxldmVsLW9yLWVxdWl2 YWxlbnQtZm4pKSkKKyAgICAgICAgICAgICAgKGlmIHN0cmluZy1vci1jb21tZW50CisgICAgICAg ICAgICAgICAgICAoZWxlY3RyaWMtcGFpci0td2l0aC10ZXh0LXN5bnRheCAoKSAoZikpCisgICAg ICAgICAgICAgICAgKGYpKSkKICAgICAgICAgICAoc2Nhbi1lcnJvcgogICAgICAgICAgICAoY29u ZCAoKG9yCiAgICAgICAgICAgICAgICAgICAgOzsgc29tZSBlcnJvciBoYXBwZW5lZCBhbmQgaXQg aXMgbm90IG9mIHRoZSAiZW5kZWQKLS0gCjIuMzcuMAoK --00000000000015c40b05e2d03fba-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 03 06:32:13 2022 Received: (at 49629) by debbugs.gnu.org; 3 Jul 2022 10:32:13 +0000 Received: from localhost ([127.0.0.1]:43365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7wth-0002V2-KQ for submit@debbugs.gnu.org; Sun, 03 Jul 2022 06:32:13 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7wtg-0002Uo-MM for 49629@debbugs.gnu.org; Sun, 03 Jul 2022 06:32:13 -0400 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:Date:References: In-Reply-To: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=GILjIIjYdKcpWe8hzNia2xvqhHygW4hP6F7XX03IM2Y=; b=atvYkfNzshEfVTIh0Fj+7jbbZv TkRi0rlXEfQcmo+TERyAXvcyZNgCpK/RktyD7rYQvKpNtU7/v4hIzc5HDeF5uu2V+Ls//ycDDWIpH SpkAIVL8igCA94pJ9qC//AtWTzImxDh+n4Jgg+OppTYSm1sAi69hRSHukE+hlON8tlqI=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7wtW-0003vS-1p; Sun, 03 Jul 2022 12:32:04 +0200 From: Lars Ingebrigtsen To: Allen Li Subject: Re: bug#49629: 27.2; electric-pair-mode doesn't work for angle brackets in HTML file In-Reply-To: (Allen Li's message of "Sat, 2 Jul 2022 03:48:31 -0700") References: <801r7vgoxm.fsf@felesatra.moe> <87im11gbxf.fsf_-_@gnus.org> <8735rybg2f.fsf@gnus.org> <87tuk978gm.fsf@gnus.org> X-Now-Playing: The Durutti Column's _Circuses and Bread_: "Dance I" Date: Sun, 03 Jul 2022 12:32:01 +0200 Message-ID: <87zghqbi72.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Allen Li writes: > How does the attached patch look? Makes sense to me, I think, so I've now pushed it to Emacs 29 (with some whitespace changes). Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49629 Cc: Noam Postavsky , Stefan Monnier , 49629@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Allen Li writes: > How does the attached patch look? Makes sense to me, I think, so I've now pushed it to Emacs 29 (with some whitespace changes). -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 03 06:32:21 2022 Received: (at control) by debbugs.gnu.org; 3 Jul 2022 10:32:21 +0000 Received: from localhost ([127.0.0.1]:43368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7wto-0002VP-SA for submit@debbugs.gnu.org; Sun, 03 Jul 2022 06:32:20 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7wtn-0002VA-8C for control@debbugs.gnu.org; Sun, 03 Jul 2022 06:32:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=PGroDYX6IWWRe46V7oYl4w4EG0/I2s6ecjMof6IirR0=; b=DTlr+stk29X+MhTGxaQLPkAueE sxmSZVlOVzsViSZNJHYD+qCwJ/dgFvRn7jIpqZV6jTVpfTtG6/Ra89puVX3ggs0tYyK78br9E360+ zDBTRWV9XLcV2jk0BlXX17JhffFv4qMLfXe2bEqDSYuFlQbu7IOm9lBVH9aYFvgUForA=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7wtf-0003vh-8U for control@debbugs.gnu.org; Sun, 03 Jul 2022 12:32:13 +0200 Date: Sun, 03 Jul 2022 12:32:10 +0200 Message-Id: <87y1xabi6t.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49629 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 49629 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 49629 29.1 quit From unknown Sat Aug 16 18:38:18 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 31 Jul 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator