From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#31676: 27.0.50; More helpful error message for unescaped character literals Date: Sat, 9 Jun 2018 19:12:30 +0200 Message-ID: References: <837en9uyaq.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d09535056e389f5b" X-Trace: blaine.gmane.org 1528564270 4378 195.159.176.226 (9 Jun 2018 17:11:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Jun 2018 17:11:10 +0000 (UTC) Cc: larsi@gnus.org, 31676@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 09 19:11:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fRhOL-00013h-O2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jun 2018 19:11:06 +0200 Original-Received: from localhost ([::1]:41039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRhQS-0002H5-EA for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jun 2018 13:13:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRhQI-0002Gm-Pf for bug-gnu-emacs@gnu.org; Sat, 09 Jun 2018 13:13:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRhQE-0001ov-MT for bug-gnu-emacs@gnu.org; Sat, 09 Jun 2018 13:13:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRhQE-0001ok-I3 for bug-gnu-emacs@gnu.org; Sat, 09 Jun 2018 13:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fRhQE-0001nK-4C for bug-gnu-emacs@gnu.org; Sat, 09 Jun 2018 13:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jun 2018 17:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31676 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31676-submit@debbugs.gnu.org id=B31676.15285643706875 (code B ref 31676); Sat, 09 Jun 2018 17:13:02 +0000 Original-Received: (at 31676) by debbugs.gnu.org; 9 Jun 2018 17:12:50 +0000 Original-Received: from localhost ([127.0.0.1]:41487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fRhQ1-0001mp-VA for submit@debbugs.gnu.org; Sat, 09 Jun 2018 13:12:50 -0400 Original-Received: from mail-ot0-f174.google.com ([74.125.82.174]:45395) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fRhQ1-0001md-2W for 31676@debbugs.gnu.org; Sat, 09 Jun 2018 13:12:49 -0400 Original-Received: by mail-ot0-f174.google.com with SMTP id a5-v6so19261254otf.12 for <31676@debbugs.gnu.org>; Sat, 09 Jun 2018 10:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9wnwGIx4WK/4n4KDmaZaH51ipf6v/7zg7861vqzY9XU=; b=EW5roK9lx6zQbE1Sv0lQSJrvIcXmhOdJPCwPh+BOAB/JDYSKRPPQuTmLL5zcT1IZP9 NrZJkYSCSKqrpWlWkUbXDmopRL76vW5dYbFHlmptJIFNz0FHAzaTiKC14gAYMYuD5TWp yt5ZuAeddmbe2CLpHlllWVef6bs3A/ZAgHohTVx/6wDo+tPek/1iCXLwDlVuQGSbPBaW qnyK+fFd1ueuGJMyoTImoHnHJeH0SQliEHZUOvXXLWI9EAQleEWgq41cEGjsBTfJ43Ue mS1N919dvMWZ//RHjoXhUQLVfIg92ULmC7od2JLHZW9ezwzfEf9SRA3MNZVZaA2GaGpb xkbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9wnwGIx4WK/4n4KDmaZaH51ipf6v/7zg7861vqzY9XU=; b=H1hi1GKu+QlBSAY4E9NI3C1y/GlfFIrX2Xe8fUCT0Nz54VDyjE8Y3ohtqimCDym4U2 jO9buYBJvGr+jXgkoZ7dMmJxyslqefsVPnzaA+se8/6mReUo356w3tYAQlTTpHF+K5lA ktB+JdMZyaLbMKv+eArZieTtYjnyruqEHXQLt1xh+xpPoWY0ge0hjMAbjgoGh13a5XB8 3GwkHtuEw0ngwSy9HfVJMOJFE2+m8d7zL0exs4MpNSzCoFp/zi2RlclgrrXLswIoPA4d /tcloZGSQ4euFo1I/bBithHYnPa9RvjcHQAHriey0Ovgoj1M5PKqYprXTtacxWrAn3MP qo/Q== X-Gm-Message-State: APt69E0ueatxCzxUDs62oIPhVjw31g34kF5jUbXq87kp8cdLPrXLdv0g CyvHVmIfAGGg7ugNgEu6m/UytUehtOwjVjm9E9s= X-Google-Smtp-Source: ADUXVKJyZ8vxxHSjf5xfpq8f4zOtAu+MvMFaqA3DZ8Zb0gaWY4DAmdaDfYYgeZDpSj36PL2eaL4x1yj+T3fZw0r5RNU= X-Received: by 2002:a9d:282e:: with SMTP id m43-v6mr6737318otb.393.1528564362022; Sat, 09 Jun 2018 10:12:42 -0700 (PDT) In-Reply-To: <837en9uyaq.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147247 Archived-At: --000000000000d09535056e389f5b Content-Type: text/plain; charset="UTF-8" Eli Zaretskii 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 > > 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). --000000000000d09535056e389f5b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Fr., 8. Juni 2018 um 16:51=C2=A0Uhr:
> Date: Sat, 2 Jun 2018 12:00:26 +0200
> Cc: 31676@d= ebbugs.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.=C2=A0 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?=C2=A0 If that's because you n= eed
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.=C2=A0 AFAICT, the C implementation is just=
a "transliteration" of straightforward Lisp code, so it reads str= ange.

The function uses an uninterned v= ariable, so it has to be in C. I think that's slightly better than inte= rning the variable and having some Lisp function access it (the latter woul= d have one additional internal symbol).=C2=A0
--000000000000d09535056e389f5b--