unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: lisp-completion-at-point "end" position.
Date: Tue, 02 Aug 2011 06:58:55 +0200	[thread overview]
Message-ID: <87mxfsv27k.fsf@gmail.com> (raw)
In-Reply-To: <jwv4o20a5vt.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 01 Aug 2011 22:50:25 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> 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 



  reply	other threads:[~2011-08-02  4:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 16:09 lisp-completion-at-point "end" position Thierry Volpiatto
2011-08-02  2:50 ` Stefan Monnier
2011-08-02  4:58   ` Thierry Volpiatto [this message]
2011-08-02 18:53     ` Stefan Monnier
2011-08-02 19:14       ` Thierry Volpiatto
2011-08-02 20:11         ` Stefan Monnier
2011-08-02 20:35           ` Thierry Volpiatto
2011-08-03  1:07             ` Stefan Monnier
2011-08-03  4:35               ` Thierry Volpiatto
2011-08-03 14:21                 ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxfsv27k.fsf@gmail.com \
    --to=thierry.volpiatto@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).