From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: [PATCH 2/2] Improve error message for old-style backquotes Date: Fri, 29 Dec 2017 21:59:29 +0100 Message-ID: <20171229205929.23584-2-phst@google.com> References: <20171229205929.23584-1-phst@google.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1514581081 623 195.159.176.226 (29 Dec 2017 20:58:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 29 Dec 2017 20:58:01 +0000 (UTC) Cc: Philipp Stephani To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 29 21:57:57 2017 Return-path: Envelope-to: ged-emacs-devel@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 1eV1j3-0008C1-6c for ged-emacs-devel@m.gmane.org; Fri, 29 Dec 2017 21:57:57 +0100 Original-Received: from localhost ([::1]:54624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eV1l1-0007p2-KQ for ged-emacs-devel@m.gmane.org; Fri, 29 Dec 2017 15:59:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eV1ks-0007oI-4r for emacs-devel@gnu.org; Fri, 29 Dec 2017 15:59:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eV1kr-0006rw-Aj for emacs-devel@gnu.org; Fri, 29 Dec 2017 15:59:50 -0500 Original-Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:34012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eV1kr-0006qc-46 for emacs-devel@gnu.org; Fri, 29 Dec 2017 15:59:49 -0500 Original-Received: by mail-wr0-x236.google.com with SMTP id 36so9182572wrh.1 for ; Fri, 29 Dec 2017 12:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=POalcx7LrgO5JVb3Ipyv4YE7mcfRe5lsztyLwt6ze80=; b=AzH4q5VQZWRkr+fo4o4OzknkGYUdD+yV4ubRy9BaDtjZ7/9183VEmlosvSk/0T7CQ4 dwcC2Q/BxhiKWPirdE6TB891KLuMJleiX7XhPK60ZFRS3VSXFg2X6n0Pql0EB46fleAx jWbuuwQDfIk9GQwWw46Lq9iLEp9C/HZMU2/PMWi2GP9d3SG2l7Snu9JNUJa8HQwVyqnl PO539Djq5RGJfdgkPubpNaLHcMbKmyWDd6pWJZMy1z8A2tkqBrIn1hq0ULKgvAsWwi7l DiQT8+s44/RxIJFVcZAs+NtMBx9CLj4aKViXsvFkU60MgzUIwplsTSWj4pxOdxZVcqqt c21A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=POalcx7LrgO5JVb3Ipyv4YE7mcfRe5lsztyLwt6ze80=; b=VELsnoz3Tl/2gpPeNitqdce4nqCqHnphGkZhDHJo7uEVuqbEs+Z40hRorfEhTlHdvP PCUUdBjafp0e6Yx0Xdn9Gu8kEj1ZkaiFQewjOgkI5n6k3U9xwqcjQQkqLDNl6U4rz5TS cXOiSekjjD6fOZq5DcgGh4IQoR7CkWCheuq9y7C76/8wKqXqfmgBPvCKUVJqq1pv2Ztj Co29hKGXyRxOJQWU7xz1ELj7C07yRmfVtt8+Vm+7xxddM1Pfr7sO3Idei5x2HPp36SmH pt3q5a6y5pVAQooqlWxzzfN6jz7+qXfh1M68hVdwNkJq4+fuhJDySFiipIIqMfHqWqwi wPbQ== X-Gm-Message-State: AKGB3mJxc17TfgQqbkRi4jxWpiI7Z1kLueQ355TpWwvgY3FykEBtBoXp D3MX4S6icq7ahH9Tfshb0tQ5NPur X-Google-Smtp-Source: ACJfBovjv38mIqxdmxDJTFN9HTu0rZFMItOm+Ek/ci9vHKMssD97kk9enHYebexX49wG8GwXDgL0Pw== X-Received: by 10.223.162.139 with SMTP id s11mr17281613wra.231.1514581187778; Fri, 29 Dec 2017 12:59:47 -0800 (PST) Original-Received: from p.fritz.box (p5B13F874.dip0.t-ipconnect.de. [91.19.248.116]) by smtp.gmail.com with ESMTPSA id b8sm10009766wma.2.2017.12.29.12.59.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 12:59:47 -0800 (PST) X-Google-Original-From: Philipp Stephani X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171229205929.23584-1-phst@google.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221460 Archived-At: * src/lread.c (load_error_old_style_backquotes): Improve error message if no file is being loaded. * test/src/lread-tests.el (lread-tests--force-new-style-backquotes): Adapt test. --- src/lread.c | 12 ++++++++++-- test/src/lread-tests.el | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lread.c b/src/lread.c index 57cb0a5e48..5f8c85e769 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1006,8 +1006,16 @@ load_error_handler (Lisp_Object data) static _Noreturn void load_error_old_style_backquotes (void) { - AUTO_STRING (format, "Loading `%s': old-style backquotes detected!"); - xsignal1 (Qerror, CALLN (Fformat_message, format, Vload_file_name)); + if (NILP (Vload_file_name)) + { + AUTO_STRING (message, "Old-style backquotes detected!"); + xsignal1 (Qerror, message); + } + else + { + AUTO_STRING (format, "Loading `%s': old-style backquotes detected!"); + xsignal1 (Qerror, CALLN (Fformat_message, format, Vload_file_name)); + } } static void diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 4dfed13be7..2ac3cdb2f0 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el @@ -183,8 +183,7 @@ lread-tests--last-message (ert-deftest lread-tests--force-new-style-backquotes () (let ((data (should-error (read "(` (a b))")))) - (should (equal (cdr data) - '("Loading `nil': old-style backquotes detected!")))) + (should (equal (cdr data) '("Old-style backquotes detected!")))) (should (equal (let ((force-new-style-backquotes t)) (read "(` (a b))")) '(`(a b))))) -- 2.15.1