From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eric Ludlam <eric@siege-engine.com>
Cc: Emacs Development <emacs-devel@gnu.org>
Subject: Re: completion-at-point + semantic : erroneous error
Date: Fri, 11 Oct 2019 13:04:55 -0400 [thread overview]
Message-ID: <jwv5zkvw7b3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <957ad127-0d84-69e3-49b6-9799975bd724@siege-engine.com> (Eric Ludlam's message of "Wed, 9 Oct 2019 22:33:44 -0400")
> 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
The backtrace shows that the error is signaled by
semantic-analyze-possible-completions called from
semantic-analyze-completion-at-point-function. I'm not sufficiently
familiar with the way define-overloadable-function works to be sure what
to do here, but the patch below might be a start (it seems to fix the
immediate problem you're reporting here, but I see other places where
we signal this error).
Arguably, semantic-analyze-possible-completions should never be called
interactively nowadays (should always go through
completion-at-point-functions), so there are likely some cleanups that
could be done.
Stefan
PS: It would also be good to replace uses of
define-overloadable-function with cl-defmethod, although the mapping
from one to the other is not immediate.
diff --git a/lisp/cedet/semantic/analyze/complete.el b/lisp/cedet/semantic/analyze/complete.el
index b471c0d1a1..ea9bf9111b 100644
--- a/lisp/cedet/semantic/analyze/complete.el
+++ b/lisp/cedet/semantic/analyze/complete.el
@@ -93,7 +93,8 @@ semantic-analyze-possible-completions
context
(semantic-analyze-current-context context)))
(ans (if (not context)
- (error "Nothing to complete")
+ (when (called-interactively-p 'any)
+ (error "Nothing to complete"))
(:override))))
;; If interactive, display them.
(when (called-interactively-p 'any)
next prev parent reply other threads:[~2019-10-11 17:04 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 [this message]
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
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=jwv5zkvw7b3.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=eric@siege-engine.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.