From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!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: Fri, 19 Apr 2019 19:22:03 +0200 Message-ID: References: <837en9uyaq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="97330"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Lars Ingebrigtsen , 31676-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 19 19:23:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hHXEH-000PBO-Pr for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Apr 2019 19:23:13 +0200 Original-Received: from localhost ([127.0.0.1]:59284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHXEG-0001ZR-Rw for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Apr 2019 13:23:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHXE7-0001ZK-43 for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2019 13:23:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHXE6-0000kQ-2o for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2019 13:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59254) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHXE5-0000kK-VI for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2019 13:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hHXE5-0007i4-Ps for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2019 13:23:01 -0400 Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Apr 2019 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 31676 X-GNU-PR-Package: emacs Mail-Followup-To: 31676@debbugs.gnu.org, p.stephani2@gmail.com, larsi@gnus.org Original-Received: via spool by 31676-done@debbugs.gnu.org id=D31676.155569454329558 (code D ref 31676); Fri, 19 Apr 2019 17:23:01 +0000 Original-Received: (at 31676-done) by debbugs.gnu.org; 19 Apr 2019 17:22:23 +0000 Original-Received: from localhost ([127.0.0.1]:44565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHXDS-0007ge-QS for submit@debbugs.gnu.org; Fri, 19 Apr 2019 13:22:23 -0400 Original-Received: from mail-ot1-f47.google.com ([209.85.210.47]:39305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHXDQ-0007gP-Sd for 31676-done@debbugs.gnu.org; Fri, 19 Apr 2019 13:22:21 -0400 Original-Received: by mail-ot1-f47.google.com with SMTP id f10so4835271otb.6 for <31676-done@debbugs.gnu.org>; Fri, 19 Apr 2019 10:22:20 -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=b6GXKY8KX2iAAKD4+5rPNTbABxNceoB9gycCke5q4EY=; b=OkxfHi1z3n464W7A1UiTz8h2+DAHBOOQCjdl8mcu0zgjXHVGXpnrBcgSMVT1GBg220 /AyhyKyToFY6EkVQLw++WKCtQzeGgP9yQrpNLL2naK24Gf3dHF3nls46UtMBUR3gWe3v ZYu0hXD4BKiMuI4p43VRsiez3QmMbsgl2AfJ5ZiHDXa3mpm55DFfQfmsjJuQ3Fr788wY /qrXvXhg4cgYjXXPV8tanqe9Iage1D8eL4DJnwxoQSxecc7QywPosNy1sAXR7als+152 cLsEzJqMQs/2pQ1Dyp/PMnHZuWz57Ft/VwU9R+TviiJkWgTRpDuOmsPGsbllIHCSXjnz 50wA== 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=b6GXKY8KX2iAAKD4+5rPNTbABxNceoB9gycCke5q4EY=; b=lWolyWxCUlXKeWudEAVPp2QVCBKKV1/8f9S8YyUPjO8UfYvQzJzU0fo0pnKoB3ekkq lkUX+axh25ZRId0jUuLkLLYrmzKOHNYz75Npd+a9GgixeRboWaYahbsVBP5WS/emE0yU LnkfvvPBaC06xZix30Z0UX88IVjA1+Wp30FGgxP4D5oQsEhj9px/UXtsCnWBcdjUbrvp +AtQTHB8sygj8HrF+zCuPAMtnwAttFIgZY7fNRoWTKAv51sRK3tokxCWtWwRtK0bAI4m FrP+sFd86TuI0m7sKqlTgOgngXA3GsAv6RB6g+068n1wRffXSqKEZnuxLjem7xDv7Xcj nIUA== X-Gm-Message-State: APjAAAXlwDM7fiNaypF1tcMI7VkHf61sW3iOkU9G7tkEdClN8thBWRFi x5l5v55sbf+Ij8sSMt5ZPEcSMr5l74fuDX9zSu4= X-Google-Smtp-Source: APXvYqzdR0l0PGoSPaYBL5IKzqjR0ijdV92cVD5gyR7iW9rsIKOSBCF49gnbXwPuwiF56CtRcySjnLFWihDpd1QSUx8= X-Received: by 2002:a05:6830:15d2:: with SMTP id j18mr2680704otr.37.1555694534732; Fri, 19 Apr 2019 10:22:14 -0700 (PDT) In-Reply-To: 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: 209.51.188.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:157855 Archived-At: Am Sa., 9. Juni 2018 um 19:12 Uhr schrieb Philipp Stephani : > > > > 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). However, your point about the C function being strange is valid. I've reimplemented it in Lisp now and pushed commit 0b4b380ce4 to master.