all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: 29812@debbugs.gnu.org
Subject: bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings
Date: Sun, 31 Dec 2017 17:51:02 +0200	[thread overview]
Message-ID: <83efnaew0p.fsf@gnu.org> (raw)
In-Reply-To: <CAArVCkToAoaNxnxTa07VHcvoXzepBc5YGKFV4mmGVBzCy6NcJQ@mail.gmail.com> (message from Philipp Stephani on Sat, 30 Dec 2017 22:07:16 +0000)

> From: Philipp Stephani <p.stephani2@gmail.com>
> 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.





  reply	other threads:[~2017-12-31 15:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22 13:40 bug#29812: 27.0.50; electric-quote-replace-double misbehaves in Lisp strings Eli Zaretskii
2017-12-30 22:07 ` Philipp Stephani
2017-12-31 15:51   ` Eli Zaretskii [this message]
2017-12-31 16:16     ` Philipp Stephani
2017-12-31 16:38       ` Eli Zaretskii
2017-12-31 16:49         ` Philipp Stephani
2017-12-31 16:59           ` Eli Zaretskii
2017-12-31 17:03             ` Philipp Stephani
2017-12-31 17:29               ` Eli Zaretskii
2018-01-07 12:56                 ` Philipp Stephani
2018-01-07 16:50                   ` Eli Zaretskii
2018-01-07 17:19                     ` Philipp Stephani
2017-12-31 16:51       ` bug#29812: [PATCH] Ignore escape characters for context-sensitive quotes (Bug#29812) Philipp Stephani
2017-12-31 16:51       ` Philipp Stephani
2018-01-07 12:54         ` bug#29812: " Philipp Stephani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83efnaew0p.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=29812@debbugs.gnu.org \
    --cc=p.stephani2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.