Subject: Re: bug#20425: 24.5; completion-at-point not working with prefix starting with '(:'

From: Dmitry Gutov <[email-masked]>
Date: Tue, 28 Apr 2015 06:25:39 +0300

On 04/27/2015 03:50 PM, Stefan Monnier wrote:

> Thanks.  Indeed, M-TAB at the end of the previous line incorrectly claims
> there's no completion, even that this "(:backg" is not a "function
> call", so it should complete against "anything we can find".

As a first pass, this patch seems to help (here and in bug#19529, which 
is apparently a duplicate). It'll also make things worse for macro 
writers, but the existing `elisp--form-quoted-p' usage doesn't exactly 
cater to them either.

I should really revisit the "macroexpand all the things for completion" 
discussion.

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index ad35c48..ca6042a 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -480,7 +480,7 @@ It can be quoted, or be inside a quoted form."
        (when (and end (or (not (nth 8 (syntax-ppss)))
                           (eq (char-before beg) ?`)))
          (let ((table-etc
-               (if (not funpos)
+               (if (or (not funpos) (elisp--form-quoted-p beg))
                     ;; FIXME: We could look at the first element of the 
list and
                     ;; use it to provide a more specific completion 
table in some
                     ;; cases.  E.g. filter out keywords that are not 
understood by