From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Perry E. Metzger" Newsgroups: gmane.emacs.devel Subject: Re: Emacs contributions, C and Lisp Date: Tue, 6 Jan 2015 15:45:39 -0500 Message-ID: <20150106154539.3d0752c4@jabberwock.cb.piermont.com> References: <83bnxuzyl4.fsf@gnu.org> <874n3ke1qn.fsf@engster.org> <87sir336qn.fsf@fencepost.gnu.org> <20140301215057.GA19461@thyrsus.com> <87fvn1y0vx.fsf@fencepost.gnu.org> <87fvn0senq.fsf@uwakimon.sk.tsukuba.ac.jp> <8761nusb90.fsf@uwakimon.sk.tsukuba.ac.jp> <87vbkovhh7.fsf@engster.org> <87387rvobr.fsf@engster.org> <83ppat84hk.fsf@gnu.org> <20150106143933.0090bc83@jabberwock.cb.piermont.com> <83r3v77ij6.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1420577191 26732 80.91.229.3 (6 Jan 2015 20:46:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Jan 2015 20:46:31 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, deng@randomsample.de, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 06 21:46:24 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y8b0t-00036C-Sa for ged-emacs-devel@m.gmane.org; Tue, 06 Jan 2015 21:46:04 +0100 Original-Received: from localhost ([::1]:38190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8b0t-0000Eu-Da for ged-emacs-devel@m.gmane.org; Tue, 06 Jan 2015 15:46:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8b0a-0000CH-VN for emacs-devel@gnu.org; Tue, 06 Jan 2015 15:45:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8b0a-0003mp-2g for emacs-devel@gnu.org; Tue, 06 Jan 2015 15:45:44 -0500 Original-Received: from hacklheber.piermont.com ([2001:470:30:84:e276:63ff:fe62:3400]:37052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8b0Y-0003lR-Cc; Tue, 06 Jan 2015 15:45:42 -0500 Original-Received: from snark.cb.piermont.com (localhost [127.0.0.1]) by hacklheber.piermont.com (Postfix) with ESMTP id 675CD24B; Tue, 6 Jan 2015 15:45:41 -0500 (EST) Original-Received: from jabberwock.cb.piermont.com (jabberwock.cb.piermont.com [10.160.2.107]) by snark.cb.piermont.com (Postfix) with ESMTP id 422532DE9B1; Tue, 6 Jan 2015 15:45:41 -0500 (EST) In-Reply-To: <83r3v77ij6.fsf@gnu.org> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.25; x86_64-apple-darwin14.0.0) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:470:30:84:e276:63ff:fe62:3400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181015 Archived-At: On Tue, 06 Jan 2015 22:37:01 +0200 Eli Zaretskii wrote: > > Date: Tue, 6 Jan 2015 14:39:33 -0500 > > From: "Perry E. Metzger" > > Cc: Eli Zaretskii , monnier@iro.umontreal.ca, > > deng@randomsample.de, emacs-devel@gnu.org > > > > Say you want to do a global refactoring of a function that alters > > the parameters it takes -- the sort of thing modern IDEs do very > > well. > > Please also describe why the AST is needed for completion, which was > the original topic discussed here. Oh, well for C and C++, given that you can't know the scope of an identifier (or even what it is -- see the awful C typedef problem in parsing) without pretty good scope and symbol table info, I had thought that was obvious. If it isn't, I'm happy to explain in detail, but I had thought that Richard had written a bunch of the early GCC stuff himself and understood that. In a modern IDE, you can complete anything -- struct members or object member variables/functions, type names, etc., etc., and you need what are essentially compiler data structures to get that stuff, and you need the AST to understand the context in which you're requesting the completion. You can't even know that the variable "foo" is an object of class "baz" and thus that when you hit complete on foo.con that it should look for the members that start with "con" in objects of class "baz" (say "construct()" or some such). Perry -- Perry E. Metzger perry@piermont.com