all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eric Ludlam <ericludlam@gmail.com>
Cc: Emacs Development <emacs-devel@gnu.org>,
	Eric Ludlam <eric@siege-engine.com>
Subject: Re: completion-at-point + semantic : erroneous error
Date: Wed, 23 Oct 2019 16:18:23 -0400	[thread overview]
Message-ID: <jwvv9sfjla6.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <9cf7e484-9a86-ab1c-b04f-9dc3e7c91974@gmail.com> (Eric Ludlam's message of "Sat, 12 Oct 2019 07:56:57 -0400")

> As a followup, I started using the shorter version of your patch, and found
> there are additional errors thrown from
> semantic-analyze-possible-completions-default (what will be a method in 
> your patch).  I had to eliminate those errors to fully clean up the original
> 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*"




  reply	other threads:[~2019-10-23 20:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  2:33 completion-at-point + semantic : erroneous error Eric Ludlam
2019-10-11 17:04 ` Stefan Monnier
2019-10-11 17:34   ` Stefan Monnier
2019-10-12  1:06     ` Eric Ludlam
2019-10-24 20:17       ` Stefan Monnier
2019-10-27 12:35         ` Eric Ludlam
2019-10-27 20:38           ` Stefan Monnier
2019-10-27 23:36             ` Eric Ludlam
2019-10-12 11:56     ` Eric Ludlam
2019-10-23 20:18       ` Stefan Monnier [this message]
2019-10-27 11:52         ` Eric Ludlam
2019-10-27 21:54           ` Stefan Monnier
2019-10-27 22:31         ` Eric Ludlam
2019-10-23 20:22       ` Stefan Monnier
2019-10-27 11:53         ` Eric Ludlam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvv9sfjla6.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=eric@siege-engine.com \
    --cc=ericludlam@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.