]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/cedet/semantic/analyze/complete.el: Fix completion-at-point
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 23 Oct 2019 20:15:41 +0000 (16:15 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 23 Oct 2019 20:15:41 +0000 (16:15 -0400)
Completion tables are not supposed to signal errors:

    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"

(semantic-analyze-possible-completions): Return nil instead of
signaling errors.

lisp/cedet/semantic/analyze/complete.el

index b471c0d1a133baf75c6f1ce9a52a8a3b77915f54..b473ade1594630d205b94ec24c82cd88ecb4d52e 100644 (file)
@@ -93,8 +93,10 @@ in a buffer."
                          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*"