From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#50538: [PATCH] 28.0.50; electric-pair-mode fails to pair double quotes in some cases in CC mode Date: Wed, 15 Sep 2021 15:17:23 -0700 Message-ID: <716194ea-817f-eaad-f9ce-7d600ad359b1@gmail.com> References: <021853bf-0169-c158-ab3d-296b6c144e08@gmail.com> <83r1dufgxu.fsf@gnu.org> <94c7b4ec-813b-515f-d947-116c294dd74b@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40312"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50538@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 16 00:18:11 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 1mQdEI-000ALg-Uy for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Sep 2021 00:18:10 +0200 Original-Received: from localhost ([::1]:52164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQdEH-0000yY-Lp for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Sep 2021 18:18:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQdEA-0000yQ-GJ for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 18:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQdEA-000117-5O for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 18:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mQdE9-0003sS-T6 for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 18:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Sep 2021 22:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50538 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 50538-submit@debbugs.gnu.org id=B50538.163174425514861 (code B ref 50538); Wed, 15 Sep 2021 22:18:01 +0000 Original-Received: (at 50538) by debbugs.gnu.org; 15 Sep 2021 22:17:35 +0000 Original-Received: from localhost ([127.0.0.1]:53429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQdDi-0003rd-M6 for submit@debbugs.gnu.org; Wed, 15 Sep 2021 18:17:34 -0400 Original-Received: from mail-pj1-f46.google.com ([209.85.216.46]:37582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQdDf-0003rL-3m for 50538@debbugs.gnu.org; Wed, 15 Sep 2021 18:17:33 -0400 Original-Received: by mail-pj1-f46.google.com with SMTP id me5-20020a17090b17c500b0019af76b7bb4so5361382pjb.2 for <50538@debbugs.gnu.org>; Wed, 15 Sep 2021 15:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=0NPzkMwgZ4SYmQk7gFUy/rRXYLLUNffBq3o25MaYRR4=; b=EPlQda/A+t3k6mYTtlAV0NNxZ6Zc9h3ku/OizRk4bOaAVGerwWacoHmWVWIe4wDcI9 qxsZMd/2hbBYSKApJr1/2JRq5FiL2hnMe4u48keMf/AEYw6pv9diSFJkEAZxXKWU+C8j Pu7cUuO+jiovgtjAdZCd7iBy7YEwMHOlE9QUEgi9Gmz7F/h2JzTbv27BUTkV20AffsVe 3pu2XmVPtbtxDy1re/D/sfnnf5QhxHAMXEIuIufeTc8C2OUZ0a9H8QbhblxLOaI+95SH uX6Q99Kua0WwxIoOg6TuYo+C5+jdnqzZr98BwrhRH6Qd5ZTHSMNh04LGnydPfTXhoNjt c16w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0NPzkMwgZ4SYmQk7gFUy/rRXYLLUNffBq3o25MaYRR4=; b=MrxdMO1U9JYTOcr/ABRDEZGmDO0gK7OvNWNMUBIK1lAuX07e6UcsgJ25H/dzLWkFN/ lehj+yDqUENawJobx1iJkyoke/tdI4VF/a4FUyQ7Sxbov1EZQyrvgiyAWdDQ5h8iXdQD 3f9VteFiS2qgD0rWjC+Lb2TP5qJ5RhbZJGPdHh41fn2l/dVUgb4a7JXop6mUEnUZ4OPA A5OYeDr8YSRY+on+B7qSkt4SqXrhGcsgqI1ZY3Pjf//shGQ1VZzJvlzV3/GEXGHKKCyi k4lbHuW0rWNoFxX4g9cpndOlrttDb0H1xcVVZl01EvQyK9aRSnw4uBgpNXAJxZ1bP9KW l+Bw== X-Gm-Message-State: AOAM53011MlSZ4t+ZZd2zihOseRfOaI/afZmJUT1fPyTwjLxvdRTLJQ5 ETMV7TZa/JX7wg7KC+MfvO+eEe9wbIk= X-Google-Smtp-Source: ABdhPJwrCJvwj0mT4TyfudPX2l/RvuoCyjihPNu7dpkDdfvetnTyH0UwAEzocK2TY0d4qrp8kyTuJQ== X-Received: by 2002:a17:902:c789:b0:13c:a112:6383 with SMTP id w9-20020a170902c78900b0013ca1126383mr538705pla.42.1631744245004; Wed, 15 Sep 2021 15:17:25 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id b16sm795649pfr.138.2021.09.15.15.17.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Sep 2021 15:17:24 -0700 (PDT) In-Reply-To: <94c7b4ec-813b-515f-d947-116c294dd74b@gmail.com> Content-Language: en-US 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:214439 Archived-At: On 9/11/2021 8:58 PM, Jim Porter wrote: > (Note: I've just updated my copyright assignment information, but > haven't received confirmation that everything is in order, so this might > need to wait until that's done for it to merge.) I've gotten confirmation that my copyright assignment info is all up-to-date, so once this patch passes muster, it should be ok to merge it. On 9/12/2021 11:05 AM, Jim Porter wrote: > Note however that this solution isn't perfect: it means a user's custom > `electric-pair-inhibit-predicate' can only inhibit *more* than CC mode's > default behavior, not less. I think that's a reasonable compromise > though, and users who want more direct control can set > `electric-pair-inhibit-predicate' inside `c-mode-common-hook'. A > "perfect" solution here would probably require adding new customization > points to `electric-pair-mode' (e.g. a way for major modes to override > how the syntax is analyzed), and I'm not sure the added complexity would > be worth it, especially since this code is already a bit tricky. I'm not sure if someone has a better idea for how to do things, but for my config[1], the patch works well and makes CC modes behave the same as other programming modes. In my opinion, the worst thing `electric-pair-mode' can do is to behave inconsistently, since that forces the user to pay close attention to something that should be almost invisible/automatic. [1] I customize `electric-pair-inhibit-predicate' to disable electric-pairing in strings/comments, and this patch interacts correctly with that customization.