From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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:06:59 +0200 Message-ID: <835z3b7ros.fsf@gnu.org> References: <87tuqyx3ki.fsf@gnus.org> <87wnvttqlo.fsf@gnus.org> <831re1887h.fsf@gnu.org> <87k0rsrxjs.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6866"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacsuser@freemail.hu, 36970@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 01 16:09:08 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 1l6apA-0001gQ-G9 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 16:09:08 +0100 Original-Received: from localhost ([::1]:41922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6ap9-0003gU-HD for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 10:09:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6an8-0001Fl-S2 for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 10:07:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6an8-0005dm-Jp for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 10:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l6an8-0006ld-CR for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 10:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Feb 2021 15:07: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.161219201826003 (code B ref 36970); Mon, 01 Feb 2021 15:07:02 +0000 Original-Received: (at 36970) by debbugs.gnu.org; 1 Feb 2021 15:06:58 +0000 Original-Received: from localhost ([127.0.0.1]:32864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6an4-0006lK-6i for submit@debbugs.gnu.org; Mon, 01 Feb 2021 10:06:58 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6an2-0006l5-NP for 36970@debbugs.gnu.org; Mon, 01 Feb 2021 10:06:57 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53717) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6amw-0005Zw-Lx; Mon, 01 Feb 2021 10:06:50 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1912 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l6amf-0002gb-PB; Mon, 01 Feb 2021 10:06:35 -0500 In-Reply-To: <87k0rsrxjs.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 01 Feb 2021 09:40:07 +0100) 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:199083 Archived-At: > From: Lars Ingebrigtsen > Cc: emacsuser@freemail.hu, 36970@debbugs.gnu.org > Date: Mon, 01 Feb 2021 09:40:07 +0100 > > nlines = display_count_lines (startpos_byte, > PT_BYTE, PT, &junk); > > So I guess I should just put the prototype in lisp.h and use it? 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. > (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.