From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Thoughts on getting correct line numbers in the byte compiler's warning messages Date: Thu, 8 Nov 2018 22:13:11 +0000 Message-ID: <20181108221311.GD5041@ACM> References: <20181105105302.GA10520@ACM> <20181106151143.GB4030@ACM> <20181107170036.GA4934@ACM> <20181107184708.GB4934@ACM> <20181108140843.GB5041@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1541715198 15331 195.159.176.226 (8 Nov 2018 22:13:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Nov 2018 22:13:18 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 08 23:13:14 2018 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 1gKsY6-0003ta-DS for ged-emacs-devel@m.gmane.org; Thu, 08 Nov 2018 23:13:14 +0100 Original-Received: from localhost ([::1]:59259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKsaC-0002VB-Vv for ged-emacs-devel@m.gmane.org; Thu, 08 Nov 2018 17:15:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKsZe-0002Uo-ML for emacs-devel@gnu.org; Thu, 08 Nov 2018 17:14:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKsZb-0007G6-Es for emacs-devel@gnu.org; Thu, 08 Nov 2018 17:14:50 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:15699 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1gKsZb-0006WN-0a for emacs-devel@gnu.org; Thu, 08 Nov 2018 17:14:47 -0500 Original-Received: (qmail 27330 invoked by uid 3782); 8 Nov 2018 22:14:19 -0000 Original-Received: from acm.muc.de (p5B147A20.dip0.t-ipconnect.de [91.20.122.32]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 08 Nov 2018 23:14:18 +0100 Original-Received: (qmail 11388 invoked by uid 1000); 8 Nov 2018 22:13:11 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:231060 Archived-At: Hello, Stefan. On Thu, Nov 08, 2018 at 12:02:01 -0500, Stefan Monnier wrote: > >> >> It's "only" the cconv-convert part of cconv.el that will need changes, > >> >> but yes, one way or another it will need to be changed to preserve the > >> >> location info. > >> > OK. But it's still a challenging job. > >> I wouldn't call it challenging: the changes are orthogonal to the actual > >> working of cconv, so it will likely make the code messier but > >> conceptually there's no significant difficulty. I'm familiar with the > >> code and will be happy to help. > > Thanks! By the way, am I right in thinking that pcase does its > > comparisons using equal? > "as if by `equal`", so when comparing against symbols we actually use `eq`. ... at the moment ... ;-) equal actually tests EQ right near its start anyway, so it shouldn't be a big deal for pcase actually to use equal. Or am I missing something? > > One thing we'd need to watch out for is using equal, not eq, when we > > compare symbols. (eq 'foo #) will surely > > be nil, but (equal ....) would be t. Same with member and memq. > Indeed. > > We'd also need to make sure that the reader's enabling flag for creating > > these extended symbols is bound to nil whenever we suspend the byte > > compiler to do something else (edebug, for example). > Rather than a dynamically-scoped var, it might be a better option to > either use a new function `read-with-positions`, or else use an > additional argument to `read`. OK. I've hacked together some basic infrastructure in alloc.c, lread.c, print.c, and lisp.h. I can now read a small test file and get back the form with "located symbols". I've called the new function which does this read-locating-symbols, but that might want to change. As soon as I've sorted out SYMBOLP and XSYMBOL, I'll create a new branch under /scratch, commit what I've got, and then we can play with it. > Stefan -- Alan Mackenzie (Nuremberg, Germany).