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 09:40:07 +0100 Message-ID: <87k0rsrxjs.fsf@gnus.org> References: <87tuqyx3ki.fsf@gnus.org> <87wnvttqlo.fsf@gnus.org> <831re1887h.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="30835"; 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 09:41:17 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 1l6Ulo-0007wP-Tv for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 09:41:16 +0100 Original-Received: from localhost ([::1]:58580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6Uln-00077G-P6 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 03:41:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6Ula-00076x-8p for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 03:41:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6Ula-0008CL-1B for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 03:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l6UlZ-00008k-Uk for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 03:41:01 -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 08:41:01 +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.1612168823485 (code B ref 36970); Mon, 01 Feb 2021 08:41:01 +0000 Original-Received: (at 36970) by debbugs.gnu.org; 1 Feb 2021 08:40:23 +0000 Original-Received: from localhost ([127.0.0.1]:58685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6Ukx-00007l-Dv for submit@debbugs.gnu.org; Mon, 01 Feb 2021 03:40:23 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:46086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6Uks-00007R-Mc for 36970@debbugs.gnu.org; Mon, 01 Feb 2021 03:40:21 -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=E2tzswJiGQx6rkLzQXGefwYpjO3CmHeqqTcuQP+tzXY=; b=mDeIjZqBnO/4cbicuiuwOw60lM ytaXgTQBWDEkhwsrcR0qUdjyYG1im+h2LbkKMHycy3eKJ/oQbiSxzlud4WZvWnIEP5giBgRAsNIXf mIFlnGver0XJt+1Ge0bNuPfWjbuWQqVI4J5dHmDmegMD284U7NfP72LDjyIbbKd2lf0o=; 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 1l6Ukj-000798-3E; Mon, 01 Feb 2021 09:40:11 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUKCAYtJx9fWEqK gHKzp5v////iIdWkAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UCAQggE1cIIFAAAAGhSURBVDjLlVOB kdwwCAQnBQBuwEIpICe5gf9T/zVlkeSzLslnJjvjmzMLywojItaBXEvSC0JA/PFkVtzBxKtoxMmY xIq61woKAVbvFYYnF0gFCgrM6wFatiQW6QOl/0QFm4tafcPRe6gTJ1SUfMXPQRCHk+g89c72GHGD 3ThGRk17nrU1GRV2sNvM7fikSaSUDzRoF+qoYPZQOdtNTFe0v0Qm8XO6qosM8NRpl1Z9hJUu7KvS B93gtQDv2yVF25uSmrxKUjrbs/lZ+2c8aOmC0IMjByM7LJfr8DB26H7iQ8newstVIs5CmlsrMhre alaLy/6sic5JzJVwz/XB8Vm3/OxEbxlNkEya/KBNvGeHeHwmi90RjgDtrw7HJjiO8Dwcj1+l79hD x56xy+0Hu0Vb4b6xnGipAL7NxPeKNcPeCf4t7ybsr1GZS9HvyiKs97AADc+aF4J/BFEwDU68LwSR D2BEcZuEtc8LjxluE7SUeZWCNfMMOdxN9gjrZcEZlxclqiAwojEeuMkwy90w39vIKn8OqhfoZL8G /4Pkr0ml/8YvoI5XsdQ7Bh8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMDItMDFUMDg6MzI6MTkr MDA6MDBfTrVOAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTAyLTAxVDA4OjMyOjE5KzAwOjAwLhMN 8gAAAABJRU5ErkJggg== X-Now-Playing: Normil Hawaiians's _What's Going On?_: "Martin" In-Reply-To: <831re1887h.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 31 Jan 2021 16:57:54 +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:199054 Archived-At: Eli Zaretskii writes: >> And... I'm slightly nervous about calling out to something as >> complicated as Fcount_lines. > > What is Fcount_lines? Sorry, I meant `count-lines'. >> So I was poking through the Emacs lisp code to see whether there's any >> function that will just tell me what line I'm on, and there's... >> display_count_lines in xdisp.c, but that doesn't really seem like a good >> fit, since that's in redisplay, and not lread.c context. > > Can you tell why did you think display_count_lines will not do the job > you need it to do? Because it's only used in xdisp.c, and I was guessing there was some reason for that, and: Set *BYTE_POS_PTR to the byte position where we stopped. This is either the position COUNT lines after/before START_BYTE, if we found COUNT lines, or LIMIT_BYTE if we hit the limit before finding COUNT lines. */ So from the comments it seemed like this had some other, more complex use case. But I see from the actual call sites that it looks just like what I need: 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? (It's kinda surprising that no other part of Emacs has felt the need to compute a line number before...) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no