From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Ludlam Newsgroups: gmane.emacs.devel Subject: completion-at-point + semantic : erroneous error Date: Wed, 9 Oct 2019 22:33:44 -0400 Message-ID: <957ad127-0d84-69e3-49b6-9799975bd724@siege-engine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="191717"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 10 04:34:00 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIOH9-000niU-PX for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2019 04:33:59 +0200 Original-Received: from localhost ([::1]:33470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIOH8-0004QG-0Y for ged-emacs-devel@m.gmane.org; Wed, 09 Oct 2019 22:33:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54529) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIOGy-0004Q7-Sy for emacs-devel@gnu.org; Wed, 09 Oct 2019 22:33:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIOGx-00032c-P7 for emacs-devel@gnu.org; Wed, 09 Oct 2019 22:33:48 -0400 Original-Received: from mail-qk1-f174.google.com ([209.85.222.174]:35945) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iIOGx-00030w-LA for emacs-devel@gnu.org; Wed, 09 Oct 2019 22:33:47 -0400 Original-Received: by mail-qk1-f174.google.com with SMTP id y189so4221781qkc.3 for ; Wed, 09 Oct 2019 19:33:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=yvu/V+fc9ihxLHVnEKSDLFNv46bplYPqAtceqQggHuw=; b=FToz08d5L0Lxpzq0bgO32c4g3djyOZIUVXwX94zDW8q7LJboLHtKtrF/TgfM6UqQ5a Rh0/vG0+FyV/ts+wuE+e0VBpA2uzae+ChHPQNMDAL+oVtp902cVhalc8HN+0irQMQBoR ZrVEndqsn5t03V9XxV84N2y7xp7R+Y+btlDm6XqfevJqSXJrVIhoaaVFvyv8z9cY9R4h IPklr/FctIy/LptC5AdNSW7fOKrmFeOpNqERgzhI8KUB/S/3eq/PMZ+nObQMOjAThzKj g3nPn8nv9T2QG8/oNeNCYZxFQvf4nhlnQiY3CXG6NbY5wOPacA8HZ6VloW2XpPByPphI u3Qg== X-Gm-Message-State: APjAAAXDzMkdKfXSYCE/A/SrRlmJu/2uK2ntucJfBjr2jKy+M/RfMkjx /x8nQYLXfBEPnB+tbk0IJwc9hDEO1Es= X-Google-Smtp-Source: APXvYqykZlNkgvge6f5RMXwVWOeiD81IdluhJ8T2tGFOwKUBpnIuW48yo8+d7V2FbVMDZTk9pVedVQ== X-Received: by 2002:a37:7603:: with SMTP id r3mr6926532qkc.116.1570674825646; Wed, 09 Oct 2019 19:33:45 -0700 (PDT) Original-Received: from [192.168.1.202] (pool-108-20-30-136.bstnma.fios.verizon.net. [108.20.30.136]) by smtp.googlemail.com with ESMTPSA id 92sm1684855qte.30.2019.10.09.19.33.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Oct 2019 19:33:44 -0700 (PDT) Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.222.174 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:240810 Archived-At: Hi all, I'm updating from Emacs 24 w/ CEDET from sourceforge to Emacs from git, using built-in cedet, and I encountered an unexpected error. A simplified reproduction step is: emacs -q M-x semantic-mode ; visit a file supported by semantic, such as a C file ; put cursor in a blank space M-x completion-at-point It will error with: "Nothing to complete". The underlying completion function has always issued this error, but the way it was brought into completion-at-point causes it to error mid way. I'm not completely familiar with completion-at-point behavior, but my assumption is it terminates navigating the list of completion functions. This also showed up when using company-mode which seems to use the same underlying function list by default. It is also especially annoying if 'debug-on-error' is on with company mode, as the stack just keeps popping up when typing innocuous things. The list of items in the list of completion functions include `semantic-analyze-completion-at-point-function' and a couple others. I believe these functions, specific to completion-at-point, need to wrap their call the the underlying `semantic-analyze-possible-completions' so that errors aren't thrown, and it doesn't get in the way when debugging something completely different. The below patch solved the problem for me. Thanks Eric diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el index 6851ad556a..4e2d9d8728 100644 --- a/lisp/cedet/semantic/analyze.el +++ b/lisp/cedet/semantic/analyze.el @@ -827,7 +827,9 @@ semantic-analyze-completion-at-point-function This function can be used by `completion-at-point-functions'." (when (semantic-active-p) (let* ((ctxt (semantic-analyze-current-context)) - (possible (semantic-analyze-possible-completions ctxt))) + (possible (condition-case nil + (semantic-analyze-possible-completions ctxt) + (error nil)))) ;; The return from this is either: ;; nil - not applicable here. @@ -846,7 +848,9 @@ semantic-analyze-notc-completion-at-point-function This function can be used by `completion-at-point-functions'." (when (semantic-active-p) (let* ((ctxt (semantic-analyze-current-context)) - (possible (semantic-analyze-possible-completions ctxt 'no-tc))) + (possible (condition-case nil + (semantic-analyze-possible-completions ctxt 'no-tc) + (error nil)))) (when possible (list (car (oref ctxt bounds)) @@ -862,8 +866,10 @@ semantic-analyze-nolongprefix-completion-at-point-function This function can be used by `completion-at-point-functions'." (when (semantic-active-p) (let* ((ctxt (semantic-analyze-current-context)) - (possible (semantic-analyze-possible-completions - ctxt 'no-tc 'no-longprefix))) + (possible (condition-case nil + (semantic-analyze-possible-completions + ctxt 'no-tc 'no-longprefix) + (error nil)))) (when possible (list (car (oref ctxt bounds))