From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: completion-at-point + semantic : erroneous error Date: Wed, 23 Oct 2019 16:18:23 -0400 Message-ID: References: <957ad127-0d84-69e3-49b6-9799975bd724@siege-engine.com> <9cf7e484-9a86-ab1c-b04f-9dc3e7c91974@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="186085"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Emacs Development , Eric Ludlam To: Eric Ludlam Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 23 22:42:31 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 1iNNSf-000mGT-R4 for ged-emacs-devel@m.gmane.org; Wed, 23 Oct 2019 22:42:30 +0200 Original-Received: from localhost ([::1]:47356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNNSe-0007NN-Du for ged-emacs-devel@m.gmane.org; Wed, 23 Oct 2019 16:42:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36862) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNN5T-0004Yd-Rs for emacs-devel@gnu.org; Wed, 23 Oct 2019 16:18:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNN5S-0003eB-NV for emacs-devel@gnu.org; Wed, 23 Oct 2019 16:18:31 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44776) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNN5Q-0003dr-F1 for emacs-devel@gnu.org; Wed, 23 Oct 2019 16:18:30 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1D44F81258; Wed, 23 Oct 2019 16:18:27 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 757A081E28; Wed, 23 Oct 2019 16:18:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1571861905; bh=GSNQ/pnFQZl62XxfGHeudCJoN0uL2oPfTDdW83eJ6w4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Moh0O5vZDYgXDnCygTSoQqLyDB7BIqstt902JrGLb0Y0VM7Mcgg9zd4ZU8x9ScunQ i3FEPl89IABVyo+lRFk1uOVE3NsDsW/db66MpFXa9rZBAgDT4HdyA7OlTG+QH7qvn1 HlibAsaswzActKN4Kllb3Jm8TwdWunhBU0Mjb1hmQKZndCoabquCbk1NnoGd69uUcI OgsxgmAcCrqeVmXmasCX/i8HGwJlcUb288/6z3dXnCGlSjOqWzV9q4octW5yB1Nbwh r0TmTtDdIpnCD4jrO/ZetoCAM/OVUd9NuNo+Rq+bfcsHsKMgjAzIdl51wmcUNth3O5 RMnlGamYnMp6g== Original-Received: from pastel (unknown [216.154.30.71]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 20847120995; Wed, 23 Oct 2019 16:18:25 -0400 (EDT) In-Reply-To: <9cf7e484-9a86-ab1c-b04f-9dc3e7c91974@gmail.com> (Eric Ludlam's message of "Sat, 12 Oct 2019 07:56:57 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 132.204.25.50 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:241370 Archived-At: > As a followup, I started using the shorter version of your patch, and fou= nd > there are additional errors thrown from > semantic-analyze-possible-completions-default (what will be a method in=20 > your patch).=A0 I had to eliminate those errors to fully clean up the ori= ginal > problem that started this thread. [ Sorry for taking so long to get back to it. ] After fighting for a while with your patch (it was full of NBSP chars and wrapped lines) and then looking at it some more, I decided to install the patch below instead which replaces the `catch` with a `with-demoted-errors` (and places it in the caller instead). Maybe those errors should indeed all be replaced by silently returning nil, but the code currently goes through the trouble of building more precise error messages, so I felt like maybe we should preserve that info. Stefan diff --git a/lisp/cedet/semantic/analyze/complete.el b/lisp/cedet/semantic/= analyze/complete.el index b471c0d1a1..b473ade159 100644 --- a/lisp/cedet/semantic/analyze/complete.el +++ b/lisp/cedet/semantic/analyze/complete.el @@ -93,8 +93,10 @@ semantic-analyze-possible-completions context (semantic-analyze-current-context context))) (ans (if (not context) - (error "Nothing to complete") - (:override)))) + (when (called-interactively-p 'any) + (error "Nothing to complete")) + (with-demoted-errors "%S" + (:override))))) ;; If interactive, display them. (when (called-interactively-p 'any) (with-output-to-temp-buffer "*Possible Completions*"