From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gustavo Barros Newsgroups: gmane.emacs.bugs Subject: bug#36307: 26.2; Interaction between electric-pair and electric-quote Date: Mon, 19 Apr 2021 16:55:42 -0300 Message-ID: <87pmyqf3r5.fsf@gmail.com> References: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> <874l4cdz9e.fsf@gmail.com> <87impptkpi.fsf@gmail.com> <87sg3mfeyv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20893"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 27.2 Cc: 36307@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 19 22:26:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYaTG-0005LB-O6 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 22:26:14 +0200 Original-Received: from localhost ([::1]:57884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYaTF-0001OL-9W for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 16:26:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYa02-00033o-NL for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 15:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40624) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYa02-0008Gg-Dj for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 15:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lYa02-0001rO-Cd for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 15:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gustavo Barros Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Apr 2021 19:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36307 X-GNU-PR-Package: emacs Original-Received: via spool by 36307-submit@debbugs.gnu.org id=B36307.16188621577139 (code B ref 36307); Mon, 19 Apr 2021 19:56:02 +0000 Original-Received: (at 36307) by debbugs.gnu.org; 19 Apr 2021 19:55:57 +0000 Original-Received: from localhost ([127.0.0.1]:52170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYZzx-0001r4-J7 for submit@debbugs.gnu.org; Mon, 19 Apr 2021 15:55:57 -0400 Original-Received: from mail-ot1-f50.google.com ([209.85.210.50]:43958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYZzv-0001qs-Ui for 36307@debbugs.gnu.org; Mon, 19 Apr 2021 15:55:56 -0400 Original-Received: by mail-ot1-f50.google.com with SMTP id o13-20020a9d404d0000b029028e0a0ae6b4so14695283oti.10 for <36307@debbugs.gnu.org>; Mon, 19 Apr 2021 12:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to :message-id:date:mime-version:content-transfer-encoding; bh=Ln0plC5V0MfpaWxUgprtrd+tkhyPRXpSEIooj45nzIY=; b=TQ5GHYrZ76ChE1vFa1cZabXb9qZ+3yaSdLKnxm+La8xeOF8y1rINsGgn05xshlpgzo t4qs0kTObOjGwOIN/GNYTbyoT7GVYKLYk5DxO+x4OiPBfjwKU/c8uXiyh3GZKxg0mdlH +UNAWUmIK5KGO7tgNrHjwjmxBHAecXFHu2tJr9ojLE62xyzjcQwfS+DY8UHWFKtjux/J VUnUWqrna01WZie2OlOVpP1YNYRJgE5c8LMGmsKoxBya8+YVSCrR30hzrEyUF8SrgkJx MtJtBMBOgYYVJbqSHnetHbJaIyM/KryqiLBHV8lOK4FP2ZookTNDtDTdyspDsxXqVpUG W7hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version:content-transfer-encoding; bh=Ln0plC5V0MfpaWxUgprtrd+tkhyPRXpSEIooj45nzIY=; b=t0dFvk9ma+gU8Oq6A2DvueI/nBZ3LU1U6z8m9pkLNAEvXo8+fHLG8hpTARv8hUv8ia neLH1Q0tqatAYcgZwebkQmPIzPCG/pT9MwVX4eQDdk8swYYuED4MgsxTxuwKTiEqWLzC CJAT1QsEEFRnFCqRNmPVzWdj3ksAqaNaXRDiHLC52E/JXfR+sfo/LseA3Oo3VBkwzO7O WHej7OVlq6FKFcFBdubvQ/ls0bJ+UsScmnMd77QjjqrMs+xA/I06gs/WcalYU+6zHxpX IuYwUY4rjdbaWtFicB77GgQL3DECBmcBV2jipN1w0n3xASz++pF5cF97BrP0fvTB+Y62 wuRw== X-Gm-Message-State: AOAM530hvg4kRwwvYvgdGLxuXWPLl07H06xK0UMDvC3sKPNvO4mol5EJ Pk4WPob33NjNBj5ML53kyIMt0oQNVTfB6A== X-Google-Smtp-Source: ABdhPJyv0lJqVfO9eG1+/+69scwSH02kyFMXhTHqlVc5YxbX2hGDNynExT2pKkmrvpbF/ItQgLAQng== X-Received: by 2002:a9d:449:: with SMTP id 67mr15736201otc.333.1618862147012; Mon, 19 Apr 2021 12:55:47 -0700 (PDT) Original-Received: from gusbrs-laptop ([156.146.42.229]) by smtp.gmail.com with ESMTPSA id h9sm26296otr.67.2021.04.19.12.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 12:55:46 -0700 (PDT) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:204504 Archived-At: Hi Jo=C3=A3o, On Mon, 19 Apr 2021 at 16:16, Jo=C3=A3o T=C3=A1vora = wrote: > After reading your issue in diagonal, it seems it's to do with > electric-quote-mode and electric-pair-mode. I wrote the latter > mostly, but I didn't write the former, which I think is only for > UTF-8 quotes. I personally turn it off. I don't think it respects > the auto-balancing ideas I put into electric-pair-mode. > > (if that's even what you're asking about, I still haven't read and > processed all your text). > Thanks for answering. Yes, the TL;DR is: `electric-pair-mode' ignores=20 `electric-pair-inhibit-predicate' and=20 `electric-pair-skip-whitespace-function' when the input character is not=20 of syntax class `(?\( ?\" ?\$)'. This indeed affects `electric-quote-mode', thought the problem is in=20 `electric-pair-mode' and should be dealt with there since the check=20 happens in `electric-pair-post-self-insert-function' which runs after=20 `electric-quote-mode's post-self-insert-function. As a matter of fact,=20 the reproduction example in the full report shows a case where=20 `electric-pair-mode' fails for this reason by itself, without=20 `electric-quote-mode'. The case is `text-mode' where "\"" is of syntax=20 class punctuation (not string), so that the pairing is never inhibited. And I'm fine with whatever is your timing for this. I had been living=20 with half measures for a couple of years now, and now that I understood=20 the problem better I could come up with a better local workaround (no=20 good for a proper fix, unfortunately). I really just reported back=20 because it would be nice if this was fixed upstream. Best regards, Gustavo. PS: I wrote in the report: > What I failed to get when I originally reported is that, given the=20 > depths set at each of these modes' hooks,=20 > `electric-indent-post-self-insert-function' runs before=20 > `electric-pair-post-self-insert-function'. And I meant "`electric-quote-post-self-insert-function' runs before=20 `electric-pair-post-self-insert-function'". It was a copy-paste=20 mistake, `electric-indent-mode' is out of the picture here altogether.