emacs-devel
[Top][All Lists]
Advanced

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

Re: trunk r116285: * lisp/emacs-lisp/lisp.el (lisp-completion-at-point):


From: Stefan Monnier
Subject: Re: trunk r116285: * lisp/emacs-lisp/lisp.el (lisp-completion-at-point): Symbols don't start
Date: Tue, 11 Feb 2014 20:42:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> Yes, except that "a quote before BEG" is not sufficient.
>> We could/should also check if one of the parent open-parens is prefixed
>> with a quote or a backquote, and only allow boundp if not.
> Ok to install?

Let's keep it for after 24.4.  It's clearly a new feature, and I don't
see any hurry to implement it.

> +(defun lisp--form-quoted-p ()
> +  "Return non-nil if the form after point is not evaluated.
> +It can be quoted, or be inside a quoted form.
> +This function moves point."
> +  ;; FIXME: Do some macro expansion maybe.
> +  (or (eq (char-after) ?\[)
> +      (progn
> +        (skip-chars-backward " ")
> +        (memq (char-before) '(?' ?`)))
> +      (and (not (eq (char-before) ?,))
> +           (ignore-errors
> +             (up-list -1)
> +             (lisp--form-quoted-p)))))

I think we'd want to use (nth 9 (syntax-ppss)) rather than up-list (it's
got the start pos of all enclosing lists in ).  Using syntax-ppss should
also help us handle the case we're inside a comment/string.

> `defadvice', ideally, would have to be handled specially anyway, to limit
> completions to functions.

Yes.  And `function' (aka #') should only complete functions as well.


        Stefan



reply via email to

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