From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#36970: 26.2; invalid-read-syntax could print the location of the error Date: Mon, 01 Feb 2021 17:10:30 +0100 Message-ID: <87mtwnojk9.fsf@gnus.org> References: <87tuqyx3ki.fsf@gnus.org> <87wnvttqlo.fsf@gnus.org> <831re1887h.fsf@gnu.org> <87k0rsrxjs.fsf@gnus.org> <835z3b7ros.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20329"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacsuser@freemail.hu, 36970@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 01 17:11:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6bnG-0005C5-AB for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 17:11:14 +0100 Original-Received: from localhost ([::1]:40530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6bnF-00083I-B0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 11:11:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bn4-0007yd-Tn for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 11:11:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6bn4-0001Hj-Ee for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 11:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l6bn4-0008R6-9u for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 11:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Feb 2021 16:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36970 X-GNU-PR-Package: emacs Original-Received: via spool by 36970-submit@debbugs.gnu.org id=B36970.161219584832393 (code B ref 36970); Mon, 01 Feb 2021 16:11:02 +0000 Original-Received: (at 36970) by debbugs.gnu.org; 1 Feb 2021 16:10:48 +0000 Original-Received: from localhost ([127.0.0.1]:32945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6bmp-0008QO-MH for submit@debbugs.gnu.org; Mon, 01 Feb 2021 11:10:47 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:51082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6bmm-0008Q2-UO for 36970@debbugs.gnu.org; Mon, 01 Feb 2021 11:10:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HAj1uJpsXQoJhyxoJFni32bg8/Xjc+bzzZESPbFi8Sk=; b=gEJd9MM1VOsCwpIDtFGcARi91e X9jiVGcnKFGelK1mdB0QE5ngNYznMLIS+E4g/R19F/X9vgFufdldtwUv+dgqN5rRU8b8v9bYplIQh B5XDk7uymT3gKu93twGonpKdrmUy/8+dg5f+v5EcA2gmF1Af0P3DcTbGlr/vt1ZW2Qzc=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6bmb-0002J1-2h; Mon, 01 Feb 2021 17:10:38 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUjJicfICIdHiBO SkOnjIH////lxkJsAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UCARAEKAXe2hoAAAGaSURBVDjLbVSL ccMgDJVCB5BIBwhkAa54gN7F+89UfTHJlUtsx4+nJz2JAGwLeS0AArlRQhvQ7E6frG0Pg/5Mlt3I OIRbOHJA6MjP45jny0OhAb4JypxjDl6S8mqAPJVxKTdORgQng5pzVq4hjleO5KnQe41AHLs+il8F qpzHciwAlGLgFiJk30uqDIKUk09bscoSqURLqzb6voFSKBXVKa691WNa9RQ5IutD7/w4z/M3S1Rq QyX0WgQYYY0C1EkJAsDx8jq82kc1oPF9XgAZYNrMz3nObLteHzdVr9JamAZIj83nhj28Kk6gYAiQ Jc0RocyaBjElWBLw1ah6LxEKvAGcwN4tB7plZX3YAGlStb0LII/J1efiYiCZy1yts0g2lz53YMNX Td0apGH0XUn3u0ZCGyYYuKaeFOBQkiSAVu9zICSBClkLXUdKHcZ/AQuyAcusHNHFMEAGovfHmCm+ JvE+pq1I6TrOX6euOREth3WcZUqKMX7UmphdNV6ntDU1K2o0wJseFVOeBuZ1UtVApGXV9pcDpaAp wB+vEjoP0NtPFgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wMi0wMVQxNjowNDozOSswMDowMO5+ SbMAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDItMDFUMTY6MDQ6MzkrMDA6MDCfI/EPAAAAAElF TkSuQmCC X-Now-Playing: Laurel Halo's _DJ Kicks_: "(untitled)" In-Reply-To: <835z3b7ros.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Feb 2021 17:06:59 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199087 Archived-At: Eli Zaretskii writes: > Yes (and make it non-static). Alternatively, define a wrapper for it > that doesn't accept that last arg, and make _that_ wrapper extern and > more suitably named. Yup. I've made the wrapper even simpler, and dropped the count, too. >> (It's kinda surprising that no other part of Emacs has felt the need >> to compute a line number before...) > > Emacs almost never counts lines, except for 2 display features: the > line-number display in the mode line and display-line-numbers-mode. > The buffer-with-gap paradigm makes a point of not knowing where each > line ends and how many lines are there. Emacs almost never counts lines while running normally, but line numbers are useful when reporting errors (like here), so I was surprised not to find a convenient function to use. On the other hand, perhaps this explains why errors like these didn't use to report lines. :-) Anyway, I'm running some more tests, and then I'll push the change. The error message could be improved: It's CALLN (Fformat, build_string ("%s (line %d, column %d)"), which looks a bit awkward -- feel free to tweak, everybody. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no