From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Ludlam Newsgroups: gmane.emacs.devel Subject: Re: progmodes/project.el and search paths Date: Fri, 14 Aug 2015 20:48:03 -0400 Message-ID: <55CE8C43.7080804@gmail.com> References: <55BE209F.1000009@siege-engine.com> <55BE509B.2080307@yandex.ru> <55BEC1B5.6060204@gmail.com> <86twsgfiuc.fsf@stephe-leake.org> <87mvy2kjxa.fsf@esperi.org.uk> <86si7t11li.fsf@stephe-leake.org> <87lhdkzmdv.fsf@isaac.fritz.box> <86pp2wzcaa.fsf@stephe-leake.org> <877fp3z8i7.fsf@isaac.fritz.box> <86bnefyu0b.fsf@stephe-leake.org> <87k2t0yfz9.fsf@isaac.fritz.box> <86tws4wrar.fsf@stephe-leake.org> <87egj8y0wi.fsf@isaac.fritz.box> <87lhdf1k2a.fsf@esperi.org.uk> <55CC880C.4010008@yandex.ru> <55CDD66F.2080005@siege-engine.com> <55CE6C11.5070606@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1439599721 7240 80.91.229.3 (15 Aug 2015 00:48:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Aug 2015 00:48:41 +0000 (UTC) Cc: Stephen Leake , emacs-devel@gnu.org To: Dmitry Gutov , Eric Ludlam , Nix , David Engster Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 15 02:48: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 1ZQPe3-0003Q9-21 for ged-emacs-devel@m.gmane.org; Sat, 15 Aug 2015 02:48:23 +0200 Original-Received: from localhost ([::1]:48757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQPe2-0008CH-FE for ged-emacs-devel@m.gmane.org; Fri, 14 Aug 2015 20:48:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQPdp-0008C8-Da for emacs-devel@gnu.org; Fri, 14 Aug 2015 20:48:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQPdm-0001gw-6K for emacs-devel@gnu.org; Fri, 14 Aug 2015 20:48:09 -0400 Original-Received: from mail-vk0-x22e.google.com ([2607:f8b0:400c:c05::22e]:35050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQPdm-0001gq-0k for emacs-devel@gnu.org; Fri, 14 Aug 2015 20:48:06 -0400 Original-Received: by vkfi73 with SMTP id i73so36438901vkf.2 for ; Fri, 14 Aug 2015 17:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7QMHONxMjvYxZeCAuN2IB+iNi98XGU+DUSOvRAhioqw=; b=N+b5ksxoQQoXoFDVzLmRJHh9CE6RDSh2dzJsJYtco9A/l4Ui8acdpngBVZPhhhBh6w CllHotlYUgltVHz16cEhM9XSqPQnCRXzv4+hoV/PpjI5I00i6qV/lPxy+St8Zhciuk1D 1xO6KsQxZGW4w7RRriybBELqoGpKcyNasFZgSGWG/4InMxo6S/jhKMlG903E0soObz9M oJymS4ie/+/kSthBsA6RWZDk+5aUzWh3Cnkt0IB+7zScAmyp6g+Q0In7rUUXh9366XLU M0Scr8RDUNzg6czeLUhiSrFvENco/8+ub5T+JCIZ6ss0bVd/DZJbrkv8IuR1fvzWzMk9 lYoA== X-Received: by 10.52.170.106 with SMTP id al10mr19589265vdc.72.1439599685525; Fri, 14 Aug 2015 17:48:05 -0700 (PDT) Original-Received: from [192.168.1.202] (pool-71-184-198-118.bstnma.fios.verizon.net. [71.184.198.118]) by smtp.googlemail.com with ESMTPSA id r4sm1829601vdb.8.2015.08.14.17.48.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 17:48:04 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 In-Reply-To: <55CE6C11.5070606@yandex.ru> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c05::22e 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:188804 Archived-At: On 08/14/2015 06:30 PM, Dmitry Gutov wrote: > On 08/14/2015 02:52 PM, Eric Ludlam wrote: > >> 2) Parsers don't check types, etc as they go, and are flexible about the >> symbols they accept. >> >> This means you can get irrational tags. This is for a combination of >> handling incomplete code, speed (less to do) and because most folks just >> go an run their compiler at some point anyway. > > Doesn't that mean that code completion at the end of a chain of calls > can be inaccurate (with e.g. lots of false positives), even if code is > otherwise valid? While the parser generally ignores data types, it does record the declarations. When smart completion is invoked, only the types currently relevant are resolved in order to make the completions accurate. Thus: Parsing phase: Just record the data as declared, don't check. Completion phase: Look up data types as needed for symbols in the completion string. If point of fact, Semantic's tagging parser doesn't parse the bodies of functions, and just skips over them. The body is only parsed if a completion is needed since the symbols within are locally scoped and don't affect other tags. On a side note, I've had a lot of complaints that completion was too pedantic, and if it can't find a pedantic answer, perhaps it could let loose a little and find a vaguely close answer. >> >>> In summary; Semantic can extract useful data out of pretty badly >>> trashed >>> code, and track your changes while you edit in a robust way. >> >> It seems I stand corrected, thanks. However, it would be interesting >> to do a comparison on some real file, against a widely used compiler, >> such as Clang. >> That would be interesting. What would the goal be? There are lots of things Semantic doesn't do, nor was intended for. Like many Emacs tools, the Semantic parser is a bit liberal in the assumptions it makes to get a good enough answer. Eric