GNU bug report logs - #32939
27.0.50; Don't reject confusable quotes, just fontify & mention them in error messages

Previous Next

Package: emacs;

Reported by: Noam Postavsky <npostavs <at> gmail.com>

Date: Thu, 4 Oct 2018 23:59:02 UTC

Severity: wishlist

Tags: fixed, patch

Found in version 27.0.50

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32939 in the body.
You can then email your comments to 32939 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32939; Package emacs. (Thu, 04 Oct 2018 23:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Noam Postavsky <npostavs <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 04 Oct 2018 23:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50;
 Don't reject confusable quotes, just fontify & mention them in error
 messages
Date: Thu, 04 Oct 2018 19:58:10 -0400
[Message part 1 (text/plain, inline)]
Severity: wishlist

As a followup from [1], here is a patchset which replaces the master's
current rejection of confusable quotes on `read', and instead adds a
hint to the error message when evaluating an expression with a
confusable quote leads to an error.

And also highlight such quotes with warning-face.

[1]: https://lists.gnu.org/archive/html/emacs-devel/2018-02/msg00093.html

[v1-0001-Stop-signaling-an-error-when-reading-smart-quotes.patch (text/plain, attachment)]
[v1-0002-Give-suggestions-on-errors-about-var-names-with-c.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32939; Package emacs. (Fri, 05 Oct 2018 08:46:02 GMT) Full text and rfc822 format available.

Message #8 received at 32939 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 32939 <at> debbugs.gnu.org
Subject: Re: bug#32939: 27.0.50;
 Don't reject confusable quotes, just fontify & mention them in error
 messages
Date: Fri, 05 Oct 2018 11:44:52 +0300
> From: Noam Postavsky <npostavs <at> gmail.com>
> Date: Thu, 04 Oct 2018 19:58:10 -0400
> 
> As a followup from [1], here is a patchset which replaces the master's
> current rejection of confusable quotes on `read', and instead adds a
> hint to the error message when evaluating an expression with a
> confusable quote leads to an error.
> 
> And also highlight such quotes with warning-face.

Thanks.  If this is accepted, it will need documentation changes,
including NEWS.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32939; Package emacs. (Wed, 24 Oct 2018 22:27:02 GMT) Full text and rfc822 format available.

Message #11 received at 32939 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 32939 <at> debbugs.gnu.org
Subject: Re: bug#32939: 27.0.50;
 Don't reject confusable quotes, just fontify & mention them in error
 messages
Date: Wed, 24 Oct 2018 18:25:53 -0400
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Noam Postavsky <npostavs <at> gmail.com>
>> Date: Thu, 04 Oct 2018 19:58:10 -0400
>> 
>> As a followup from [1], here is a patchset which replaces the master's
>> current rejection of confusable quotes on `read', and instead adds a
>> hint to the error message when evaluating an expression with a
>> confusable quote leads to an error.
>> 
>> And also highlight such quotes with warning-face.
>
> Thanks.  If this is accepted, it will need documentation changes,
> including NEWS.

I adjusted the first patch so it applies cleanly to more recent master,
and added a NEWS entry for the fontification.  I'm not sure about what
other documentation we need though.

[v2-0001-Stop-signaling-an-error-when-reading-smart-quotes.patch (text/plain, attachment)]
[v2-0002-Improve-errors-warnings-due-to-fancy-quoted-vars-.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32939; Package emacs. (Sat, 27 Oct 2018 09:49:02 GMT) Full text and rfc822 format available.

Message #14 received at 32939 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 32939 <at> debbugs.gnu.org
Subject: Re: bug#32939: 27.0.50;
 Don't reject confusable quotes, just fontify & mention them in error
 messages
Date: Sat, 27 Oct 2018 12:48:47 +0300
> From: Noam Postavsky <npostavs <at> gmail.com>
> Cc: 32939 <at> debbugs.gnu.org
> Date: Wed, 24 Oct 2018 18:25:53 -0400
> 
> >> As a followup from [1], here is a patchset which replaces the master's
> >> current rejection of confusable quotes on `read', and instead adds a
> >> hint to the error message when evaluating an expression with a
> >> confusable quote leads to an error.
> >> 
> >> And also highlight such quotes with warning-face.
> >
> > Thanks.  If this is accepted, it will need documentation changes,
> > including NEWS.
> 
> I adjusted the first patch so it applies cleanly to more recent master,
> and added a NEWS entry for the fontification.  I'm not sure about what
> other documentation we need though.

I thought the error was documented in the ELisp manual, but I see now
that it wasn't.  So indeed, no changes besides NEWS seem to be
required.

However, perhaps we should mention this behavior in "Basic Char
Syntax" and the related use of this face in "Faces for Font Lock".
WDYT?

> -(ert-deftest lread-tests--funny-quote-symbols ()
> -  "Check that 'smart quotes' or similar trigger errors in symbol names."
> -  (dolist (quote-char
> -           '(#x2018 ;; LEFT SINGLE QUOTATION MARK
> -             #x2019 ;; RIGHT SINGLE QUOTATION MARK
> -             #x201B ;; SINGLE HIGH-REVERSED-9 QUOTATION MARK
> -             #x201C ;; LEFT DOUBLE QUOTATION MARK
> -             #x201D ;; RIGHT DOUBLE QUOTATION MARK
> -             #x201F ;; DOUBLE HIGH-REVERSED-9 QUOTATION MARK
> -             #x301E ;; DOUBLE PRIME QUOTATION MARK
> -             #xFF02 ;; FULLWIDTH QUOTATION MARK
> -             #xFF07 ;; FULLWIDTH APOSTROPHE
> -             ))
> -    (let ((str (format "%cfoo" quote-char)))
> -     (should-error (read str) :type 'invalid-read-syntax)
> -     (should (eq (read (concat "\\" str)) (intern str))))))
> -

Should we replace this test by one that tests the fontification?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32939; Package emacs. (Tue, 30 Oct 2018 01:31:01 GMT) Full text and rfc822 format available.

Message #17 received at 32939 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 32939 <at> debbugs.gnu.org
Subject: Re: bug#32939: 27.0.50;
 Don't reject confusable quotes, just fontify & mention them in error
 messages
Date: Mon, 29 Oct 2018 21:30:43 -0400
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> However, perhaps we should mention this behavior in "Basic Char
> Syntax" and the related use of this face in "Faces for Font Lock".
> WDYT?

I've tried adding some mentions of it in those places (unfilled to
simplify diff).  Though I'm not sure if it makes sense to talk about
this somewhat obscure case.

>> -(ert-deftest lread-tests--funny-quote-symbols ()

> Should we replace this test by one that tests the fontification?

Right, good point, added.  And I had missed disabling fontification for
backslash escaped characters, now fixed.

[v3-0002-Improve-errors-warnings-due-to-fancy-quoted-vars-.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32939; Package emacs. (Tue, 30 Oct 2018 07:13:02 GMT) Full text and rfc822 format available.

Message #20 received at 32939 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 32939 <at> debbugs.gnu.org
Subject: Re: bug#32939: 27.0.50;
 Don't reject confusable quotes, just fontify & mention them in error
 messages
Date: Tue, 30 Oct 2018 09:12:58 +0200
> From: Noam Postavsky <npostavs <at> gmail.com>
> Cc: 32939 <at> debbugs.gnu.org
> Date: Mon, 29 Oct 2018 21:30:43 -0400
> 
> > However, perhaps we should mention this behavior in "Basic Char
> > Syntax" and the related use of this face in "Faces for Font Lock".
> > WDYT?
> 
> I've tried adding some mentions of it in those places (unfilled to
> simplify diff).  Though I'm not sure if it makes sense to talk about
> this somewhat obscure case.

I think your text is good, but...

> --- a/doc/lispref/objects.texi
> +++ b/doc/lispref/objects.texi
> @@ -347,7 +347,12 @@ Basic Char Syntax
>  characters.  However, you must add a backslash before any of the
>  characters @samp{()[]\;"}, and you should add a backslash before any
>  of the characters @samp{|'`#.,} to avoid confusing the Emacs commands
> -for editing Lisp code.  You can also add a backslash before whitespace
> +for editing Lisp code.  You should also add a backslash before Unicode
> +characters which resemble the previously mentioned @acronym{ASCII}
> +ones, to avoid confusing people reading your code.  Emacs will
> +highlight some non-escaped commonly confused characters such as
> +@samp{‘} to encourage this.
> +                        You can also add a backslash before whitespace
   ^^^^^^^^^^^^^^^^^^^^^^^^
What's the deal with this large whitespace stretch?

Thanks.




Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 31 Oct 2019 17:18:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32939; Package emacs. (Sun, 17 Nov 2019 08:43:02 GMT) Full text and rfc822 format available.

Message #25 received at 32939 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Noam Postavsky <npostavs <at> gmail.com>, 32939 <at> debbugs.gnu.org
Subject: Re: bug#32939: 27.0.50; Don't reject confusable quotes, just
 fontify & mention them in error messages
Date: Sun, 17 Nov 2019 09:42:42 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I've tried adding some mentions of it in those places (unfilled to
>> simplify diff).  Though I'm not sure if it makes sense to talk about
>> this somewhat obscure case.
>
> I think your text is good, but...

[...]

>> +                        You can also add a backslash before whitespace
>    ^^^^^^^^^^^^^^^^^^^^^^^^
> What's the deal with this large whitespace stretch?

If I read this thread correctly, the change was accepted, but never
applied (as far as I can tell).  Noam, were there any further changes
you wanted to make before applying it?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32939; Package emacs. (Wed, 27 Nov 2019 19:43:01 GMT) Full text and rfc822 format available.

Message #28 received at 32939 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 32939 <at> debbugs.gnu.org
Subject: Re: bug#32939: 27.0.50;
 Don't reject confusable quotes, just fontify & mention them in error
 messages
Date: Wed, 27 Nov 2019 14:42:08 -0500
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> If I read this thread correctly, the change was accepted, but never
> applied (as far as I can tell).  Noam, were there any further changes
> you wanted to make before applying it?

No, I just happened to take a long break from Emacs development soon after
posting this and it's been sitting since then.  It better go in before
the pretest though, I'll push today or tomorrow.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32939; Package emacs. (Thu, 28 Nov 2019 23:26:02 GMT) Full text and rfc822 format available.

Message #31 received at 32939 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 32939 <at> debbugs.gnu.org
Subject: Re: bug#32939: 27.0.50;
 Don't reject confusable quotes, just fontify & mention them in error
 messages
Date: Thu, 28 Nov 2019 18:25:33 -0500
tags 32939 fixed
close 32939 27.1
quit

Noam Postavsky <npostavs <at> gmail.com> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> If I read this thread correctly, the change was accepted, but never
>> applied (as far as I can tell).  Noam, were there any further changes
>> you wanted to make before applying it?
>
> No, I just happened to take a long break from Emacs development soon after
> posting this and it's been sitting since then.  It better go in before
> the pretest though, I'll push today or tomorrow.

Done.

[1: b2790db049]: 2019-11-28 18:10:07 -0500
  Improve errors & warnings due to fancy quoted vars (Bug#32939)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=b2790db049da98b541d07bac21ca7d7c220d3be0

[2: 85f586f3ce]: 2019-11-28 18:03:42 -0500
  Stop signaling an error when reading "smart quotes" in symbols
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=85f586f3ce5c6d9598d345440fd57e0fc9b8d98b




Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 28 Nov 2019 23:26:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 32939 <at> debbugs.gnu.org and Noam Postavsky <npostavs <at> gmail.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 28 Nov 2019 23:26:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 Dec 2019 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.