GNU bug report logs -
#36068
27.0.50; Warning: unescaped character literals `?)' detected, `?\)' expected!
Previous Next
Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>
Date: Mon, 3 Jun 2019 02:28:02 UTC
Severity: normal
Tags: confirmed, fixed, patch
Found in version 27.0.50
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 36068 in the body.
You can then email your comments to 36068 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 03 Jun 2019 02:28:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Michael Heerdegen <michael_heerdegen <at> web.de>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 03 Jun 2019 02:28:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello,
Sometimes, out of nowhere, when I byte compile my init file (with my
config loaded of course), I get hundreds (!) of warnings
.gnu-emacs.el:22:1:Warning: unescaped character literals `?)' detected, `?\)'
expected!
Dunno if it happens when there is a syntax error in the file, or just
Heisenbug like. When this has happened once, I cannot get back to a
normal compilation, compiling any Elisp file gives me the above
warnings. I have to restart Emacs. Then everything is good.
I have still open such an ill session, maybe it can help with the
diagnosis?
TIA,
Michael.
In GNU Emacs 27.0.50 (build 19, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
of 2019-06-03 built on drachen
Repository revision: ae7e0657b20037eb386aa21a35f05bcb4c283611
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux 10 (buster)
Recent messages:
Saving /home/micha/gnu-emacs/.newsrc.eld...
Saving file /home/micha/gnu-emacs/.newsrc.eld...
Wrote /home/micha/gnu-emacs/.newsrc.eld
Saving /home/micha/gnu-emacs/.newsrc.eld...done
Sending...
Sending via mail...
Sending email
Sending email done
Sending...done
Making completion list... [10 times]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 03 Jun 2019 12:07:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 36068 <at> debbugs.gnu.org (full text, mbox):
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> Sometimes, out of nowhere, when I byte compile my init file (with my
> config loaded of course), I get hundreds (!) of warnings
>
> .gnu-emacs.el:22:1:Warning: unescaped character literals `?)' detected, `?\)'
> expected!
>
> Dunno if it happens when there is a syntax error in the file, or just
> Heisenbug like. When this has happened once, I cannot get back to a
> normal compilation, compiling any Elisp file gives me the above
> warnings. I have to restart Emacs. Then everything is good.
>
> I have still open such an ill session, maybe it can help with the
> diagnosis?
Hmm, is lread--unescaped-character-literals non-nil? It looks like the
variable can only get cleared due to the let-binding in load, so if it
somehow got set outside of that, then you would see continual warnings
from it.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 03 Jun 2019 13:17:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 36068 <at> debbugs.gnu.org (full text, mbox):
Noam Postavsky <npostavs <at> gmail.com> writes:
> Hmm, is lread--unescaped-character-literals non-nil? It looks like
> the variable can only get cleared due to the let-binding in load, so
> if it somehow got set outside of that, then you would see continual
> warnings from it.
Yes, its value is (41).
Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 03 Jun 2019 13:51:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 36068 <at> debbugs.gnu.org (full text, mbox):
tags 36068 + confirmed
quit
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> Noam Postavsky <npostavs <at> gmail.com> writes:
>
>> Hmm, is lread--unescaped-character-literals non-nil? It looks like
>> the variable can only get cleared due to the let-binding in load, so
>> if it somehow got set outside of that, then you would see continual
>> warnings from it.
>
> Yes, its value is (41).
Ah, I think the problem can be triggered any time you `read' an unescaped
literal outside of `load'. E.g., from emacs -Q:
M-: (read "?)") RET
or even just
M-: ?) RET
Now any byte-compilation will report unescaped `?)'. You can
(setq lread--unescaped-character-literals nil)
to stop it.
Added tag(s) confirmed.
Request was from
npostavs <at> gmail.com
to
control <at> debbugs.gnu.org
.
(Mon, 03 Jun 2019 13:51:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 03 Jun 2019 14:35:01 GMT)
Full text and
rfc822 format available.
Message #19 received at 36068 <at> debbugs.gnu.org (full text, mbox):
npostavs <at> gmail.com writes:
> Ah, I think the problem can be triggered any time you `read' an unescaped
> literal outside of `load'. E.g., from emacs -Q:
>
> M-: (read "?)") RET
>
> or even just
>
> M-: ?) RET
>
> Now any byte-compilation will report unescaped `?)'. You can
>
> (setq lread--unescaped-character-literals nil)
>
> to stop it.
I can confirm all of that.
I use `read' quite often through el-search, also through an experimental
el-search-hi-lock mode, so that might explain why I might see the
problem more often than others.
Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 03 Jun 2019 14:52:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 36068 <at> debbugs.gnu.org (full text, mbox):
> From: npostavs <at> gmail.com
> Date: Mon, 03 Jun 2019 09:50:47 -0400
> Cc: 36068 <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
>
> Ah, I think the problem can be triggered any time you `read' an unescaped
> literal outside of `load'. E.g., from emacs -Q:
>
> M-: (read "?)") RET
>
> or even just
>
> M-: ?) RET
>
> Now any byte-compilation will report unescaped `?)'.
Maybe we should forcefully set it to nil at top level?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 03 Jun 2019 17:05:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 36068 <at> debbugs.gnu.org (full text, mbox):
On Jun 03 2019, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: npostavs <at> gmail.com
>> Date: Mon, 03 Jun 2019 09:50:47 -0400
>> Cc: 36068 <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
>>
>> Ah, I think the problem can be triggered any time you `read' an unescaped
>> literal outside of `load'. E.g., from emacs -Q:
>>
>> M-: (read "?)") RET
>>
>> or even just
>>
>> M-: ?) RET
>>
>> Now any byte-compilation will report unescaped `?)'.
>
> Maybe we should forcefully set it to nil at top level?
But how can load_warn_unescaped_character_literals be called while
lread--unescaped-character-literals is not let-bound?
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 03 Jun 2019 17:15:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 36068 <at> debbugs.gnu.org (full text, mbox):
Andreas Schwab <schwab <at> linux-m68k.org> writes:
> On Jun 03 2019, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>>> From: npostavs <at> gmail.com
>>> Ah, I think the problem can be triggered any time you `read' an unescaped
>>> literal outside of `load'. E.g., from emacs -Q:
>>> M-: ?) RET
>>>
>>> Now any byte-compilation will report unescaped `?)'.
>>
>> Maybe we should forcefully set it to nil at top level?
>
> But how can load_warn_unescaped_character_literals be called while
> lread--unescaped-character-literals is not let-bound?
It's not. byte-run--unescaped-character-literals-warning is called from
the byte compiler. So maybe just let-binding
lread--unescaped-character-literals in byte-compile-from-buffer should
be enough.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 03 Jun 2019 17:19:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 36068 <at> debbugs.gnu.org (full text, mbox):
On Jun 03 2019, npostavs <at> gmail.com wrote:
> tags 36068 + confirmed
> quit
>
> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
>
>> Noam Postavsky <npostavs <at> gmail.com> writes:
>>
>>> Hmm, is lread--unescaped-character-literals non-nil? It looks like
>>> the variable can only get cleared due to the let-binding in load, so
>>> if it somehow got set outside of that, then you would see continual
>>> warnings from it.
>>
>> Yes, its value is (41).
>
> Ah, I think the problem can be triggered any time you `read' an unescaped
> literal outside of `load'. E.g., from emacs -Q:
>
> M-: (read "?)") RET
>
> or even just
>
> M-: ?) RET
Even byte-compiling a file containing such an unescaped literal sets
lread--unescaped-character-literals in the global scope. I think this
is where the real bug is.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Wed, 05 Jun 2019 01:31:01 GMT)
Full text and
rfc822 format available.
Message #34 received at 36068 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tags 36068 + patch
quit
>> Ah, I think the problem can be triggered any time you `read' an unescaped
>> literal outside of `load'. E.g., from emacs -Q:
>>
>> M-: (read "?)") RET
>
> Even byte-compiling a file containing such an unescaped literal sets
> lread--unescaped-character-literals in the global scope. I think this
> is where the real bug is.
Yes, agreed. Here's a patch.
[0001-Don-t-keep-warning-about-unescaped-literals-Bug-3606.patch (text/x-diff, inline)]
From ffa9c9e17bd6724107b6c3b5c49221b58d7c92ab Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Tue, 4 Jun 2019 21:26:06 -0400
Subject: [PATCH] Don't keep warning about unescaped literals (Bug#36068)
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Restore lost
let-binding of lread--unescaped-character-literals, so that unescaped
literals warning will only apply to the form just read.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--unescaped-char-literals): Expand test to check that
we don't keep warning about old unescaped literals.
---
lisp/emacs-lisp/bytecomp.el | 5 +++--
test/lisp/emacs-lisp/bytecomp-tests.el | 32 +++++++++++++++++++-------------
2 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index dfbda8d43e..f8a5c264ab 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2091,8 +2091,9 @@ (defun byte-compile-from-buffer (inbuffer)
(not (eobp)))
(setq byte-compile-read-position (point)
byte-compile-last-position byte-compile-read-position)
- (let ((form (read inbuffer))
- (warning (byte-run--unescaped-character-literals-warning)))
+ (let* ((lread--unescaped-character-literals nil)
+ (form (read inbuffer))
+ (warning (byte-run--unescaped-character-literals-warning)))
(when warning (byte-compile-warn "%s" warning))
(byte-compile-toplevel-file-form form)))
;; Compile pending forms at end of file.
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index f45c9209c1..83162d250f 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -559,19 +559,25 @@ (ert-deftest bytecomp-tests--unescaped-char-literals ()
"Check that byte compiling warns about unescaped character
literals (Bug#20852)."
(should (boundp 'lread--unescaped-character-literals))
- (bytecomp-tests--with-temp-file source
- (write-region "(list ?) ?( ?; ?\" ?[ ?])" nil source)
- (bytecomp-tests--with-temp-file destination
- (let* ((byte-compile-dest-file-function (lambda (_) destination))
- (byte-compile-error-on-warn t)
- (byte-compile-debug t)
- (err (should-error (byte-compile-file source))))
- (should (equal (cdr err)
- (list (concat "unescaped character literals "
- "`?\"', `?(', `?)', `?;', `?[', `?]' "
- "detected, "
- "`?\\\"', `?\\(', `?\\)', `?\\;', `?\\[', "
- "`?\\]' expected!"))))))))
+ (let ((byte-compile-error-on-warn t)
+ (byte-compile-debug t))
+ (bytecomp-tests--with-temp-file source
+ (write-region "(list ?) ?( ?; ?\" ?[ ?])" nil source)
+ (bytecomp-tests--with-temp-file destination
+ (let* ((byte-compile-dest-file-function (lambda (_) destination))
+ (err (should-error (byte-compile-file source))))
+ (should (equal (cdr err)
+ `(,(concat "unescaped character literals "
+ "`?\"', `?(', `?)', `?;', `?[', `?]' "
+ "detected, "
+ "`?\\\"', `?\\(', `?\\)', `?\\;', `?\\[', "
+ "`?\\]' expected!")))))))
+ ;; But don't warn in subsequent compilations (Bug#36068).
+ (bytecomp-tests--with-temp-file source
+ (write-region "(list 1 2 3)" nil source)
+ (bytecomp-tests--with-temp-file destination
+ (let ((byte-compile-dest-file-function (lambda (_) destination)))
+ (should (byte-compile-file source)))))))
(ert-deftest bytecomp-tests--old-style-backquotes ()
"Check that byte compiling warns about old-style backquotes."
--
2.11.0
Added tag(s) patch.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Wed, 05 Jun 2019 01:31:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36068
; Package
emacs
.
(Mon, 10 Jun 2019 22:42:02 GMT)
Full text and
rfc822 format available.
Message #39 received at 36068 <at> debbugs.gnu.org (full text, mbox):
tags 36068 fixed
close 36068
quit
>> Even byte-compiling a file containing such an unescaped literal sets
>> lread--unescaped-character-literals in the global scope. I think this
>> is where the real bug is.
>
> Yes, agreed. Here's a patch.
Pushed to master.
0026d0bf9f 2019-06-10T18:27:22-04:00 "Don't keep warning about unescaped literals (Bug#36068)"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0026d0bf9f4e4e0247de9c1eb885507608378266
Added tag(s) fixed.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Mon, 10 Jun 2019 22:42:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
36068 <at> debbugs.gnu.org and Michael Heerdegen <michael_heerdegen <at> web.de>
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Mon, 10 Jun 2019 22:42: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
.
(Tue, 09 Jul 2019 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 348 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.