From unknown Tue Jun 17 20:20:26 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#29812 <29812@debbugs.gnu.org> To: bug#29812 <29812@debbugs.gnu.org> Subject: Status: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings Reply-To: bug#29812 <29812@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:20:26 +0000 retitle 29812 27.0.50; electric-quote-replace-double misbehaves in Lisp str= ings reassign 29812 emacs submitter 29812 Eli Zaretskii severity 29812 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 22 08:40:52 2017 Received: (at submit) by debbugs.gnu.org; 22 Dec 2017 13:40:52 +0000 Received: from localhost ([127.0.0.1]:47029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSNZD-0003nq-Ot for submit@debbugs.gnu.org; Fri, 22 Dec 2017 08:40:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSNZC-0003nd-FV for submit@debbugs.gnu.org; Fri, 22 Dec 2017 08:40:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSNZ6-0007DX-38 for submit@debbugs.gnu.org; Fri, 22 Dec 2017 08:40:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37261) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eSNZ5-0007DQ-Vu for submit@debbugs.gnu.org; Fri, 22 Dec 2017 08:40:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSNZ4-0003Kv-HU for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2017 08:40:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSNZ0-00079S-Ir for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2017 08:40:42 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSNZ0-00079E-FY for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2017 08:40:38 -0500 Received: from [176.228.60.248] (port=2069 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eSNYz-000403-U3 for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2017 08:40:38 -0500 Date: Fri, 22 Dec 2017 15:40:36 +0200 Message-Id: <837etenanf.fsf@gnu.org> From: Eli Zaretskii To: bug-gnu-emacs@gnu.org Subject: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) To reproduce: emacs -Q M-x electric-quote-mode RET M-x set-variable RET electric-quote-replace-double RET t RET Type: "foo \"foo\"" You get this in the buffer: "foo \”foo\”" I expected "foo \“foo\”" instead. In GNU Emacs 27.0.50 (build 56, i686-pc-mingw32) of 2017-12-22 built on HOME-C4E4A596F7 Repository revision: b003171d27dfa4f0a5e6f8d9eb632b1930748e95 Windowing system distributor 'Microsoft Corp.', version 5.1.2600 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Electric-Quote mode enabled You can run the command ‘electric-quote-mode’ with M-x e-q-m RET Electric-Quote mode enabled Scanning for dabbrevs...done user-error: No dynamic expansion for ‘Electric-quote-rep’ found Scanning for dabbrevs...done user-error: No dynamic expansion for ‘Electric-quote-replace-d’ found Configured using: 'configure --prefix=/d/usr --enable-checking=yes,glyphs --with-wide-int --with-modules --enable-check-lisp-object-type 'CFLAGS=-O0 -gdwarf-4 -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES JSON LCMS2 Important settings: value of $LANG: ENU locale-coding-system: cp1255 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t 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 dabbrev emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml 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 cus-edit wid-edit thingatpt help-fns radix-tree help-mode easymenu cl-loaddefs cl-lib cus-start cus-load elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win 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 w32notify w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 122305 12056) (symbols 56 22916 1) (miscs 48 43 120) (strings 16 35784 2142) (string-bytes 1 868306) (vectors 16 15963) (vector-slots 8 742591 12998) (floats 8 66 193) (intervals 40 317 128) (buffers 880 12)) From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 30 17:07:34 2017 Received: (at 29812) by debbugs.gnu.org; 30 Dec 2017 22:07:34 +0000 Received: from localhost ([127.0.0.1]:58199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVPHy-0001FM-2z for submit@debbugs.gnu.org; Sat, 30 Dec 2017 17:07:34 -0500 Received: from mail-qt0-f175.google.com ([209.85.216.175]:46287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVPHw-0001F9-Fl for 29812@debbugs.gnu.org; Sat, 30 Dec 2017 17:07:32 -0500 Received: by mail-qt0-f175.google.com with SMTP id r39so57499634qtr.13 for <29812@debbugs.gnu.org>; Sat, 30 Dec 2017 14:07:32 -0800 (PST) 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=VKmj/cIVV1WbuUSdspRkghwe2tm3Kcoin1kjJTPiWys=; b=fjvLkjvlnfDMgvG97bXFrVCqUVOuKjOkR0wZprDl3Q7YOLtEyt9b2IEMUCYhMv0tCC ro65x2li+s4zXcMBL87igMlZy9MIGiGSifeywKn93hYrx/oVbnr4yV87f5wnzkWN4PLT nu2bnVCgX7yHcsQr5PavNdOYnH0NLa8iduBzfijfBD++8L6r+SK3ymiDFPY2RWbNhzHN 8TvlFZspvedi9G36BynKt60PCAHCEPqeqVwiYRmsSp7q0wLg1g/OVQEB59BrFajHl/1I LfuE+WrzAB9IfXYAe9jI08AVDKMmglaAdq9aZoKSy+ETNQZzGub0BgA/aUKsFAM2482L jWaA== 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=VKmj/cIVV1WbuUSdspRkghwe2tm3Kcoin1kjJTPiWys=; b=CNtABzKr9smibrz3JQb7vcDn7Q7+csvpyP2a8h3idMTiplqqtn/zPKm7cnfzwSofVR xNc95NkKptWabWC6T7lDQhJnffNXSXnZjZBdMGYbea6k65T1Lkwc8qOabBPkj2Fr1n94 XZWKOExLJSO1XfihIVw0c4TB8lOXHBEUQpxrv6I+ZfKdk5FHQg7zhm2vLIzjJ8wuFZx6 FuSNL3p5VRPvxVafWyeSHh/F3Frnu0O+Ah/QnOw9iv0gw9MPQWnWXEWHU2iKmuoScIJ2 mab+F5NbdPWH13hieqvCPdvLWotv2K/RjGt5ulocu7vxT4b+31Ruzla4Rn5JgeqbNsvG Xtlg== X-Gm-Message-State: AKGB3mJeb035KN5rmc01w7jjIUfBy5eOcBfppMw/wPeg06XAy2WwskDF ny8ZklGmnXheana44d47gnn4ojyX2OjnF49OIyk= X-Google-Smtp-Source: ACJfBouhRbIm/vJ80I0aktl73z2m1rN5/8SXudc6zXfAaZr0Awo6dlyKDv4Ss/G7Qg7nYcsYvj23b0p+cfcmBF/q+2Y= X-Received: by 10.200.35.28 with SMTP id a28mr55682994qta.51.1514671646961; Sat, 30 Dec 2017 14:07:26 -0800 (PST) MIME-Version: 1.0 References: <837etenanf.fsf@gnu.org> In-Reply-To: <837etenanf.fsf@gnu.org> From: Philipp Stephani Date: Sat, 30 Dec 2017 22:07:16 +0000 Message-ID: Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings To: Eli Zaretskii Content-Type: multipart/alternative; boundary="001a113a870a77f652056195f9ab" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 29812 Cc: 29812@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.2 (/) --001a113a870a77f652056195f9ab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Eli Zaretskii schrieb am Fr., 22. Dez. 2017 um 14:41 Uhr: > To reproduce: > > emacs -Q > M-x electric-quote-mode RET > M-x set-variable RET electric-quote-replace-double RET t RET > > Type: > > "foo \"foo\"" > > You get this in the buffer: > > "foo \=E2=80=9Dfoo\=E2=80=9D" > > I expected "foo \=E2=80=9Cfoo\=E2=80=9D" instead. > > I think it's not completely clear what to expect here. After all, electric quote is for human-language text, which normally doesn't contain backslashes. At least in the context of Emacs Lisp strings, I'd expect "foo \"foo\"" here, i.e., ASCII quotes. The non-ASCII quotes don't need to be escaped, so presumably escaping means that the user intended to type an ASCII quote. --001a113a870a77f652056195f9ab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Fr., 22. Dez. 2017 um 14:41=C2=A0Uhr:
To reproduce:

=C2=A0 emacs -Q
=C2=A0 M-x electric-quote-mode RET
=C2=A0 M-x set-variable RET electric-quote-replace-double RET t RET

Type:

=C2=A0 "foo \"foo\""

You get this in the buffer:

=C2=A0 "foo \=E2=80=9Dfoo\=E2=80=9D"

I expected "foo \=E2=80=9Cfoo\=E2=80=9D" instead.


I think it's not completely clear what= to expect here. After all, electric quote is for human-language text, whic= h normally doesn't contain backslashes.
At least in the conte= xt of Emacs Lisp strings, I'd expect "foo \"foo\"" = here, i.e., ASCII quotes. The non-ASCII quotes don't need to be escaped= , so presumably escaping means that the user intended to type an ASCII quot= e.
--001a113a870a77f652056195f9ab-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 10:51:22 2017 Received: (at 29812) by debbugs.gnu.org; 31 Dec 2017 15:51:22 +0000 Received: from localhost ([127.0.0.1]:58887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVftS-0000ii-Ju for submit@debbugs.gnu.org; Sun, 31 Dec 2017 10:51:22 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVftQ-0000iV-Vb for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 10:51:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVftI-0000nb-Ly for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 10:51:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVftI-0000nQ-Id; Sun, 31 Dec 2017 10:51:12 -0500 Received: from [176.228.60.248] (port=2513 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eVftI-0005T2-3g; Sun, 31 Dec 2017 10:51:12 -0500 Date: Sun, 31 Dec 2017 17:51:02 +0200 Message-Id: <83efnaew0p.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sat, 30 Dec 2017 22:07:16 +0000) Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings References: <837etenanf.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29812 Cc: 29812@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sat, 30 Dec 2017 22:07:16 +0000 > Cc: 29812@debbugs.gnu.org > > emacs -Q > M-x electric-quote-mode RET > M-x set-variable RET electric-quote-replace-double RET t RET > > Type: > > "foo \"foo\"" > > You get this in the buffer: > > "foo \”foo\”" > > I expected "foo \“foo\”" instead. > > I think it's not completely clear what to expect here. After all, electric quote is for human-language text, which > normally doesn't contain backslashes. AFAIK, electric-quote-replace-double is supposed to work in comments and strings in buffers under programming language modes, not only in text modes. And it works correctly for me in C modes and also in Lisp comments, so why not in Lisp strings? > At least in the context of Emacs Lisp strings, I'd expect "foo \"foo\"" here, i.e., ASCII quotes. The non-ASCII > quotes don't need to be escaped, so presumably escaping means that the user intended to type an ASCII > quote. Typing just a quote in a Lisp string terminates the string, so I wouldn't expect that to produce curved quotes. And a backslash just quotes the next character, so there's nothing wrong with having it before curved quotes. Anyway, if this feature is not supposed to work reliably in programming language strings, perhaps we shouldn't try? Having it sometimes work and sometimes not is IMO confusing. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 11:16:21 2017 Received: (at 29812) by debbugs.gnu.org; 31 Dec 2017 16:16:21 +0000 Received: from localhost ([127.0.0.1]:58899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgHd-0001IP-2k for submit@debbugs.gnu.org; Sun, 31 Dec 2017 11:16:21 -0500 Received: from mail-qk0-f174.google.com ([209.85.220.174]:33783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgHb-0001IC-9o for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 11:16:19 -0500 Received: by mail-qk0-f174.google.com with SMTP id x7so40112094qkb.0 for <29812@debbugs.gnu.org>; Sun, 31 Dec 2017 08:16:19 -0800 (PST) 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=CBaV1eLEXi2Y5NHalAwZPoPxEPYLi3yedCYCGxduiWc=; b=EVxokGQRpKwtqIZxfg/Dz9VfN9IHI7hvpiMma7ThHPpR+u6qcIe72m1fuDOQoDMI65 kSkF53rJvnkfxFGtBoxPHjy2gNzUPKXw8VdJ9gNnaW/Rl35KZQi+v0MK7IqiC1CkwZH6 OoPcylo99+hLh9bulzCzLXiDsH1btIDaa7dVbAHPJdkTZNuCM3yrmpQ6I3ZxtRsIDbOX CNF7zuFTApDcMNiswq3RYZvxMQU9ANg0BXX+tztmz+9zpjaov0gTLn5a9f7CzTlgPPKT 4hixBQIP1kKFTwnALlBdZwEufgSvYFhTO9Rao3+QrG5bSbiEVgFPTVrPfkF8CPkWCt/0 R/dw== 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=CBaV1eLEXi2Y5NHalAwZPoPxEPYLi3yedCYCGxduiWc=; b=rjh/QDg3iNtlhiDi6TR7WOQBp+Yz59fxHCuXzxMShSbb0l9DXLaPboDTGXXqHwPyBs t7Dx1b2CCG0HxrG/fWe8JBZipn3OCf8bfv95luV3QnvD/LFt6Uj8wEEnmQtmpkkxnxLm fQpGJ2lMIyOUSBqF4iCZdq5WGVOh7MjSmuYbTrMqYT1QxlLdY/Tm1d0ea9BNpoy951eU gsQW9E04diVlQDtbLoayNg7RmRXWI+yPr0Vc7/Hr8Yhnf3DpFuh8MubRXJyIJ3ca0siT zO6ZJoAQi7wXDUyXkRuwSUyPQ7271M019qyK4nqnDLyJro8quxLvNkhZquVT7NgfEHO4 BMFw== X-Gm-Message-State: AKGB3mK8/Dpl21DLeFP+wwoVf4n9b5YRN5LYapemlpY+yiFix+HLJmtX RmMcTCR3qIAFQ/IDD2T5/6ZEtycP1GjcLsRZwoU= X-Google-Smtp-Source: ACJfBossKztV0fwtKfUyV4EgnFm1I0hYIh9S6RM743RdHl0jJd3zg2s4SCik+tNSeKV6e85rE8Zba7L2McEGE3IywIg= X-Received: by 10.55.10.7 with SMTP id 7mr52365722qkk.198.1514736973699; Sun, 31 Dec 2017 08:16:13 -0800 (PST) MIME-Version: 1.0 References: <837etenanf.fsf@gnu.org> <83efnaew0p.fsf@gnu.org> In-Reply-To: <83efnaew0p.fsf@gnu.org> From: Philipp Stephani Date: Sun, 31 Dec 2017 16:16:02 +0000 Message-ID: Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings To: Eli Zaretskii Content-Type: multipart/alternative; boundary="001a114c563e3edfdd0561a52f80" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 29812 Cc: 29812@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.2 (/) --001a114c563e3edfdd0561a52f80 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Eli Zaretskii schrieb am So., 31. Dez. 2017 um 16:51 Uhr: > > From: Philipp Stephani > > Date: Sat, 30 Dec 2017 22:07:16 +0000 > > Cc: 29812@debbugs.gnu.org > > > > emacs -Q > > M-x electric-quote-mode RET > > M-x set-variable RET electric-quote-replace-double RET t RET > > > > Type: > > > > "foo \"foo\"" > > > > You get this in the buffer: > > > > "foo \=E2=80=9Dfoo\=E2=80=9D" > > > > I expected "foo \=E2=80=9Cfoo\=E2=80=9D" instead. > > > > I think it's not completely clear what to expect here. After all, > electric quote is for human-language text, which > > normally doesn't contain backslashes. > > AFAIK, electric-quote-replace-double is supposed to work in comments > and strings in buffers under programming language modes, not only in > text modes. And it works correctly for me in C modes and also in Lisp > comments, so why not in Lisp strings? > Does it work as expected for you in C strings? I see the same behavior in C strings as in Lisp. > > > At least in the context of Emacs Lisp strings, I'd expect "foo \"foo\"" > here, i.e., ASCII quotes. The non-ASCII > > quotes don't need to be escaped, so presumably escaping means that the > user intended to type an ASCII > > quote. > > Typing just a quote in a Lisp string terminates the string, so I > wouldn't expect that to produce curved quotes. And a backslash just > quotes the next character, so there's nothing wrong with having it > before curved quotes. > True, but why would you quote a character that doesn't need quoting? Doing so could be taken as a hint that the character doesn't need quoting. > > Anyway, if this feature is not supposed to work reliably in > programming language strings, perhaps we shouldn't try? Having it > sometimes work and sometimes not is IMO confusing. > It should work in comments and strings, yes. However, given that the behavior is heuristic in all cases it's hard to define what the correct behavior should be. It seems that the behavior you expect should be relatively easy to implement, though. I'll try to send a patch. --001a114c563e3edfdd0561a52f80 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= So., 31. Dez. 2017 um 16:51=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sat, 30 Dec 2017 22:07:16 +0000
> Cc: 29812@d= ebbugs.gnu.org
>
>=C2=A0 =C2=A0 emacs -Q
>=C2=A0 =C2=A0 M-x electric-quote-mode RET
>=C2=A0 =C2=A0 M-x set-variable RET electric-quote-replace-double RET t = RET
>
>=C2=A0 Type:
>
>=C2=A0 =C2=A0 "foo \"foo\""
>
>=C2=A0 You get this in the buffer:
>
>=C2=A0 =C2=A0 "foo \=E2=80=9Dfoo\=E2=80=9D"
>
>=C2=A0 I expected "foo \=E2=80=9Cfoo\=E2=80=9D" instead.
>
> I think it's not completely clear what to expect here. After all, = electric quote is for human-language text, which
> normally doesn't contain backslashes.

AFAIK, electric-quote-replace-double is supposed to work in comments
and strings in buffers under programming language modes, not only in
text modes.=C2=A0 And it works correctly for me in C modes and also in Lisp=
comments, so why not in Lisp strings?

D= oes it work as expected for you in C strings? I see the same behavior in C = strings as in Lisp.
=C2=A0

> At least in the context of Emacs Lisp strings, I'd expect "fo= o \"foo\"" here, i.e., ASCII quotes. The non-ASCII
> quotes don't need to be escaped, so presumably escaping means that= the user intended to type an ASCII
> quote.

Typing just a quote in a Lisp string terminates the string, so I
wouldn't expect that to produce curved quotes.=C2=A0 And a backslash ju= st
quotes the next character, so there's nothing wrong with having it
before curved quotes.

True, but why wou= ld you quote a character that doesn't need quoting? Doing so could be t= aken as a hint that the character doesn't need quoting.
=C2= =A0

Anyway, if this feature is not supposed to work reliably in
programming language strings, perhaps we shouldn't try?=C2=A0 Having it=
sometimes work and sometimes not is IMO confusing.
It should work in comments and strings, yes. However, given tha= t the behavior is heuristic in all cases it's hard to define what the c= orrect behavior should be.
It seems that the behavior you expect = should be relatively easy to implement, though. I'll try to send a patc= h.=C2=A0
--001a114c563e3edfdd0561a52f80-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 11:38:23 2017 Received: (at 29812) by debbugs.gnu.org; 31 Dec 2017 16:38:23 +0000 Received: from localhost ([127.0.0.1]:58910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgcx-0001nx-Iu for submit@debbugs.gnu.org; Sun, 31 Dec 2017 11:38:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgcw-0001nl-Hp for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 11:38:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVgcm-0000dw-7R for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 11:38:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVgcm-0000dk-3J; Sun, 31 Dec 2017 11:38:12 -0500 Received: from [176.228.60.248] (port=2561 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eVgcl-0003t7-HB; Sun, 31 Dec 2017 11:38:11 -0500 Date: Sun, 31 Dec 2017 18:38:02 +0200 Message-Id: <83a7xyetud.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sun, 31 Dec 2017 16:16:02 +0000) Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings References: <837etenanf.fsf@gnu.org> <83efnaew0p.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29812 Cc: 29812@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sun, 31 Dec 2017 16:16:02 +0000 > Cc: 29812@debbugs.gnu.org > > AFAIK, electric-quote-replace-double is supposed to work in comments > and strings in buffers under programming language modes, not only in > text modes. And it works correctly for me in C modes and also in Lisp > comments, so why not in Lisp strings? > > Does it work as expected for you in C strings? I see the same behavior in C strings as in Lisp. In C, "\"foo\"" produces ASCII quotes. > Anyway, if this feature is not supposed to work reliably in > programming language strings, perhaps we shouldn't try? Having it > sometimes work and sometimes not is IMO confusing. > > It should work in comments and strings, yes. However, given that the behavior is heuristic in all cases it's hard > to define what the correct behavior should be. Well, can you give an example where it does work in strings? Maybe I'm missing something, because it looked to me as if it never works in that case. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 11:49:49 2017 Received: (at 29812) by debbugs.gnu.org; 31 Dec 2017 16:49:49 +0000 Received: from localhost ([127.0.0.1]:58920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgo0-00024t-SK for submit@debbugs.gnu.org; Sun, 31 Dec 2017 11:49:49 -0500 Received: from mail-qt0-f182.google.com ([209.85.216.182]:34364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgnz-00024h-K6 for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 11:49:47 -0500 Received: by mail-qt0-f182.google.com with SMTP id 33so58861318qtv.1 for <29812@debbugs.gnu.org>; Sun, 31 Dec 2017 08:49:47 -0800 (PST) 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=eVGYPZ/7UeZKO6Se6NpNPVJXbNs7G1hOpj/fbdQMrzU=; b=UT4fl1k7z6q51a6+yUpQ/SMCyo5Z83C6vyTAoEHlv8o4FzBX3wLxs1fD89dgORU7gE tbhNvKXfnn2ETQ7e6McKHmmgZvLx7HxGWy20fWRHhevsB122eNF8f1ZBDnF4eaRRMrAM 1W40kJWM3+iOdCX8tgihnzPBrSePPo/BSNQ+M+PsZYaebepDFHniR7+KWZVtV28kIshH Qu1Ak49vpkVRpywoBpP0Y1/aKEo+sI3sns/p+yTdDK0GOTZaYeVCqCdT/u05Y+ysHHHa VYQSkpAA8oq2acPz6Vgk5KDmFhWlOMhyOHmnov+3tyT/0oIEAARYAJLFMMZQfQgk2KkI XhqA== 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=eVGYPZ/7UeZKO6Se6NpNPVJXbNs7G1hOpj/fbdQMrzU=; b=FZ3FZqiqSrm0Bou2SoHlBB8SdFoSaEaomW4IkRvvCkw4TKPmVQkLXDC5xxq3AqB+lb y9t1GuhJ/Np+fe2z8RQllNm0+ISIbe+Z4lxf0i2xU6ZIJglD8opdzZ72BEIH+BzU8Yap FXoeGDFRC0TZLjlLH+RyeueGmQmdWXAAi6KO+AILE28CQj3KkM3yzWjb+aIxyrUI4aUl NFMeSDaUXFmK5t87tlrUrFWwnVTtJF44FM7SlQHo/qt8IF4vEWJ9qbyLo3MQnnA6JCeX oZtVcl04FPgty1E8M/YKzm7cqtiwCZUumjpimDmhzItbXOf/3f+QTgijVZS+e+LTOP1+ S78Q== X-Gm-Message-State: AKGB3mKJ1Bxg29exihSac1baO6ptpEwbH5Nk/jqVdgqNHKmQeNjgCfWz X93yrxoWgOX/8Qc3ngd5NwaBXlshkbml+CsSaQuphg== X-Google-Smtp-Source: ACJfBossoWJGlYjFBgcdf92L+w1fJDdESxrkMsTohmTExztJJBqn/zaivj9Iz44VTkB2aNGRGrlk45QdbqVG5m9iRVc= X-Received: by 10.200.23.20 with SMTP id w20mr54187293qtj.210.1514738981989; Sun, 31 Dec 2017 08:49:41 -0800 (PST) MIME-Version: 1.0 References: <837etenanf.fsf@gnu.org> <83efnaew0p.fsf@gnu.org> <83a7xyetud.fsf@gnu.org> In-Reply-To: <83a7xyetud.fsf@gnu.org> From: Philipp Stephani Date: Sun, 31 Dec 2017 16:49:31 +0000 Message-ID: Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings To: Eli Zaretskii Content-Type: multipart/alternative; boundary="001a11481742f2f1e40561a5a6ca" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 29812 Cc: 29812@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.5 (/) --001a11481742f2f1e40561a5a6ca Content-Type: text/plain; charset="UTF-8" Eli Zaretskii schrieb am So., 31. Dez. 2017 um 17:38 Uhr: > > From: Philipp Stephani > > Date: Sun, 31 Dec 2017 16:16:02 +0000 > > Cc: 29812@debbugs.gnu.org > > > > AFAIK, electric-quote-replace-double is supposed to work in comments > > and strings in buffers under programming language modes, not only in > > text modes. And it works correctly for me in C modes and also in Lisp > > comments, so why not in Lisp strings? > > > > Does it work as expected for you in C strings? I see the same behavior > in C strings as in Lisp. > > In C, "\"foo\"" produces ASCII quotes. > Did you enable electric-quote-string? > > > Anyway, if this feature is not supposed to work reliably in > > programming language strings, perhaps we shouldn't try? Having it > > sometimes work and sometimes not is IMO confusing. > > > > It should work in comments and strings, yes. However, given that the > behavior is heuristic in all cases it's hard > > to define what the correct behavior should be. > > Well, can you give an example where it does work in strings? Maybe > I'm missing something, because it looked to me as if it never works in > that case. > Depends on what you mean with "work". A bare " should always close the string; after a \ it currently inserts an opening quote because it only looks back one character. --001a11481742f2f1e40561a5a6ca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= So., 31. Dez. 2017 um 17:38=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 31 Dec 2017 16:16:02 +0000
> Cc: 29812@d= ebbugs.gnu.org
>
>=C2=A0 AFAIK, electric-quote-replace-double is supposed to work in comm= ents
>=C2=A0 and strings in buffers under programming language modes, not onl= y in
>=C2=A0 text modes.=C2=A0 And it works correctly for me in C modes and a= lso in Lisp
>=C2=A0 comments, so why not in Lisp strings?
>
> Does it work as expected for you in C strings? I see the same behavior= in C strings as in Lisp.

In C, "\"foo\"" produces ASCII quotes.
=

Did you enable electric-quote-string?
=C2=A0<= /div>

>=C2=A0 Anyway, if this feature is not supposed to work reliably in
>=C2=A0 programming language strings, perhaps we shouldn't try?=C2= =A0 Having it
>=C2=A0 sometimes work and sometimes not is IMO confusing.
>
> It should work in comments and strings, yes. However, given that the b= ehavior is heuristic in all cases it's hard
> to define what the correct behavior should be.

Well, can you give an example where it does work in strings?=C2=A0 Maybe I'm missing something, because it looked to me as if it never works in<= br> that case.

Depends on what you mean wit= h "work". A bare " should always close the string; after a \= it currently inserts an opening quote because it only looks back one chara= cter.=C2=A0
--001a11481742f2f1e40561a5a6ca-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 11:51:25 2017 Received: (at 29812) by debbugs.gnu.org; 31 Dec 2017 16:51:25 +0000 Received: from localhost ([127.0.0.1]:58929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgpZ-00028G-58 for submit@debbugs.gnu.org; Sun, 31 Dec 2017 11:51:25 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:41520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgpW-000280-Rk for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 11:51:23 -0500 Received: by mail-wm0-f46.google.com with SMTP id g75so55533931wme.0 for <29812@debbugs.gnu.org>; Sun, 31 Dec 2017 08:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LD2PFd6hIdb+aUao2hLk6kKsbceC6nILivwqsvImQHo=; b=hvm+YturBfWX2iYDvq1RwQNtjixLpWtZINBhVQlU/uZ9w8HMy5MS3CSsDKdmX3gcP0 GFO2q08BL4wv1XUfNL0Q3LKWKmEcdS9K8JIg31hgYqXW3SPtHVHCqLq8rH8zspI2jpaD +Sn0le9yK8foh2O0ao2vqb0D/sXkmCdQIXIngGu6y1dWP9r4u6cB7Hf/WuKwS9Wg4CvP EIGl5UGYGgefOUf7S9GS3T/bAvGWYKk7RCpsyL9qZFLaSMgtRun5RBahtiE14EgtK5UW 9lDXhhhD1Mztjab7xDx6da1ta9LWFEknnBXfSVnicMlJQ+v8K1jEvzkzW5w8oQDYKe5Y h7dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LD2PFd6hIdb+aUao2hLk6kKsbceC6nILivwqsvImQHo=; b=Je0toNuDyvDlHxkcPHa+p5BEi9uT+pP2K15wx5zsb9iS3D0sOIY+iA4Pnl78JzD1tw DYcD0nSU2NnQ6qBd0UhnT5WfP0DzNI/JONHZ8jS6evlud2+kkBXwZMm44r5NDvfrQ43g c0zBlpdSgdN5+LiK3voFGgQCao242cSWJJIqqtoHKgbUrOEB9MtZpe+3kTUmltoln+sJ yJELfeM4s2ujOUni6HF9vvmBKofYChoVGwtMlc2orinU4q3AeHiepYOOBLvFMcu2qE0s v7vfOY/679haANUgnCwieG05R633qilj6FdZpvVu5LM+PevLExyLm9mncauUyGnyiTOb d/ZQ== X-Gm-Message-State: AKGB3mJoGNqvWYfb1710Bk4VPm51Cax1TFhZYstDaU50Ze+3pYuTi1cm JJM8EXEvbcLPvnW2iwgNF38= X-Google-Smtp-Source: ACJfBot+VpZhmJSNe25tPzrS4slGfW2TLJ2+vT1a8twUrDAnKyEC3j4m2jZFE5dwzY+Sze48X5ELYQ== X-Received: by 10.28.5.198 with SMTP id 189mr32333278wmf.29.1514739076895; Sun, 31 Dec 2017 08:51:16 -0800 (PST) Received: from p.fritz.box (p57AAFA54.dip0.t-ipconnect.de. [87.170.250.84]) by smtp.gmail.com with ESMTPSA id x88sm13216383wrb.4.2017.12.31.08.51.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 31 Dec 2017 08:51:16 -0800 (PST) From: Philipp Stephani X-Google-Original-From: Philipp Stephani To: emacs-devel@gnu.org, 29812@debbugs.gnu.org Subject: [PATCH] Ignore escape characters for context-sensitive quotes (Bug#29812) Date: Sun, 31 Dec 2017 17:51:04 +0100 Message-Id: <20171231165104.68136-1-phst@google.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 29812 Cc: Philipp Stephani 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.2 (/) * lisp/electric.el (electric-quote-post-self-insert-function): Skip over escape characters when determining whether a context-sensitive quote should be opening or closing. * test/lisp/electric-tests.el (electric-quote-replace-double-escaped-open) (electric-quote-replace-double-escaped-close): New unit tests. --- lisp/electric.el | 1 + test/lisp/electric-tests.el | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lisp/electric.el b/lisp/electric.el index cee3562139..9473ef374d 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -504,6 +504,7 @@ electric-quote-post-self-insert-function electric-quote-replace-double) (save-excursion (backward-char) + (skip-syntax-backward "\\") (or (bobp) (bolp) (memq (char-before) (list q< q<<)) (memq (char-syntax (char-before)) diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 7df2449b9e..793cd7c5d3 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el @@ -735,6 +735,24 @@ electric-quote-replace-double-after-paren :bindings '((electric-quote-replace-double . t)) :test-in-comments nil :test-in-strings nil) +(define-electric-pair-test electric-quote-replace-double-escaped-open + "foo \\" "-----\"" :expected-string "foo \\“" + :expected-point 7 :modes '(emacs-lisp-mode c-mode) + :fixture-fn #'electric-quote-local-mode + :bindings '((electric-quote-replace-double . t) + (electric-quote-comment . t) + (electric-quote-string . t)) + :test-in-comments t :test-in-strings t :test-in-code nil) + +(define-electric-pair-test electric-quote-replace-double-escaped-close + "foo \\“foo\\" "----------\"" :expected-string "foo \\“foo\\”" + :expected-point 12 :modes '(emacs-lisp-mode c-mode) + :fixture-fn #'electric-quote-local-mode + :bindings '((electric-quote-replace-double . t) + (electric-quote-comment . t) + (electric-quote-string . t)) + :test-in-comments t :test-in-strings t :test-in-code nil) + ;; Simulate ‘markdown-mode’: it sets both ‘comment-start’ and ;; ‘comment-use-syntax’, but derives from ‘text-mode’. (define-electric-pair-test electric-quote-markdown-in-text -- 2.15.1 From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 12:00:05 2017 Received: (at 29812) by debbugs.gnu.org; 31 Dec 2017 17:00:05 +0000 Received: from localhost ([127.0.0.1]:58933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgxx-0002Kd-1S for submit@debbugs.gnu.org; Sun, 31 Dec 2017 12:00:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVgxt-0002JU-4F for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 12:00:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVgxk-0007el-SH for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 11:59:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVgxk-0007ec-PU; Sun, 31 Dec 2017 11:59:52 -0500 Received: from [176.228.60.248] (port=2578 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eVgxk-0001Jy-7A; Sun, 31 Dec 2017 11:59:52 -0500 Date: Sun, 31 Dec 2017 18:59:43 +0200 Message-Id: <837et2esu8.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sun, 31 Dec 2017 16:49:31 +0000) Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings References: <837etenanf.fsf@gnu.org> <83efnaew0p.fsf@gnu.org> <83a7xyetud.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29812 Cc: 29812@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sun, 31 Dec 2017 16:49:31 +0000 > Cc: 29812@debbugs.gnu.org > > In C, "\"foo\"" produces ASCII quotes. > > Did you enable electric-quote-string? Should I? > Well, can you give an example where it does work in strings? Maybe > I'm missing something, because it looked to me as if it never works in > that case. > > Depends on what you mean with "work". I mean some way of inserting “foo” inside a string. Is that possible somehow? > A bare " should always close the string; after a \ it currently inserts > an opening quote because it only looks back one character. Which is a bug, isn't it? From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 12:03:32 2017 Received: (at 29812) by debbugs.gnu.org; 31 Dec 2017 17:03:32 +0000 Received: from localhost ([127.0.0.1]:58937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVh1I-0002QK-IY for submit@debbugs.gnu.org; Sun, 31 Dec 2017 12:03:32 -0500 Received: from mail-qk0-f182.google.com ([209.85.220.182]:42373) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVh1G-0002Q5-68 for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 12:03:30 -0500 Received: by mail-qk0-f182.google.com with SMTP id d202so33040551qkc.9 for <29812@debbugs.gnu.org>; Sun, 31 Dec 2017 09:03:30 -0800 (PST) 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=7Wj0MHOOk55umvFPSuQPUjKHraO+KQefdu1BzmIQix4=; b=uAoZwxFIX6PIlixByDHUJC6Fct1R+QHZExtkEAdmky1Taq4P/teKKd2XhJ1QPsUJtG Eg3leay+A6fBZDQIO00Etw+0w/HmNdP36Ob3iE8I5mYoy15Rb3EVXDfUE8YSiW3PigUG 4hRvFxdq48bIU4tElD6gmiwwLvXWiWKZARWIzJrccSpPLvkvwr1l9FgKGLc7X3a8jclV nwfiT3c9HM7UV9IkLhuNZRMcJyORS0ljYXVHB183k2cUX6dbH7drDgPxYcvdYJpPgrj2 pWs+VJQ7lDxNcOH5uDNB9aXB5b4GFv3AKULOwLOFA1BQrZRDEAN1nrqxjcPLXIs2jf2N oOJQ== 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=7Wj0MHOOk55umvFPSuQPUjKHraO+KQefdu1BzmIQix4=; b=pIjoXSICxH99KlPR/W23e9wJz+1yZQMkeuOGrt2mKa/z34qq+QDHVZAncY67CMznOY /UblCNXUchJCp6223PulCReAi3MOy+Ms8B7UR6G7vCo5DdCgr2ydL90Mt5XwY6aGZ9GH vD91Gy6i2HiZm6VdAzeuYaUsi3ZMbVCyFnVW2u1zHMkhKWyOp6rIMJInvSw0ZsckH6f3 z0uE9g65UFj4vYuj1JlNeakxP7n3lNgpbrQdgAD3mCHq7OzGKymf6bXFIiHGfXDleQRM 9MLUNp85KuzKRHy6McPf+KQtU5vLNZGMKrF86ngLsv4O3IX+BWJx81kZGIGvFU9c0sjg JYEQ== X-Gm-Message-State: AKGB3mLKQXSWiDtNv1ikMo3qO1ZNYhryp37DjP5cwEjjKQzFJQYFpnk7 mL9qlP8PIbWjfIJ0Hy7enGN7INSFa03qkMBMxj4= X-Google-Smtp-Source: ACJfBovwfnQc2jWVsdOtt9pWTiL2prfnHIT+cXgqG2MZPPTv6xuHuyWniJx2z4hureqd8ypgieX2cD6QsAICd8IH440= X-Received: by 10.233.222.131 with SMTP id s125mr17498367qkf.354.1514739804653; Sun, 31 Dec 2017 09:03:24 -0800 (PST) MIME-Version: 1.0 References: <837etenanf.fsf@gnu.org> <83efnaew0p.fsf@gnu.org> <83a7xyetud.fsf@gnu.org> <837et2esu8.fsf@gnu.org> In-Reply-To: <837et2esu8.fsf@gnu.org> From: Philipp Stephani Date: Sun, 31 Dec 2017 17:03:14 +0000 Message-ID: Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings To: Eli Zaretskii Content-Type: multipart/alternative; boundary="94eb2c046b7afbcc880561a5d704" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 29812 Cc: 29812@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.2 (/) --94eb2c046b7afbcc880561a5d704 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Eli Zaretskii schrieb am So., 31. Dez. 2017 um 18:00 Uhr: > > From: Philipp Stephani > > Date: Sun, 31 Dec 2017 16:49:31 +0000 > > Cc: 29812@debbugs.gnu.org > > > > In C, "\"foo\"" produces ASCII quotes. > > > > Did you enable electric-quote-string? > > Should I? > Yes, it's nil by default. > > > Well, can you give an example where it does work in strings? Maybe > > I'm missing something, because it looked to me as if it never works in > > that case. > > > > Depends on what you mean with "work". > > I mean some way of inserting =E2=80=9Cfoo=E2=80=9D inside a string. Is t= hat possible > somehow? > Sure, either by inserting the characters in some other way, or by using `` and '' (double apostrophe). > > > A bare " should always close the string; after a \ it currently inserts > > an opening quote because it only looks back one character. > > Which is a bug, isn't it? > Maybe. As said, it's a heuristic, and there's no unambiguous "correct" behavior. But the patch I've sent modifies the behavior so that it ignores the escape character. --94eb2c046b7afbcc880561a5d704 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= So., 31. Dez. 2017 um 18:00=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 31 Dec 2017 16:49:31 +0000
> Cc: 29812@d= ebbugs.gnu.org
>
>=C2=A0 In C, "\"foo\"" produces ASCII quotes.
>
> Did you enable electric-quote-string?

Should I?

Yes, it's nil by default.=
=C2=A0

>=C2=A0 Well, can you give an example where it does work in strings?=C2= =A0 Maybe
>=C2=A0 I'm missing something, because it looked to me as if it neve= r works in
>=C2=A0 that case.
>
> Depends on what you mean with "work".

I mean some way of inserting =E2=80=9Cfoo=E2=80=9D inside a string.=C2=A0 I= s that possible
somehow?

Sure, either by inserting the = characters in some other way, or by using `` and '' (double apostro= phe).
=C2=A0

> A bare " should always close the string; after a \ it currently i= nserts
> an opening quote because it only looks back one character.

Which is a bug, isn't it?

Maybe. As= said, it's a heuristic, and there's no unambiguous "correct&q= uot; behavior. But the patch I've sent modifies the behavior so that it= ignores the escape character.=C2=A0
--94eb2c046b7afbcc880561a5d704-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 12:30:16 2017 Received: (at 29812) by debbugs.gnu.org; 31 Dec 2017 17:30:16 +0000 Received: from localhost ([127.0.0.1]:58949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVhRA-00037K-2B for submit@debbugs.gnu.org; Sun, 31 Dec 2017 12:30:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVhR8-000378-HB for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 12:30:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVhQz-0004IF-DV for 29812@debbugs.gnu.org; Sun, 31 Dec 2017 12:30:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVhQz-0004Hx-AA; Sun, 31 Dec 2017 12:30:05 -0500 Received: from [176.228.60.248] (port=2591 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eVhQy-0001lq-L7; Sun, 31 Dec 2017 12:30:05 -0500 Date: Sun, 31 Dec 2017 19:29:55 +0200 Message-Id: <83608merfw.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sun, 31 Dec 2017 17:03:14 +0000) Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings References: <837etenanf.fsf@gnu.org> <83efnaew0p.fsf@gnu.org> <83a7xyetud.fsf@gnu.org> <837et2esu8.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29812 Cc: 29812@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sun, 31 Dec 2017 17:03:14 +0000 > Cc: 29812@debbugs.gnu.org > > I mean some way of inserting “foo” inside a string. Is that possible > somehow? > > Sure, either by inserting the characters in some other way, or by using `` and '' (double apostrophe). Then maybe we should just give up on electric-quote-replace-double inside strings, and use double apostrophes instead? From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 07 07:54:55 2018 Received: (at 29812-done) by debbugs.gnu.org; 7 Jan 2018 12:54:55 +0000 Received: from localhost ([127.0.0.1]:38745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYATV-0004Yq-W6 for submit@debbugs.gnu.org; Sun, 07 Jan 2018 07:54:54 -0500 Received: from mail-qt0-f178.google.com ([209.85.216.178]:33465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYATT-0004Yd-V5 for 29812-done@debbugs.gnu.org; Sun, 07 Jan 2018 07:54:52 -0500 Received: by mail-qt0-f178.google.com with SMTP id e2so10775219qti.0 for <29812-done@debbugs.gnu.org>; Sun, 07 Jan 2018 04:54:51 -0800 (PST) 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=l4ovyLiSTOblmvVfDQQMwsZGRP+/1BEV4TPaAZYNZt0=; b=ugk8LnaLRs6Fln+SqvQsXII0yLZgq/sfJ/NsgJjitLnlLoaol5zfgIujec+OnwTBfL 5OYaRi6SiaiHT6MYsHJe5DhzhTuewsIDQLC+tT9rVk2EeVtU+qy5EcP4wvgtJZQmM+ur hR92O41CfIyXkgJLyuwsEKGuRrO8+crYpj+RPQ5v03s3hC9Reg21vfhvKILtS9txXuBf hq87PUZkuQhStChY1Ex+HelJMoISKJMagZBddk1oZO7itOi7EDZ768z5CyXeyg2uk0Q2 kJcsOD692JCQCkRQT2S4xcXlX2odkGFlpNSjc+z6exe/1tuM+OqR5+B6VdmCwGGCHfvH Wkzw== 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=l4ovyLiSTOblmvVfDQQMwsZGRP+/1BEV4TPaAZYNZt0=; b=oIUzpZP2pNfdT+rT7VXGwcCuAw5ZJmCzLoV1lrjeEPkvxTvLyA8+4XefqTLcRDZ56B wGU9syXqsF1pLxjL0IKrZZnTr8k8fK/wWDdr3bcxR3qfmq1y0SsLi3IAuqvWxL76Fwdm 5pkSg/lacEZYlCMAQnpACYczkRF8U63DeELSM2oGu1q/f0EF3FvEr3BRSon9JtPk+h5r 2rc1wkYGexumc6meTegD/6Z7VBLz9L6fVGx6ljr4ydng4p/G5K9qV2oJMUkBIII2JhaM Fr3+yUlhDLSO9mIm9BE2tV8nr/ONfbix1B5KTYogi2n8cNCGwMfTBmuIY2k6bF5wYzjU qu+g== X-Gm-Message-State: AKwxytdD/9+v2Jb53vjyKIDk8hIH2RHGGBikvIs6uwPHVdR/NhKldP0e nTVSPgheHrpoonUp1+ic7llQxc2wjA2Jmv/nOVc= X-Google-Smtp-Source: ACJfBoszydiejtPgo8uN9fpLu0jpJ9r5vpRqWnMm5CnBcPSQaapnX942Ox0awxn2BRZhLsy0Q4/PO+zhlgwbeQj4VCM= X-Received: by 10.200.51.19 with SMTP id t19mr12204501qta.157.1515329686366; Sun, 07 Jan 2018 04:54:46 -0800 (PST) MIME-Version: 1.0 References: <20171231165104.68136-1-phst@google.com> In-Reply-To: <20171231165104.68136-1-phst@google.com> From: Philipp Stephani Date: Sun, 07 Jan 2018 12:54:35 +0000 Message-ID: Subject: Re: [PATCH] Ignore escape characters for context-sensitive quotes (Bug#29812) To: emacs-devel@gnu.org, 29812-done@debbugs.gnu.org Content-Type: multipart/alternative; boundary="001a11403ccaac6f5b05622f2f28" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 29812-done Cc: Philipp Stephani 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.5 (/) --001a11403ccaac6f5b05622f2f28 Content-Type: text/plain; charset="UTF-8" Philipp Stephani schrieb am So., 31. Dez. 2017 um 17:51 Uhr: > * lisp/electric.el (electric-quote-post-self-insert-function): Skip > over escape characters when determining whether a context-sensitive > quote should be opening or closing. > > * test/lisp/electric-tests.el > (electric-quote-replace-double-escaped-open) > (electric-quote-replace-double-escaped-close): New unit tests. > No comments, so I've pushed this to master as 6735df4443. --001a11403ccaac6f5b05622f2f28 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am So., 31. Dez. 2017 um 17:51=C2=A0Uhr:
* lisp/electric.el (electric-quote-post-self-inser= t-function): Skip
over escape characters when determining whether a context-sensitive
quote should be opening or closing.

* test/lisp/electric-tests.el
(electric-quote-replace-double-escaped-open)
(electric-quote-replace-double-escaped-close): New unit tests.

No comments, so I've pushed this to ma= ster as 6735df4443.=C2=A0
--001a11403ccaac6f5b05622f2f28-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 07 07:56:49 2018 Received: (at 29812) by debbugs.gnu.org; 7 Jan 2018 12:56:49 +0000 Received: from localhost ([127.0.0.1]:38752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYAVN-0004bv-43 for submit@debbugs.gnu.org; Sun, 07 Jan 2018 07:56:49 -0500 Received: from mail-qk0-f177.google.com ([209.85.220.177]:43681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYAVK-0004bh-UO for 29812@debbugs.gnu.org; Sun, 07 Jan 2018 07:56:47 -0500 Received: by mail-qk0-f177.google.com with SMTP id j137so11190818qke.10 for <29812@debbugs.gnu.org>; Sun, 07 Jan 2018 04:56:46 -0800 (PST) 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=S+1Zqb9koACJ6cELEs/qQzv14oh0WLJxddVrjGu7Hsc=; b=vNUdy+ENyo+OH7BrKhay+sHRt7fJb94RRJu72V5lvu5Y2k1SRHUpzte/n984HvzNFs x+7eV77oJpVVuWOKJXGVe4NqFT8lCX/r3enPKiS2bOJmt4/VwM4/jEzA5AgXVQjkk8cj J4C5TsVwb0G3WgceyaWMRz0T+CviM8//fptP2yehErhfmS6+Z87TWK7XmoEvTFEg3yNU USMq8RfoWpEBlW9E+XDr4IqT39fcYdiSmKPK0skB2LKu2ukW609zX6HHdx+kMBLcnCMG 7D0+78zVgQvUp+xw+b2mU0kS0Fa+RK5NgzdqENa26nAWP3VtRqi2DnVkbhVyhSYz6Odq oorQ== 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=S+1Zqb9koACJ6cELEs/qQzv14oh0WLJxddVrjGu7Hsc=; b=iyIq/FM0c8F8/0h64Zu1K8JtcOAz0VjBF0ZSJkQnYqvgW2LIi9+8Nal7bVPFo8uVa6 uUcPKF2De+oKWj1AhtUMsC4pcHhmlYfALjgSb2/oI8Ij73OfEFFEHSiQO5IgwtN0XNv0 Bfb+7CJc6HWDRB5Ppw8Pk6pmbv/CyHpqZkz1ye+9CC16nBmP5v9JMd35SyAgVK+Gox2B 6mVMOBZOU3XKyMMcvid1DEU7DyPrxYBnqBFo2vM4IX7kW4werD1XA5dq6VPlXilyIVBB lvpZrfTnx2RNCHTw27ILMBsl1qED4JBrfgSsaKETKlGJc73blzRXQOcHDzOCmP0b4ni3 Lntw== X-Gm-Message-State: AKwxytdNGCFeMhd8tH6xVH/2Ik+AvdGQU2axmwLHWbYcQCXCLcYuETAO 7/hyyRid3wxngfQoSm70qVX9rURL1y8U989pgIXrLQ== X-Google-Smtp-Source: ACJfBouqwIc0MoK9ugsUN54EKlGlut/sVTMYCy+iQPBtXKqQGHuaNPqabKUPWiXSw7kFbrXAcBzhl/AK2NJx5XYUTIw= X-Received: by 10.55.16.219 with SMTP id 88mr12357874qkq.151.1515329801405; Sun, 07 Jan 2018 04:56:41 -0800 (PST) MIME-Version: 1.0 References: <837etenanf.fsf@gnu.org> <83efnaew0p.fsf@gnu.org> <83a7xyetud.fsf@gnu.org> <837et2esu8.fsf@gnu.org> <83608merfw.fsf@gnu.org> In-Reply-To: <83608merfw.fsf@gnu.org> From: Philipp Stephani Date: Sun, 07 Jan 2018 12:56:31 +0000 Message-ID: Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings To: Eli Zaretskii Content-Type: multipart/alternative; boundary="001a113fe13887cb1a05622f368f" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 29812 Cc: 29812@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.2 (/) --001a113fe13887cb1a05622f368f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Eli Zaretskii schrieb am So., 31. Dez. 2017 um 18:30 Uhr: > > From: Philipp Stephani > > Date: Sun, 31 Dec 2017 17:03:14 +0000 > > Cc: 29812@debbugs.gnu.org > > > > I mean some way of inserting =E2=80=9Cfoo=E2=80=9D inside a string. I= s that possible > > somehow? > > > > Sure, either by inserting the characters in some other way, or by using > `` and '' (double apostrophe). > > Then maybe we should just give up on electric-quote-replace-double > inside strings, and use double apostrophes instead? > Why? It works as designed and expected =E2=80=93 that is, a double quote wi= ll terminate the string. That is what users want most of the time. Also, there are many languages where strings aren't double-quoted, such as Python. --001a113fe13887cb1a05622f368f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= So., 31. Dez. 2017 um 18:30=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 31 Dec 2017 17:03:14 +0000
> Cc: 29812@d= ebbugs.gnu.org
>
>=C2=A0 I mean some way of inserting =E2=80=9Cfoo=E2=80=9D inside a stri= ng.=C2=A0 Is that possible
>=C2=A0 somehow?
>
> Sure, either by inserting the characters in some other way, or by usin= g `` and '' (double apostrophe).

Then maybe we should just give up on electric-quote-replace-double
inside strings, and use double apostrophes instead?
Why? It works as designed and expected =E2=80=93 that is, a do= uble quote will terminate the string. That is what users want most of the t= ime. Also, there are many languages where strings aren't double-quoted,= such as Python.=C2=A0
--001a113fe13887cb1a05622f368f-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 07 11:50:42 2018 Received: (at 29812) by debbugs.gnu.org; 7 Jan 2018 16:50:42 +0000 Received: from localhost ([127.0.0.1]:39791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYE9i-0001lV-H5 for submit@debbugs.gnu.org; Sun, 07 Jan 2018 11:50:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37001) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYE9h-0001lI-11 for 29812@debbugs.gnu.org; Sun, 07 Jan 2018 11:50:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYE9W-0007bN-RT for 29812@debbugs.gnu.org; Sun, 07 Jan 2018 11:50:35 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYE9W-0007bC-NL; Sun, 07 Jan 2018 11:50:30 -0500 Received: from [176.228.60.248] (port=1635 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eYE9W-0007dG-4Q; Sun, 07 Jan 2018 11:50:30 -0500 Date: Sun, 07 Jan 2018 18:50:16 +0200 Message-Id: <83lgh98vg7.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sun, 07 Jan 2018 12:56:31 +0000) Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings References: <837etenanf.fsf@gnu.org> <83efnaew0p.fsf@gnu.org> <83a7xyetud.fsf@gnu.org> <837et2esu8.fsf@gnu.org> <83608merfw.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29812 Cc: 29812@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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sun, 07 Jan 2018 12:56:31 +0000 > Cc: 29812@debbugs.gnu.org > > > I mean some way of inserting “foo” inside a string. Is that possible > > somehow? > > > > Sure, either by inserting the characters in some other way, or by using `` and '' (double apostrophe). > > Then maybe we should just give up on electric-quote-replace-double > inside strings, and use double apostrophes instead? > > Why? It works as designed and expected – that is, a double quote will terminate the string. That is what users > want most of the time. Also, there are many languages where strings aren't double-quoted, such as Python. Once again, my problem is that one cannot insert “foo” inside strings (unless in languages where strings are quoted 'like this', I guess). So I'm saying that we probably shouldn't advertise this method for text in strings in programming modes, because it doesn't really work there. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 07 12:19:22 2018 Received: (at 29812) by debbugs.gnu.org; 7 Jan 2018 17:19:22 +0000 Received: from localhost ([127.0.0.1]:39801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYEbR-0002TG-BE for submit@debbugs.gnu.org; Sun, 07 Jan 2018 12:19:21 -0500 Received: from mail-qt0-f174.google.com ([209.85.216.174]:44982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYEbP-0002Sv-6G for 29812@debbugs.gnu.org; Sun, 07 Jan 2018 12:19:19 -0500 Received: by mail-qt0-f174.google.com with SMTP id m59so11187476qte.11 for <29812@debbugs.gnu.org>; Sun, 07 Jan 2018 09:19:19 -0800 (PST) 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=ay7fbalwM4Yr+ujvM6+ZoHIlwAl7BZcWM6LG1rwUpao=; b=QHV7dpo1I0Hic1uHzTSbFZF9zdid5FOHBrzrXpmAD+A4kyoMG1C/7EThUjKnGwLTl9 gBU8MeVjbGti9SxvsJGhC++jjF14B9L+sXHSk/GkQouxsCWAikVBIczt7CJRAZUM/J3u /VKxZX1fsZaKYhF+0Ux9Qx5mCarx7ordGrbk9REXp6OFX3Zf6SJnQ1aUT/J80dRgUUAH LkUs1JFAUqJDxCQJFlqH2FozBigkc4/IpNLloGfI9jPfJVJpKE8tQ3GZQpIskIWE9KWO 9W5vGUsZjORhbGNsjOqEXg0h+1HOOaOBfXV8mkzJqmnYh3sFFEjFg7u3xAQbyj6ATTu7 GrDg== 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=ay7fbalwM4Yr+ujvM6+ZoHIlwAl7BZcWM6LG1rwUpao=; b=RBeO5AU32IyP1G+Y8vQlHS+TYYsfMPhLpVH8IbEpMPcG9waCf4ZUHvw+ODFjV8T5X2 Y4NgR1sZ7+BeDoL8JpGV5Epwoxtsy6GFQgZMuoxl6K6mq4hAyWrx2hetCNuRsL7sQYN3 1y4LyfeO/TA5Ilp0+LjWdrb3QEzLo7Ea1TglSBOEEEUH7wV5X26Ap0qKP5MP1hiQQAI+ BH+XAeKmjGwZMTdSKvXljNw0Amyj2qb5LVpkb48WcuVLzMQXWOkpXxlecHHgz16FVLGv bHgEyJjEkhNV9KU1kld9rAUJYbsHrZ99n/am5Jo7nTVbzHnZ1MhoqYf7zDDHGVHuxxEz a/MA== X-Gm-Message-State: AKwxytfHakEH1GyUn0MURbW1FM1tqcBpBF4DOvxX7KCrZKosddTMA7Ed ouAbSBSb+5q2vgAEy/Fg64ieWyizh5GY1nsriiI= X-Google-Smtp-Source: ACJfBovOHfWLd5LqU3GNi/Vf3O5R/HGXZ0nf9pQRE6Kiypg7TxK8AN6Z2MKfx8EBojQM56E0ZJ8Kva/9VgoPhwB4I5E= X-Received: by 10.200.35.186 with SMTP id q55mr12303871qtq.73.1515345553676; Sun, 07 Jan 2018 09:19:13 -0800 (PST) MIME-Version: 1.0 References: <837etenanf.fsf@gnu.org> <83efnaew0p.fsf@gnu.org> <83a7xyetud.fsf@gnu.org> <837et2esu8.fsf@gnu.org> <83608merfw.fsf@gnu.org> <83lgh98vg7.fsf@gnu.org> In-Reply-To: <83lgh98vg7.fsf@gnu.org> From: Philipp Stephani Date: Sun, 07 Jan 2018 17:19:02 +0000 Message-ID: Subject: Re: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings To: Eli Zaretskii Content-Type: multipart/alternative; boundary="001a1140d2b8705dc6056232e19c" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 29812 Cc: 29812@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.2 (/) --001a1140d2b8705dc6056232e19c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Eli Zaretskii schrieb am So., 7. Jan. 2018 um 17:50 Uhr: > > From: Philipp Stephani > > Date: Sun, 07 Jan 2018 12:56:31 +0000 > > Cc: 29812@debbugs.gnu.org > > > > > I mean some way of inserting =E2=80=9Cfoo=E2=80=9D inside a string.= Is that possible > > > somehow? > > > > > > Sure, either by inserting the characters in some other way, or by > using `` and '' (double apostrophe). > > > > Then maybe we should just give up on electric-quote-replace-double > > inside strings, and use double apostrophes instead? > > > > Why? It works as designed and expected =E2=80=93 that is, a double quot= e will > terminate the string. That is what users > > want most of the time. Also, there are many languages where strings > aren't double-quoted, such as Python. > > Once again, my problem is that one cannot insert =E2=80=9Cfoo=E2=80=9D in= side strings > (unless in languages where strings are quoted 'like this', I guess). > So I'm saying that we probably shouldn't advertise this method for > text in strings in programming modes, because it doesn't really work > there. > Feel free to clarify the NEWS entry. (You mentioned strings there in commit e92f5537a8222187525ef5066dba051211db5290.) --001a1140d2b8705dc6056232e19c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= So., 7. Jan. 2018 um 17:50=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 07 Jan 2018 12:56:31 +0000
> Cc: 29812@d= ebbugs.gnu.org
>
>=C2=A0 >=C2=A0 I mean some way of inserting =E2=80=9Cfoo=E2=80=9D in= side a string.=C2=A0 Is that possible
>=C2=A0 >=C2=A0 somehow?
>=C2=A0 >
>=C2=A0 > Sure, either by inserting the characters in some other way,= or by using `` and '' (double apostrophe).
>
>=C2=A0 Then maybe we should just give up on electric-quote-replace-doub= le
>=C2=A0 inside strings, and use double apostrophes instead?
>
> Why? It works as designed and expected =E2=80=93 that is, a double quo= te will terminate the string. That is what users
> want most of the time. Also, there are many languages where strings ar= en't double-quoted, such as Python.

Once again, my problem is that one cannot insert =E2=80=9Cfoo=E2=80=9D insi= de strings
(unless in languages where strings are quoted 'like this', I guess)= .
So I'm saying that we probably shouldn't advertise this method for<= br> text in strings in programming modes, because it doesn't really work there.

Feel free to clarify the NEWS en= try. (You mentioned strings there in commit e92f5537a8222187525ef5066dba051= 211db5290.)=C2=A0
--001a1140d2b8705dc6056232e19c-- From unknown Tue Jun 17 20:20:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 05 Feb 2018 12:24:04 +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