[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lisp-completion-at-point "end" position.
From: |
Thierry Volpiatto |
Subject: |
Re: lisp-completion-at-point "end" position. |
Date: |
Tue, 02 Aug 2011 06:58:55 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> If i complete:(note that there is no space between "!" and "s")
>> (def!some_text
>
>> The value of beg is the value of point at "d"
>> The value of end is the value of point at "t"
>
> Yes, so you can do complete (wit!sel to (with-selected-.
> Whether that is done or not will depend on completion-styles, where the
> difference between `basic', `emacs22', and `emacs21' is exactly about
> what to do in such a case.
It seem these completion-styles work when using completion-at-point, but
not when using directly lisp-completion-at-point and i see nothing here taking
care of this:
--8<---------------cut here---------------start------------->8---
(end
(unless (or (eq beg (point-max))
(member (char-syntax (char-after beg)) '(?\" ?\( ?\))))
(condition-case nil
(save-excursion
(goto-char beg)
(forward-sexp 1)
(when (>= (point) pos)
(point)))
(scan-error pos)))))
--8<---------------cut here---------------end--------------->8---
So
(let ((completion-styles 'emacs22))
(lisp-completion-at-point))
(let ((completion-styles 'partial-completion))
(lisp-completion-at-point))
(let ((completion-styles 'basic)) (lisp-completion-at-point))
Returns the same value.
But well, it's ok i use always the value of `point' here instead of
(cadr lisp-completion-at-point).
>> Is there a good reason for that?
>
> I'll let you judge whether it's good or not. But it's the same behavior
> as in the minibuffer.
It's inconvenient to have to type a space just to have completion.
e.g:
(def!(something) => doesn't complete def
(def! (something) => complete def
--
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
- Re: lisp-completion-at-point "end" position., Stefan Monnier, 2011/08/01
- Re: lisp-completion-at-point "end" position.,
Thierry Volpiatto <=
- Re: lisp-completion-at-point "end" position., Stefan Monnier, 2011/08/02
- Re: lisp-completion-at-point "end" position., Thierry Volpiatto, 2011/08/02
- Re: lisp-completion-at-point "end" position., Stefan Monnier, 2011/08/02
- Re: lisp-completion-at-point "end" position., Thierry Volpiatto, 2011/08/02
- Re: lisp-completion-at-point "end" position., Stefan Monnier, 2011/08/02
- Re: lisp-completion-at-point "end" position., Thierry Volpiatto, 2011/08/03
- Re: lisp-completion-at-point "end" position., Stefan Monnier, 2011/08/03