From unknown Fri Jun 20 07:15:46 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#36307 <36307@debbugs.gnu.org> To: bug#36307 <36307@debbugs.gnu.org> Subject: Status: 26.2; Interaction between electric-pair and electric-quote Reply-To: bug#36307 <36307@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:15:46 +0000 retitle 36307 26.2; Interaction between electric-pair and electric-quote reassign 36307 emacs submitter 36307 Gustavo Barros severity 36307 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 20 09:20:57 2019 Received: (at submit) by debbugs.gnu.org; 20 Jun 2019 13:20:57 +0000 Received: from localhost ([127.0.0.1]:48071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdwzo-0007aX-RC for submit@debbugs.gnu.org; Thu, 20 Jun 2019 09:20:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:51834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdwzn-0007aQ-E1 for submit@debbugs.gnu.org; Thu, 20 Jun 2019 09:20:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52392) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdwzi-0005IG-4I for bug-gnu-emacs@gnu.org; Thu, 20 Jun 2019 09:20:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdwzb-0008RF-NC for bug-gnu-emacs@gnu.org; Thu, 20 Jun 2019 09:20:49 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:36795) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdwzS-0008Jq-Ss for bug-gnu-emacs@gnu.org; Thu, 20 Jun 2019 09:20:37 -0400 Received: by mail-qt1-x844.google.com with SMTP id p15so3159346qtl.3 for ; Thu, 20 Jun 2019 06:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:subject:from:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=GiK1G4bJJOjm17wDh0KfZtz++dQA2n6PHwETFk7ktcQ=; b=qmrw961bjOvqfixgNvg488lNKKWu9QJClHuO3W9nculHj7oZIrHz+d/mpidF1auyd5 9+N6x1XpaIh0ZllaOhHraIleTpPriSwF9aBUhiWOReYD6xxOc7hTf46dOfMICZHXlGHp ipxj1SCTncHS9DVlUECnqZR/nskI5uRxHEz4GO7a6Z+aRfmS4/ZcqceURQMdheogolgN C/4hBsaeBkM6SaoEuYMzEN2g2eAGJQnDmsApHr04RzW49bFJmL3t20ELY4ElFP/B6qFh F3Q2cra4B5Mgp5pPAS/h0wpRDUQvTG86AUdq4FZwQalZd5Tmb5nEQDhusHrCL+wZ6Il0 xOpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:subject:from:message-id:date :user-agent:mime-version:content-transfer-encoding:content-language; bh=GiK1G4bJJOjm17wDh0KfZtz++dQA2n6PHwETFk7ktcQ=; b=mCbn4XEb+kcmXo/2j9LMyN2p2K0ZSphG4ouh8Q9rKlPY7BkQ7fxIGDcsxXOO850GnQ O+eNRpZ51NEAVjevvjRU9i40N838xI21YtKR4Ty1F0qq+EAeBmSpqOnC7FEzsKKMZf5D mt8BarjsdbR5KLvS2q3yFBMGFs3pwpz7RyMiY2aza+QMdPBE2SSFjHEedUFxkdwTd+ym 9kj5FRPGhcL3pkEuZc/FKQ3z/cfZ+DuaX4/GU2QnM7UcH+D+3FMTmRvgmExzSHZPWObp zwSn5D0S3cqoJqY9gnlfHgV9MErvHM8xELMfP1ND30iJvbjt3wk/jM8kuXLoZb3yzqja 1x3w== X-Gm-Message-State: APjAAAUdl+w/Cdb+uoPqmRnZgXckW6aWS5e2l+fbMSEjYH180HNuivtt xOACOwCZZQiVxAFj0Gmu9CkM/B4bNEQ= X-Google-Smtp-Source: APXvYqx7FxjYqLEkaZl5LHXbbVfYWAXmV5kl5+6bnzXc0OdElD/HJll93Ek6z7qn/H4vl+lToFdVpw== X-Received: by 2002:aed:2063:: with SMTP id 90mr72368076qta.307.1561036822868; Thu, 20 Jun 2019 06:20:22 -0700 (PDT) Received: from [10.2.11.6] (ip-99-2-52-196.nyc.us.northamericancoax.com. [196.52.2.99]) by smtp.gmail.com with ESMTPSA id o54sm14435922qtb.63.2019.06.20.06.20.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jun 2019 06:20:22 -0700 (PDT) To: bug-gnu-emacs@gnu.org Subject: 26.2; Interaction between electric-pair and electric-quote From: Gustavo Barros Message-ID: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> Date: Thu, 20 Jun 2019 10:20:20 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: pt-BR X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-Spam-Score: -1.1 (-) 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.1 (--) I've been using both 'electric-pair-mode' and 'electric-quote-mode' for some time, and they mostly come in really handy. So they are appreciated. But their interaction still leaves some things to be desired for: in sum, electric-quotes do not behave as other electric-pairs. Thus this report. I don't think I can exhaust all the cases involved in their interaction, but I try to document some specific ones I've identified more precisely. So, in the examples bellow, I'll consider mostly two cases: quote insertion on a left word boundary, and quote insertion on an active region. In them, I use "|" to denote point position and "|foo|" to denote an active region. Steps followed: #+begin_src bash emacs -Q #+end_src Then: #+begin_src emacs-lisp (text-mode) (electric-pair-mode) (electric-quote-mode) (setq electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit) #+end_src With this settings in hand, and in the following situations (as described above): #+begin_example foo |bar baz foo |bar| baz #+end_example If we type ` (one backtick), the result is: #+begin_example foo ‘’bar baz foo ‘bar’ baz #+end_example But the expected result would be: #+begin_example foo ‘bar baz foo ‘bar’ baz #+end_example Well, this is 'expected' as far as I can see. Its worth noting though that it is the same behavior exhibited by inserting " (a double quote), thus independently of electric-quote. That is, the pair is inserted in the left boundary of 'bar' for a double quote. This happens in text-mode, but not in emacs-lisp-mode, code or comments, or in org-mode. The pairing in this position also does not happen for other electric-pair symbols, such as braces, parentheses etc. So I don't really know if I'm missing something, and this is expected behavior of the selected 'electric-pair-inhibit-predicate' in text mode, or if there is something else in play. Now, if we type `` (two backticks), we get: #+begin_example foo “”bar baz foo “”bar’ baz #+end_example But the expected result would be: #+begin_example foo “bar baz foo “bar” baz #+end_example Yet, if we further add 'delete-selection' to the bunch: #+begin_src emacs-lisp (delete-selection-mode) #+end_src If we type ` (one backtick), the result is: #+begin_example foo ‘’bar baz foo ‘’ baz #+end_example And, if we type `` (two backticks), we get: #+begin_example foo “”bar baz foo “” baz #+end_example The expectation here is that results should not be affected by 'delete-selection-mode'. As is the case for other electric-pair pairs. Well, this is the report describing the relevant behavior, that I believe not to be expected. But, beyond that, I'd like to add a related suggestion, which I think is pertinent to the issue at hand. The typing strategy adopted by 'electric-quote-mode' relies on the typing of two keys (' single quote; ` backtick), which have to be typed twice to get to a double curved quote. (True, electric-pair can reduce this typing, but that's independent.) Now, the fact that double curved quotes are inserted by the sequential typing of either key complicates their pairing in the active region case. For, as is expected, after the first (single) quote is inserted, the region is no longer active. There might be ways around this, I don't know. Still, making 'electric-quote-mode' (more) context-sensitive may relieve it of the sequencial key pressing, and help solve this technical difficulty. E.g. on a left word boundary, insert a left curved quote; on a right word boundary, insert a right curved quote, and so on. Of course, the relevant cases would have to be thought through. And, of course, a way to force desired behavior in case context-sensitivity doesn't get it right would also have to be provided. But, in this fashion, 'electric-quote-mode' could rely on a single key-pressing for each kind of quote (' single quote and " double quote seem natural candidates), this would likely streamline curved quotes to behave in similar fashion as their other electric-pair relatives. In my view, it would also improve editing experience. Best regards, Gustavo Barros. In GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-04-19 built on gusbrs-laptop Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Linux Mint 19.1 Tessa Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set [2 times] nil t [2 times] electric-pair-conservative-inhibit t Configured using: 'configure --with-mailutils --with-xwidgets --with-modules' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD LCMS2 Important settings: value of $LC_MONETARY: pt_BR.UTF-8 value of $LC_NUMERIC: pt_BR.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: delete-selection-mode: t electric-pair-mode: t tooltip-mode: t global-eldoc-mode: t electric-quote-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils delsel elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 95028 8687) (symbols 48 20427 2) (miscs 40 57 129) (strings 32 28461 1206) (string-bytes 1 748945) (vectors 16 14089) (vector-slots 8 502824 10466) (floats 8 51 322) (intervals 56 225 0) (buffers 992 11)) From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 20 13:31:15 2019 Received: (at control) by debbugs.gnu.org; 20 Jun 2019 17:31:15 +0000 Received: from localhost ([127.0.0.1]:49234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1he0u2-000678-Su for submit@debbugs.gnu.org; Thu, 20 Jun 2019 13:31:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1he0u0-00066Q-Kq for control@debbugs.gnu.org; Thu, 20 Jun 2019 13:31:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1he0tq-00082h-MW for control@debbugs.gnu.org; Thu, 20 Jun 2019 13:31:03 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1he0ti-0005FY-DP for control@debbugs.gnu.org; Thu, 20 Jun 2019 13:30:58 -0400 Subject: control message for bug 36309 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Thu, 20 Jun 2019 13:30:54 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 (---) forcemerge 36307 36309 From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 13:37:16 2019 Received: (at 36307) by debbugs.gnu.org; 26 Jun 2019 17:37:16 +0000 Received: from localhost ([127.0.0.1]:37005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgBrA-0003zB-6q for submit@debbugs.gnu.org; Wed, 26 Jun 2019 13:37:16 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]:46226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgBr7-0003yt-Hx for 36307@debbugs.gnu.org; Wed, 26 Jun 2019 13:37:14 -0400 Received: by mail-qt1-f181.google.com with SMTP id h21so3245328qtn.13 for <36307@debbugs.gnu.org>; Wed, 26 Jun 2019 10:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=elO90dp6uhz9M9d13aKMP0uMhOwQOU5HXtlzqwZY6P8=; b=pJebPQ0NQ+VFmHgvFw7EVqwnpujG9rc76kWlnCjHUHRCKib4NdXspfGFrlQHryqVrU k2UJmZQrxjtheCSzs4182JBnxL1ypJ0te5hBCHJ7yPUB617irsV3Jizsh/p+EXlZeVC8 MJ+zrhYmJckzsUvzDio1mgIoULeU9rs1kRsW4mLCRWTogpqPeLWsAermKzT8I8wjgmny 6TFjGMwjkFWn4K+DKvn2RubHuZ3K9WjclsOgo1HDihK0dpheFSBpQ+mcoTDwTaY5q7KM lDRYsIFf6+m8MKvyMT6I8q40FCcg8zqRHQ7kNrpzNiCN3DtOABK32yne1TpYQrGiTI1x xdFw== 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:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=elO90dp6uhz9M9d13aKMP0uMhOwQOU5HXtlzqwZY6P8=; b=GQW/tinIvbstEk8GjFpSNKNauq7pwZERYg3jThj7PIITIUaNjTwqRaabUoHq/OuK1L 6qBoK7gxJNqgF9ntlDeWa0x3ShRawfN8SaWYebfSrTmp1PBDGIjwHBbeaIhF5Xl4PItU vdasvANNfKbh6325E7NhJ5++j6bJ/W8ofDcJSBb0O2HvDvKLx60MMBduTCFXUx8vIhjc RzRgng5ezN1KhfYMx5zWlXCGJrS1n3fXiwF5LUIm8A5BdpKBFK1fht45dXVXAerouScw zNE10p/w5F+CM5nqFfYO0n6D2++lpG0DZzJE3QA71GhzQiLhFhpdyuiH/4mnvUoSSpZ7 A+5g== X-Gm-Message-State: APjAAAVN/m5/uGwdy4u+kiztFA1OsDVUfh7/iSEU20Ez5fTKx7SowZ0N 76WXCAuY/yOr7yAZfrU8tK8uisRXEN8= X-Google-Smtp-Source: APXvYqwXhSxwh/BMSFrIc4cVFmghlpf+2L2xN8yuXMXxYhaYvufASWKjs+tG2/JOnGctjD4ht0/JrQ== X-Received: by 2002:ac8:21b7:: with SMTP id 52mr4758521qty.59.1561570626644; Wed, 26 Jun 2019 10:37:06 -0700 (PDT) Received: from ufjf-desktop (ip200131561.nat10.ufjf.br. [200.131.56.1]) by smtp.gmail.com with ESMTPSA id x205sm8782273qka.56.2019.06.26.10.37.04 for <36307@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jun 2019 10:37:05 -0700 (PDT) References: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> User-agent: mu4e 1.2.0; emacs 26.2 From: Gustavo Barros To: 36307@debbugs.gnu.org Subject: Re: 26.2; Interaction between electric-pair and electric-quote In-reply-to: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> Date: Wed, 26 Jun 2019 14:37:01 -0300 Message-ID: <874l4cdz9e.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 36307 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: -0.7 (/) I've been looking further into this, and have some things to add. I had missed two things in the current available structure when I first wro= te.=20 The first is =3Delectric-quote-context-sensitive=3D, which I don't know how= I had=20 missed. This means the suggestion I made to have a context sensitive elect= ric=20 quote is already in place. The second thing I had missed is how convenient the typing strategy=20 implemented by electric quote can be, in the appropriate (or more common)=20 setting. The reason I had failed to see this is that I use a pt_br keyboar= d=20 where the backtick key is both a shift key and an accent key, that is, I ha= d=20 to press it four times holding shift to get a double quote. Having found o= ut=20 about =3Delectric-quote-context-sensitive=3D, though, allows me to use the = single=20 quote, which is neither a shift nor an accent key in my keyboard, and I mus= t=20 recognize it is indeed neat. Better than the chord the shift key would=20 require. So, this is true for all who use an US international keyboard, in= =20 which both the single quote and the backtick are of convenient typing. Thi= s=20 is general enough, but might not be universal. All in all, I take back my final suggestion. What is already in place is=20 superior to what I had envisaged and suggested. However, the cases described in the report could indeed work for electric=20 quotes in a more akin fashion to other electric pairs. If this is possible= , I=20 think it is still desirable. In this respect, I've reached a temporary workaround to inhibit the pairing= in=20 a left word boundary (no bliss yet for del-sel though): #+begin_src emacs-lisp (defun my/electric-quote-inhibit-pair (orig-fun &rest args) (apply orig-fun args) (when (eq (char-syntax (following-char)) ?w); only before words. (pcase electric-quote-chars (`(,q< ,q> ,q<< ,q>>) (save-excursion (cond ((search-backward (string q>) (1- (point)) t) (replace-match "")) ((search-backward (string q>>) (1- (point)) t) (replace-match "")))))))) (advice-add 'electric-quote-post-self-insert-function :around #'my/electric-quote-inhibit-pair) #+end_src I bring this because I played with different inhibit rules in the ~when~=20 clause, and had initially tried to use the same inhibit criteria as I use f= or=20 the remaining electric pairs, that is simply using=20 ~electric-pair-inhibit-predicate~. This led to some undesired behavior at = the=20 moment of *closing* the quotes, which did not skip as expected. So, as far= as=20 I can tell, different pairing inhibit rules might be needed for electric=20 quotes in particular. For this workaround I kept only left word boundaries. Best regards, Gustavo Barros. On Thu, Jun 20 2019, Gustavo Barros wrote: > I've been using both 'electric-pair-mode' and 'electric-quote-mode' for s= ome > time, and they mostly come in really handy. So they are appreciated. But > their interaction still leaves some things to be desired for: in sum, > electric-quotes do not behave as other electric-pairs. Thus this report. > > I don't think I can exhaust all the cases involved in their interaction, = but=20 > I > try to document some specific ones I've identified more precisely. > > So, in the examples bellow, I'll consider mostly two cases: quote inserti= on=20 > on > a left word boundary, and quote insertion on an active region. In them, I= =20 > use > "|" to denote point position and "|foo|" to denote an active region. > > Steps followed: > > #+begin_src bash > emacs -Q > #+end_src > > Then: > > #+begin_src emacs-lisp > (text-mode) > (electric-pair-mode) > (electric-quote-mode) > (setq electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit) > #+end_src > > With this settings in hand, and in the following situations (as described > above): > > #+begin_example > foo |bar baz > foo |bar| baz > #+end_example > > If we type ` (one backtick), the result is: > > #+begin_example > foo =E2=80=98=E2=80=99bar baz > foo =E2=80=98bar=E2=80=99 baz > #+end_example > > But the expected result would be: > > #+begin_example > foo =E2=80=98bar baz > foo =E2=80=98bar=E2=80=99 baz > #+end_example > > Well, this is 'expected' as far as I can see. Its worth noting though tha= t=20 > it > is the same behavior exhibited by inserting " (a double quote), thus > independently of electric-quote. That is, the pair is inserted in the left > boundary of 'bar' for a double quote. This happens in text-mode, but not = in > emacs-lisp-mode, code or comments, or in org-mode. The pairing in this > position also does not happen for other electric-pair symbols, such as=20 > braces, > parentheses etc. So I don't really know if I'm missing something, and thi= s=20 > is > expected behavior of the selected 'electric-pair-inhibit-predicate' in te= xt > mode, or if there is something else in play. > > Now, if we type `` (two backticks), we get: > > #+begin_example > foo =E2=80=9C=E2=80=9Dbar baz > foo =E2=80=9C=E2=80=9Dbar=E2=80=99 baz > #+end_example > > But the expected result would be: > > #+begin_example > foo =E2=80=9Cbar baz > foo =E2=80=9Cbar=E2=80=9D baz > #+end_example > > Yet, if we further add 'delete-selection' to the bunch: > > #+begin_src emacs-lisp > (delete-selection-mode) > #+end_src > > If we type ` (one backtick), the result is: > > #+begin_example > foo =E2=80=98=E2=80=99bar baz > foo =E2=80=98=E2=80=99 baz > #+end_example > > And, if we type `` (two backticks), we get: > > #+begin_example > foo =E2=80=9C=E2=80=9Dbar baz > foo =E2=80=9C=E2=80=9D baz > #+end_example > > The expectation here is that results should not be affected by > 'delete-selection-mode'. As is the case for other electric-pair pairs. > > > Well, this is the report describing the relevant behavior, that I believe= =20 > not > to be expected. But, beyond that, I'd like to add a related suggestion,=20 > which > I think is pertinent to the issue at hand. > > The typing strategy adopted by 'electric-quote-mode' relies on the typing= of > two keys (' single quote; ` backtick), which have to be typed twice to ge= t=20 > to > a double curved quote. (True, electric-pair can reduce this typing, but > that's independent.) > > Now, the fact that double curved quotes are inserted by the sequential=20 > typing > of either key complicates their pairing in the active region case. For, a= s=20 > is > expected, after the first (single) quote is inserted, the region is no=20 > longer > active. There might be ways around this, I don't know. > > Still, making 'electric-quote-mode' (more) context-sensitive may relieve = it=20 > of > the sequencial key pressing, and help solve this technical difficulty. > E.g. on a left word boundary, insert a left curved quote; on a right word > boundary, insert a right curved quote, and so on. Of course, the relevant > cases would have to be thought through. And, of course, a way to force > desired behavior in case context-sensitivity doesn't get it right would a= lso > have to be provided. > > But, in this fashion, 'electric-quote-mode' could rely on a single > key-pressing for each kind of quote (' single quote and " double quote se= em > natural candidates), this would likely streamline curved quotes to behave= in > similar fashion as their other electric-pair relatives. In my view, it wo= uld > also improve editing experience. > > > Best regards, > Gustavo Barros. > > > > > > > > > > In GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) > of 2019-04-19 built on gusbrs-laptop > Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 > System Description: Linux Mint 19.1 Tessa > > Recent messages: > For information about GNU Emacs and the GNU system, type C-h C-a. > Mark set [2 times] > nil > t [2 times] > electric-pair-conservative-inhibit > t > > Configured using: > 'configure --with-mailutils --with-xwidgets --with-modules' > > Configured features: > XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB > NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB > TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS > LIBSYSTEMD LCMS2 > > Important settings: > value of $LC_MONETARY: pt_BR.UTF-8 > value of $LC_NUMERIC: pt_BR.UTF-8 > value of $LANG: en_US.UTF-8 > locale-coding-system: utf-8-unix > > Major mode: Text > > Minor modes in effect: > delete-selection-mode: t > electric-pair-mode: t > tooltip-mode: t > global-eldoc-mode: t > electric-quote-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > line-number-mode: t > transient-mark-mode: t > > Load-path shadows: > None found. > > Features: > (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv > bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs > format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg > epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode > mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 > rfc2045 ietf-drums mm-util mail-prsvr mail-utils delsel elec-pair > time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks > lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar > dnd fontset image regexp-opt fringe tabulated-list replace newcomment > text-mode elisp-mode lisp-mode prog-mode register page menu-bar > rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock > syntax facemenu font-core term/tty-colors frame cl-generic cham georgian > utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean > japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european > ethiopic indian cyrillic chinese composite charscript charprop > case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer > cl-preloaded nadvice loaddefs button faces cus-face macroexp files > text-properties overlay sha1 md5 base64 format env code-pages mule > custom widget hashtable-print-readable backquote threads dbusbind > inotify lcms2 dynamic-setting system-font-setting font-render-setting > xwidget-internal move-toolbar gtk x-toolkit x multi-tty > make-network-process emacs) > > Memory information: > ((conses 16 95028 8687) > (symbols 48 20427 2) > (miscs 40 57 129) > (strings 32 28461 1206) > (string-bytes 1 748945) > (vectors 16 14089) > (vector-slots 8 502824 10466) > (floats 8 51 322) > (intervals 56 225 0) > (buffers 992 11)) From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 18 16:26:29 2019 Received: (at 36307) by debbugs.gnu.org; 18 Sep 2019 20:26:29 +0000 Received: from localhost ([127.0.0.1]:54887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAgWy-0006WE-Tz for submit@debbugs.gnu.org; Wed, 18 Sep 2019 16:26:29 -0400 Received: from mail-qk1-f176.google.com ([209.85.222.176]:39453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAgWx-0006W0-Gx for 36307@debbugs.gnu.org; Wed, 18 Sep 2019 16:26:28 -0400 Received: by mail-qk1-f176.google.com with SMTP id 4so873776qki.6 for <36307@debbugs.gnu.org>; Wed, 18 Sep 2019 13:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=9QoT70B3dAumqUB92ICKPc/ZX5q35yBgnFCv8aEEtkQ=; b=EXh0K5IM9aug8k/unbD6b9ZYI6RHVr6HT/4zRT4HkvcoFTw/lBaJZSTV79Zk3sV+Uj le0BYcJcBvFOYfDLVJh/1uxm1OCBHBtmOqPcOZDub+ZuOrgzwDRf6sFR6AwLMpOzoBXg 7xdyMTJLEkNPv7K+knFxgCsejc0hcuK2O80ncnMMzEJeQAsmQfK/MJrcgQnCd12KseP3 Lrm0KHtbsliY1kCehSPYT68wKHA7FfjLlUMnCIpj+uMWQ1sXGDEeHDGMFUmF3X91HTIl +CpuXbh8YatoNBmXOyiQCqYwedx3vOs5Kf3e6jE4EkmcDgiqX3MIg2pJHLD7JkMfVzqp TI+Q== 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:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=9QoT70B3dAumqUB92ICKPc/ZX5q35yBgnFCv8aEEtkQ=; b=VHAZwk1PYoalFQUOv6QtKRCMJrztXBLbs/xf3gFleEbwQBz9Qq6RGr5NDxk9GAlg/y De8FJoZhmUCKuZlgnuq6GpfvvU4rDIJGXn0LauRiv4/g8h3dQJDaKp5vPtAsvAFhRE44 mDwpGkCF1ZaVS5cCirmnOISEUeFCA0WpJ12Bi0erwSsPr7KipVoMf0oAf44A7qWAFhYj tUavrYiJlZwFgdNu/dHhbzS95bW2wC+Hmt8Hc7phVDIbz2ggH/dZwAjUIzSoqP/HhJpb 0JCny/JRkEA3wSmd+ZZIBzcK84cd0obsgjdr2Xl9kzKVGtTOxo5zQ97CwTuhYrP6xzNS jwKw== X-Gm-Message-State: APjAAAUiFH4dhWhYFK5/bk3zYNeJQwSdLyZnPKL3YHZC6bJUMIIh0Ls/ 4XbsEp8XmZZKSOYILadAmgNDl+bO538= X-Google-Smtp-Source: APXvYqyquLmufw4xqp8ySPThi4H0dsKsnUWcRKCIGiql2FSAhdwZu8vfKZwp5rmrWtSTP5vRgeVKNQ== X-Received: by 2002:ae9:d8c2:: with SMTP id u185mr6005348qkf.156.1568838381717; Wed, 18 Sep 2019 13:26:21 -0700 (PDT) Received: from ufjf-desktop (ip200131562.nat10.ufjf.br. [200.131.56.2]) by smtp.gmail.com with ESMTPSA id j2sm2680282qth.37.2019.09.18.13.26.19 for <36307@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Sep 2019 13:26:20 -0700 (PDT) References: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> <874l4cdz9e.fsf@gmail.com> User-agent: mu4e 1.2.0; emacs 26.3 From: Gustavo Barros To: 36307@debbugs.gnu.org Subject: Re: 26.2; Interaction between electric-pair and electric-quote In-reply-to: <874l4cdz9e.fsf@gmail.com> Date: Wed, 18 Sep 2019 17:26:17 -0300 Message-ID: <87impptkpi.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 36307 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: -0.8 (/) Hi all, On Wed, Jun 26 2019, Gustavo Barros wrote: > In this respect, I've reached a temporary workaround to inhibit the=20 > pairing in > a left word boundary (no bliss yet for del-sel though): > > #+begin_src emacs-lisp > (defun my/electric-quote-inhibit-pair (orig-fun &rest args) > (apply orig-fun args) > (when (eq (char-syntax (following-char)) ?w); only before words. > (pcase electric-quote-chars > (`(,q< ,q> ,q<< ,q>>) > (save-excursion > (cond ((search-backward (string q>) (1- (point)) t) > (replace-match "")) > ((search-backward (string q>>) (1- (point)) t) > (replace-match "")))))))) > (advice-add 'electric-quote-post-self-insert-function > :around #'my/electric-quote-inhibit-pair) > #+end_src > In case this might be useful to anyone, I=E2=80=99ve improved this somewhat= to=20 handle better the case where point is mid-word: #+begin_src emacs-lisp (defun my/electric-quote-inhibit-pair (orig-fun &rest args) (if (and (not (eq (char-syntax (preceding-char)) ?w)); no word char before=20 point (eq (char-syntax (following-char)) ?w)); word char after point ;; If at the beginning of a word (progn (apply orig-fun args) (pcase electric-quote-chars (`(,q< ,q> ,q<< ,q>>) (save-excursion (cond ((search-backward (string q>) (1- (point)) t) (replace-match "")) ((search-backward (string q>>) (1- (point)) t) (replace-match ""))))))) ;; Else do as usual (apply orig-fun args))) (advice-add 'electric-quote-post-self-insert-function :around #'my/electric-quote-inhibit-pair) #+end_src Best regards, Gustavo. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 19 11:53:44 2021 Received: (at 36307) by debbugs.gnu.org; 19 Apr 2021 15:53:44 +0000 Received: from localhost ([127.0.0.1]:51800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYWDY-0001q6-F3 for submit@debbugs.gnu.org; Mon, 19 Apr 2021 11:53:44 -0400 Received: from mail-oo1-f50.google.com ([209.85.161.50]:34597) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYWDT-0001po-3z for 36307@debbugs.gnu.org; Mon, 19 Apr 2021 11:53:43 -0400 Received: by mail-oo1-f50.google.com with SMTP id m25-20020a4abc990000b02901ed4500e31dso859492oop.1 for <36307@debbugs.gnu.org>; Mon, 19 Apr 2021 08:53:39 -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=U6YyC4199FqdeR18Bsy/OfpP4mAXFkL5R4niaKOw24A=; b=Tu+kp9sv+O+E2n5MOPNLhaLyrOzuyQXlY5a8B/Ah6erNJnvdo8tSCn+JeGkLToJHY1 JyBGNLQ3aq7I247ned8BG2QjkRNznHatnZLBE0RpBMtENJey2XpJscf5nmnH6IgI4EtA grimIKISZIaZ5vbPpUAROc+IpAfrDQVf+sDJaC8ZJUlTUJ2iWJXjKCiUW5X6J25V5BVN Qn89hozoShFT6TGOWbZoTLRVhfF34E1oavK3JQeOtSB4Mhijnn5iuAAe3zab7qpgCXbi ByLerZrVsmwR+qa+hZujcCmjDBXH7HL7S4IlUts0YLcSl2QD12lSqAZr6m3XgWHmWVMq 7xOQ== 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=U6YyC4199FqdeR18Bsy/OfpP4mAXFkL5R4niaKOw24A=; b=gdsZFzuhFF4X9afAnSnyCrj/W0b7fv17DkAt1cLz3q9CC6qHitbjF8UJygMZS70U3Z k1lM5Z7rJCdqGH5vA413RJnVdUunvRj3/Jag5SCpgEv7X0K68nT7Bu0hzCco84A0NPk9 3CWm4iW1eSG+8+N1KW/pCoDOO3a9B2W7fDk2pVGGLz0qw3ovS+0fneNeKn9Jgz4/D28s GBLIaR2wu/Yuds3o2icE5uYw262dfUxPCvgDleu3Ru2c4hV+5tWohSLpdnPzsUXG9xy0 7LV6CRp7irrhefXQWzRWxGS1HfVGEU/x0tlEy2aNs66v4MU0CWvtvhCOXai6f8z/fP// QKrw== X-Gm-Message-State: AOAM533p5CgWWhG2UE/XVM3Z8axM+ONkDv/83SVcPJza0r8dz65YMhIb dUvwTe1/jzTRbfBbCGt6/LU= X-Google-Smtp-Source: ABdhPJwMWi6sSvcPlggAS4q3x39u4zc7LX+6CVJj2k5K9touaZU4VjrJ5L+2WwaSOTNsfi99O+ZMTA== X-Received: by 2002:a4a:b50b:: with SMTP id r11mr14093053ooo.64.1618847613344; Mon, 19 Apr 2021 08:53:33 -0700 (PDT) Received: from gusbrs-laptop ([156.146.42.229]) by smtp.gmail.com with ESMTPSA id r9sm1322663otn.64.2021.04.19.08.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 08:53:32 -0700 (PDT) References: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> <874l4cdz9e.fsf@gmail.com> <87impptkpi.fsf@gmail.com> User-agent: mu4e 1.4.15; emacs 27.2 From: Gustavo Barros To: 36307@debbugs.gnu.org Subject: Re: 26.2; Interaction between electric-pair and electric-quote In-reply-to: <87impptkpi.fsf@gmail.com> Message-ID: <87sg3mfeyv.fsf@gmail.com> Date: Mon, 19 Apr 2021 12:53:28 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 36307 Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= 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: -0.7 (/) Hi All, This is an old report which, admittedly, was originally somewhat=20 confusing (not my best job at that). But I came back to this issue=20 recently and I think I got a better grasp of what's going on, and can=20 thus provide a clear diagnostic of where the problem lies. There's an interaction between `electric-quote-mode' and=20 `electric-pair-mode' such that `electric-pair-inhibit-predicate' is=20 ignored for electric quotes. What I failed to get when I originally=20 reported is that, given the depths set at each of these modes' hooks,=20 `electric-indent-post-self-insert-function' runs before=20 `electric-pair-post-self-insert-function'. This is why all of my=20 attempts to tamper with the former (some of which I shared in this=20 thread) had one or another shortcoming. This is also the reason why=20 `electric-pair-inhibit-predicate' is ignored by the later, since when=20 `electric-pair-post-self-insert-function' runs, the electric quote=20 substitution has already taken place. However, the call to=20 `electric-pair-inhibit-predicate' is behind a check on the syntax class=20 of character being paired (or not) (the check is `(memq syntax '(?\( ?\"=20 ?\$))'). The curved quotes, depending on the syntax table of the=20 major-mode, but usually, will fail this test, thus the pair will be=20 inserted regardless of `electric-pair-inhibit-predicate'. As far as I=20 get, the same is true for `electric-pair-skip-whitespace-function', but=20 I cannot generate a case where this is problematic (perhaps this is=20 handled on `electric-quote-mode's side, I'm not sure). A simple test to check that this is the case is the following. Starting=20 from `emacs -Q' (I'm running 27.2): #+begin_src emacs-lisp (defun my-electric-pair-inhibit-all () t) (setq electric-pair-inhibit-predicate 'my-electric-pair-inhibit-all) (setq electric-quote-context-sensitive t) (setq electric-quote-replace-double t) (electric-pair-mode 1) #+end_src Now, this has thus far enabled `electric-pair-mode' but in a way that=20 all and any pairing is (or should be) inhibited by=20 `my-electric-pair-inhibit-all'. Play with common pairs, particularly=20 with the quotes, and see that this is actually the case: pairing does=20 not take place. Well, this is not true always, it is true for=20 `lisp-interaction-mode', and for `org-mode'. It is not true for=20 `text-mode', and I presume that for the same reason that the pairing of=20 curved quotes fail to get inhibited elsewhere: the syntax class of the=20 character in question. Now enable `electric-quote-mode', and play again with common pairs,=20 particularly with quotes. I've tested on `lisp-interaction-mode',=20 `org-mode' and `text-mode'. Of course, in the case of the first, and=20 all those derived from `prog-mode', electric quoting is only done (by=20 default) in comments and strings, but whenever the (opening) curved=20 quote kicks in, their (closing) pair comes along. Which demonstrates=20 that `electric-pair-inhibit-predicate' is being ignored. I don't know what is the best fix for this, but I hope this clearer=20 diagnostic of the problem is of some use. Since this is a long standing=20 issue/report, and since I think this report circumscribes the issue much=20 better than the original, I took the liberty of CC'ing Jo=C3=A3o, as the=20 maintainer of `elec-pair.el', I hope that is not inappropriate. Best regards, Gustavo. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 19 15:13:16 2021 Received: (at 36307) by debbugs.gnu.org; 19 Apr 2021 19:13:16 +0000 Received: from localhost ([127.0.0.1]:52106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYZKe-0000mC-3k for submit@debbugs.gnu.org; Mon, 19 Apr 2021 15:13:16 -0400 Received: from mail-io1-f41.google.com ([209.85.166.41]:34685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYZKc-0000m0-Gu for 36307@debbugs.gnu.org; Mon, 19 Apr 2021 15:13:14 -0400 Received: by mail-io1-f41.google.com with SMTP id x16so36042904iob.1 for <36307@debbugs.gnu.org>; Mon, 19 Apr 2021 12:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0BvaSyntkMtk+7J9WXPmZCwVUwxYq4LQcHMmk/tzLmA=; b=eLnMlt9/dKJ/HqyP9xPuk7OsMqO6CZNI19vBGY5Hddwu1GVzglCi8ZXJMWE74MWCbu S+dBPYdIvyPfYZut7y402rpsRolhzpK/RNMBWgBjc4Uf+x7t2wQuWdRArMu8l0xsMHDL 7yVavUgH/Nr80AEWRmpi+9mkNalatWY1wB0WI553Z/2Ygl79RsSu7md05TICTC0NoxwX STNTzFSGarBZcMxUJo/7M8OMJjVb2WXfioLSxRC/VBvtl6dK9yuZCJ/7JUXwoCiftcfX pmpCGjhLLnJxQOfhgMSUgMiw5BzFXOa2Nx1oI54iQNuvNREGOXVf+kOL646TQ4CU0cW7 DrTw== 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=0BvaSyntkMtk+7J9WXPmZCwVUwxYq4LQcHMmk/tzLmA=; b=IWIk4PyJtMbRLSWnugQESM26hZj209kaCKBXFcS2fwKTCKfAkx9UGVtd5alDP68HAK wbSCDk7rrLxp7xIz+sqMcdA7KhNjckaLUwkfH0caQX5ZSNQYp/ls9n8Ty7/TXc3nGvxk qsBTVIUvy7sWxA2TMsAlIfbdv3FEb0qsw3I+6dwNaFMaXMaJTxZm96MRkihr5Hzbp8Mt YDJpSSiJ7CrIgSg6ljkJv8/mIAyYgFhW1sZBoPgkfEjrLpg7UxV3lf0q4zfJ6xfl4sZk rPHzoH0sYDBLpqFx1g/pfDtky1GW4hO80aw9+Wyypf3pvNxJ5yHo7HquBSwnCevApxlP pw/A== X-Gm-Message-State: AOAM532SbdtA1VBEm2oKoQ6EgwoTJjO1z1R03iMNpbAXF2jespcamuMh plO4M7KFlHZ5zq5G2dDuz0Sv2OUznfRI8VWXq9E= X-Google-Smtp-Source: ABdhPJzk3WDZ5xoT66kr9IHGkkFwzXPwiPRkp0k6gxN8nQ2QuIhAyuadQIomAUl3JDnCYwm2iy7EIWWWRrqjSyJC50U= X-Received: by 2002:a02:cab3:: with SMTP id e19mr17705879jap.71.1618859588994; Mon, 19 Apr 2021 12:13:08 -0700 (PDT) MIME-Version: 1.0 References: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> <874l4cdz9e.fsf@gmail.com> <87impptkpi.fsf@gmail.com> <87sg3mfeyv.fsf@gmail.com> In-Reply-To: <87sg3mfeyv.fsf@gmail.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Mon, 19 Apr 2021 20:12:58 +0100 Message-ID: Subject: Re: 26.2; Interaction between electric-pair and electric-quote To: Gustavo Barros Content-Type: multipart/alternative; boundary="000000000000be4d2205c0581e35" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36307 Cc: 36307@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 (-) --000000000000be4d2205c0581e35 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > better than the original, I took the liberty of CC'ing Jo=C3=A3o, as the > maintainer of `elec-pair.el', I hope that is not inappropriate. It's certainly not. It's a very good idea even, at least in my case. But it's going to take me a while to process this, so make sure to ping me in the future if I don't manage to. Jo=C3=A3o --000000000000be4d2205c0581e35 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> better than the original, I took the= liberty of CC'ing Jo=C3=A3o, as the
> maintainer of `elec-= pair.el', I hope that is not inappropriate.

It= 's certainly not.=C2=A0 It's a very good idea even, at least in my = case.

But it's going to take me a while to pro= cess this, so make sure to ping
me in the future if I don= 9;t manage to.

Jo=C3=A3o
--000000000000be4d2205c0581e35-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 19 15:16:47 2021 Received: (at 36307) by debbugs.gnu.org; 19 Apr 2021 19:16:47 +0000 Received: from localhost ([127.0.0.1]:52112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYZNy-0000rq-Hm for submit@debbugs.gnu.org; Mon, 19 Apr 2021 15:16:47 -0400 Received: from mail-il1-f169.google.com ([209.85.166.169]:35811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYZNs-0000rU-31 for 36307@debbugs.gnu.org; Mon, 19 Apr 2021 15:16:40 -0400 Received: by mail-il1-f169.google.com with SMTP id r5so21885149ilb.2 for <36307@debbugs.gnu.org>; Mon, 19 Apr 2021 12:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SMx87OaB5fNyiyitOKIxzFLLuPWj6yEyqzrmzASDPks=; b=SL7xNINXMHQNR5jBIOQm91vECve1AC2TCwD5smpE7X8oNfunct6yTGOI3mqkg8u3X7 qpOzisJ54WMdHBty17Z2rfmiEqd5wmR35bCJXD0CjgH5Q/ud9O8AreXDGssaXB1GHaeF qdyJS4xRp4yMePqHB9SvwPctyX8esFxIkXyHma4MS/bM2K2Jl3f3uqjc8F5itAEco4KJ xjZnQkHaNeXfH6Rg2t5EHqyFsVjAtasTnwUQvCADIecnQvbNf13MNULB234SIfAri+tN ld3/pis8ceaCPrk8wzwDrEwxLXg/GhfhcBY/NsV1oM5AgtJKaIpTKpf5BkeOEMbHNesa uk1g== 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=SMx87OaB5fNyiyitOKIxzFLLuPWj6yEyqzrmzASDPks=; b=lJB/O5sYPsHL7jCxlGw5SyHba0nvuRmUJQyjIipOzaxp+EAf2JGlWGX8smYCYlcs4g b0JQsXq68CMD5sh8FyWdXjjOeYR1vCGgS9HuS83bTjL6p2knV998YN51CSgNG1aZl//L GhNdEFmDQDjIJ2fRzWWeLAF110pR5WztJcyKhLvRdw2C+Jy8nhPBpwy/Flrzy2mHcGAY 5c2l7y3XeLiYqf70jbJfXyhfa5EnO1WQjpg6OojxwIpmumqqfpPFBTsJ3xVfjgBXUGRf 1sV+TuEI32gp7PgD4yMJd1k/mgB30K0A2G9D4ei3O5hvu38bk4qmJOmTKI7CkYsiDJbZ GumA== X-Gm-Message-State: AOAM532UVbhOFZn3RyG2msMbCJy4AJUzQGOx5jeGbG/gCugLK27PiPVo lUyuRRGAtUugHwL2m+UBVq0/JGN2CT6KNZK6p4w= X-Google-Smtp-Source: ABdhPJwDzCwLry+nigUACxu7Lr4IrqYQRzAHxY3SM/aSnei8Os1Wbw4TPp4W0T2oUq+PgAkPLJc37uDeDHvwrpXNUNI= X-Received: by 2002:a05:6e02:16cf:: with SMTP id 15mr17491393ilx.199.1618859790650; Mon, 19 Apr 2021 12:16:30 -0700 (PDT) MIME-Version: 1.0 References: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> <874l4cdz9e.fsf@gmail.com> <87impptkpi.fsf@gmail.com> <87sg3mfeyv.fsf@gmail.com> In-Reply-To: From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Mon, 19 Apr 2021 20:16:19 +0100 Message-ID: Subject: Re: 26.2; Interaction between electric-pair and electric-quote To: Gustavo Barros Content-Type: multipart/alternative; boundary="000000000000c3509f05c0582a2c" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36307 Cc: 36307@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 (-) --000000000000c3509f05c0582a2c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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). Jo=C3=A3o --000000000000c3509f05c0582a2c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
After reading your issue in diagonal, it = seems it's to do with
electric-quote-mode and electric-pair-m= ode.=C2=A0 I wrote the latter
mostly, but I didn't write = the former, which I think is only for
UTF-8 quotes.=C2=A0 I perso= nally turn it off.=C2=A0 I don't think it respects
the auto-b= alancing ideas I put into electric-pair-mode.

(if = that's even what you're asking about, I still haven't read and<= /div>
processed all your text).

Jo=C3=A3o
--000000000000c3509f05c0582a2c-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 19 15:55:57 2021 Received: (at 36307) by debbugs.gnu.org; 19 Apr 2021 19:55:57 +0000 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 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 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) 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) References: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> <874l4cdz9e.fsf@gmail.com> <87impptkpi.fsf@gmail.com> <87sg3mfeyv.fsf@gmail.com> User-agent: mu4e 1.4.15; emacs 27.2 From: Gustavo Barros To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: 26.2; Interaction between electric-pair and electric-quote In-reply-to: Message-ID: <87pmyqf3r5.fsf@gmail.com> Date: Mon, 19 Apr 2021 16:55:42 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 36307 Cc: 36307@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: -0.7 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 19 05:43:40 2021 Received: (at 36307) by debbugs.gnu.org; 19 Oct 2021 09:43:40 +0000 Received: from localhost ([127.0.0.1]:49419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mclem-0006VP-Jw for submit@debbugs.gnu.org; Tue, 19 Oct 2021 05:43:40 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]:40816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mclek-0006VB-Dm for 36307@debbugs.gnu.org; Tue, 19 Oct 2021 05:43:39 -0400 Received: by mail-qt1-f176.google.com with SMTP id o12so17668174qtq.7 for <36307@debbugs.gnu.org>; Tue, 19 Oct 2021 02:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=/gaTgthKvpoX5T3qDLaySfxCHGuPPwyywLPoDWA1KCs=; b=pQvjGPzZ1M0VBBwbqPbs/llIGUv4E4O6W5BGGH+ZIxmDawvc7/G7ascb3vjejE6i5k JFk/HdRNDLcXkkgXNxjWRMqsw5txxuBWBRwYbMY8MlPuaqAL8vxXzSmyeaO/++Pn+RB8 EEiJrI41FuSH4RJTaF8FoOjkU8SEf2Z2RWbFaBIKtZ7ZrtQsouX4hoVcFE+GDFuXGz1D yFX673RcW/5JKyEm5qncIIRyKlsLOGuSAPOwEAUgGOeV5qnIK7smUVkP4h+dpT25VTSE Qx8T4glEXIHs0yzEXePcvW1c67IpiOjudoW2YwXI48CHaGMUf/6HoG7KLSZFy8BHplnA bdNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=/gaTgthKvpoX5T3qDLaySfxCHGuPPwyywLPoDWA1KCs=; b=XuhTEbJBODdbThljD1hRSCZp4dwU8rBEb/BKhjoZv60vm8vLzlBN75m0HdQ1o7qnBc R3YMMhi/4Lz+5LRtPhC8F+mto2mWprmgehQalAPaaljuSuELn1FO+fRcbrPCJ/U701Xp 1zDFn30hniV03ZHzZXpFm1v6sk+FxSRoki8VNIUqwnYZLgRk800b72d8D6XPE6v/AqfM VYgp0nsEgfPyRgOyAhuoKbKyjQ8AzdGTpEBdr8TetkdX1uChH7YOlj+698353/H2adcw ec8IPHZbkQPRvVooLLNprKU2CvN1wutvgDLHiEjCX7lspSsS0wmcQCeVDCUjUvyU/xJY S6Iw== X-Gm-Message-State: AOAM5334SvxyqTIg+ERBAHwbPG1nMw6PgUk61uwNASAjxufUeWBn+lJw SR8qPdfP9/ISJrxIrVWjmnaQTx/9r5SL5A== X-Google-Smtp-Source: ABdhPJyh+xmy5nHYTGR/F2ZVrMgfpWq27fM7mTM5nbQOus8ARvpW1T/TxtlyPIYD1tVzd/rzuIZPEA== X-Received: by 2002:a05:622a:285:: with SMTP id z5mr34103079qtw.315.1634636611779; Tue, 19 Oct 2021 02:43:31 -0700 (PDT) Received: from gusbrs-laptop ([102.129.152.99]) by smtp.gmail.com with ESMTPSA id c7sm7645368qke.78.2021.10.19.02.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 02:43:30 -0700 (PDT) References: <2dbd590d-acce-8ab8-124a-5e5fe811c578@gmail.com> <874l4cdz9e.fsf@gmail.com> <87impptkpi.fsf@gmail.com> <87sg3mfeyv.fsf@gmail.com> User-agent: mu4e 1.6.7; emacs 27.2 From: Gustavo Barros To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: 26.2; Interaction between electric-pair and electric-quote Date: Tue, 19 Oct 2021 06:35:06 -0300 In-reply-to: Message-ID: <87mtn5bb9d.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 36307 Cc: 36307@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: -0.8 (/) Hi Jo=C3=A3o, On Mon, 19 Apr 2021 at 20:12, Jo=C3=A3o T=C3=A1vora = wrote: > > It's certainly not. It's a very good idea even, at least in my case. > > But it's going to take me a while to process this, so make sure to=20 > ping=20 > me in the future if I don't manage to. > > Jo=C3=A3o You had asked for a ping in this thread and I thought it's already=20 fairly behind us for a respectful bump on this thread. If you (or someone) could take a look at this, it'd still be much=20 appreciated. Best regards, Gustavo.