From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 31676-done@debbugs.gnu.org
Subject: bug#31676: 27.0.50; More helpful error message for unescaped character literals
Date: Fri, 19 Apr 2019 19:22:03 +0200 [thread overview]
Message-ID: <CAArVCkSyPJbt8s0NCkYhDMuEyb5JVnjBh7vL0OeMo0SNxJjmsQ@mail.gmail.com> (raw)
In-Reply-To: <CAArVCkT3pU1m_TFR4Ka4K_xS0EjynbT=PMoiMd3tLqsnx7BUBg@mail.gmail.com>
Am Sa., 9. Juni 2018 um 19:12 Uhr schrieb Philipp Stephani
<p.stephani2@gmail.com>:
>
>
>
> Eli Zaretskii <eliz@gnu.org> schrieb am Fr., 8. Juni 2018 um 16:51 Uhr:
>>
>> > Date: Sat, 2 Jun 2018 12:00:26 +0200
>> > Cc: 31676@debbugs.gnu.org
>> >
>> > Sounds reasonable, here's a patch.
>> >
>> > From 4bd8348753980be95dc4bcba47e52f7f79255fb6 Mon Sep 17 00:00:00 2001
>> > From: Philipp Stephani <phst@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.
prev parent reply other threads:[~2019-04-19 17:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-01 10:18 bug#31676: 27.0.50; More helpful error message for unescaped character literals Lars Ingebrigtsen
2018-06-02 10:00 ` Philipp Stephani
2018-06-08 14:51 ` Eli Zaretskii
2018-06-09 17:12 ` Philipp Stephani
2018-06-09 17:31 ` Eli Zaretskii
2019-04-19 9:54 ` Philipp Stephani
2019-04-19 11:43 ` Noam Postavsky
2019-04-19 15:53 ` Philipp Stephani
2019-04-19 16:33 ` Philipp Stephani
2019-04-19 17:22 ` Philipp Stephani [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAArVCkSyPJbt8s0NCkYhDMuEyb5JVnjBh7vL0OeMo0SNxJjmsQ@mail.gmail.com \
--to=p.stephani2@gmail.com \
--cc=31676-done@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).