emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: completion-at-point + semantic : erroneous error


From: Stefan Monnier
Subject: Re: completion-at-point + semantic : erroneous error
Date: Wed, 23 Oct 2019 16:18:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]