GNU bug report logs -
#31676
27.0.50; More helpful error message for unescaped character literals
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Fri, 1 Jun 2018 10:19:01 UTC
Severity: wishlist
Found in version 27.0.50
Done: Philipp Stephani <p.stephani2 <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Fri, 19 Apr 2019 19:22:03 +0200
with message-id <CAArVCkSyPJbt8s0NCkYhDMuEyb5JVnjBh7vL0OeMo0SNxJjmsQ <at> mail.gmail.com>
and subject line Re: bug#31676: 27.0.50; More helpful error message for unescaped character literals
has caused the debbugs.gnu.org bug report #31676,
regarding 27.0.50; More helpful error message for unescaped character literals
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
31676: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31676
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
A reddit user noted these messages popping up when starting Emacs
Loading ‘~/.emacs.d/init’: unescaped character literals `?[', `?]' detected!
and wondered what to do about it. Perhaps it would be a good idea to
just say something like
unescaped character literals `?[', `?]' detected, `?\[', `?\]' expected
or something along those lines? For Emacs 26.2.
In GNU Emacs 27.0.50 (build 20, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
of 2018-05-19 built on stories
Repository revision: f4d9fd3dd45f767eca33fbf1beee40da790fa74e
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
[Message part 3 (message/rfc822, inline)]
Am Sa., 9. Juni 2018 um 19:12 Uhr schrieb Philipp Stephani
<p.stephani2 <at> gmail.com>:
>
>
>
> Eli Zaretskii <eliz <at> gnu.org> schrieb am Fr., 8. Juni 2018 um 16:51 Uhr:
>>
>> > Date: Sat, 2 Jun 2018 12:00:26 +0200
>> > Cc: 31676 <at> debbugs.gnu.org
>> >
>> > Sounds reasonable, here's a patch.
>> >
>> > From 4bd8348753980be95dc4bcba47e52f7f79255fb6 Mon Sep 17 00:00:00 2001
>> > From: Philipp Stephani <phst <at> google.com>
>> > Date: Sat, 2 Jun 2018 11:59:02 +0200
>> > Subject: [PATCH] Make warning about unescaped character literals more helpful.
>> >
>> > See Bug#31676.
>> >
>> > * src/lread.c (Flread_unescaped_character_literals_warning): New
>> > defun.
>> > (load_warn_unescaped_character_literals): Use it.
>> > (syms_of_lread): Define new defun. Unintern internal
>> > variable, which is not used any more outside of lread.c
>> >
>> > * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Use new
>> > defun.
>> >
>> > * test/src/lread-tests.el (lread-tests--unescaped-char-literals):
>> > test/lisp/emacs-lisp/bytecomp-tests.el
>> > (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
>>
>> Sounds okay, but can you tell why you implemented
>> lread--unescaped-character-literals in C? If that's because you need
>> to call it from load_warn_unescaped_character_literals, then C
>> functions can call Lisp functions with no problems, we have several
>> examples of that in the sources. AFAICT, the C implementation is just
>> a "transliteration" of straightforward Lisp code, so it reads strange.
>
>
> The function uses an uninterned variable, so it has to be in C. I think that's slightly better than interning the variable and having some Lisp function access it (the latter would have one additional internal symbol).
However, your point about the C function being strange is valid. I've
reimplemented it in Lisp now and pushed commit 0b4b380ce4 to master.
This bug report was last modified 6 years and 91 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.