From: Julien Danjou <julien@danjou.info>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Tassilo Horn <tassilo@member.fsf.org>,
emacs-orgmode@gnu.org, emacs-devel@gnu.org
Subject: Re: Completing with anything
Date: Mon, 21 Mar 2011 12:23:09 +0100 [thread overview]
Message-ID: <sa362rcg1k2.fsf@cigue.easter-eggs.fr> (raw)
In-Reply-To: <jwv62rgguvg.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 18 Mar 2011 14:16:38 -0400")
[-- Attachment #1: Type: text/plain, Size: 2366 bytes --]
On Fri, Mar 18 2011, Stefan Monnier wrote:
> There's a misunderstanding: AFAIK the patch sent by Tassilo does not
> make the completion-at-point-function return a "function that performs
> completion" but does properly return completion data (i.e. region start,
> region end, and completion table), part of which happens to be
> represented by a function.
> I.e. this is not one of the discouraged cases.
You're right, indeed!
But I do not see anywhere the fact that the completion collection can be
a function.
I only found the sentence:
"It would be consistent and clean for completion functions to allow
lambda expressions (lists that are functions) as well as function
symbols as COLLECTION, but this is impossible."
in (elisp) Programmed Completion.
Not sure it's really related to completion-at-point-functions, but well,
it's not making things clearer for me anyhow.
>> - Make completing code allows to replace the region being completed with
>> somethig that does not match at all.
>
> AFAIK that's already the case, tho it depends on lots of factors, such
> as what you mean by "completing code".
I meant the code in minibuffer.el
To be clear, the things that disturbs me is that this simple test case
does not work as I would like it to:
#+begin_src emacs-lisp
(defun jd:completion-at-point-test ()
(list (point-at-bol) (point) '("Steve" "John")))
(add-to-list 'completion-at-point-functions 'jd:completion-at-point-test)
#+end_src
If you run that code into a buffer, and then type in this same buffer:
L
And try to complete that "L" with M-x completion-at-point, it will say
"No match."
But if you do:
#+begin_src emacs-lisp
(defun jd:completion-at-point-test ()
(list (point-at-bol) (point) '("Lionel" "Steve" "John")))
(add-to-list 'completion-at-point-functions 'jd:completion-at-point-test)
#+end_src
And try to complete a "L", it will complete to Lionel. Just because
completion-at-point is trying to be smarter than my function,
re-guessing which items from the collection are good candidates.
Something my function already does (well, not in this example, but in
real life).
This is why I'm (kindly) finger pointing the "completing code in
minibuffer.el", but I might be wrong (and hope to be! :-)).
--
Julien Danjou
❱ http://julien.danjou.info
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
next prev parent reply other threads:[~2011-03-21 11:23 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87r5bhysp6.fsf@keller.adm.naquadah.org>
[not found] ` <m1wrl8c5ix.fsf@94.197.191.21.threembb.co.uk>
[not found] ` <878vxovsym.fsf@keller.adm.naquadah.org>
[not found] ` <87k4h7ua23.fsf@member.fsf.org>
2011-02-10 16:56 ` Re: Announcing org-contacts, a bbdb-like contact manager for Org Julien Danjou
2011-02-10 18:20 ` Stefan Monnier
2011-02-11 10:21 ` [Orgmode] " Tassilo Horn
2011-02-11 14:47 ` Stefan Monnier
2011-02-11 20:15 ` Tassilo Horn
2011-02-11 23:08 ` Stefan Monnier
2011-02-12 18:37 ` Tassilo Horn
2011-02-20 16:58 ` Julien Danjou
2011-03-18 15:00 ` Completing with anything (was: [Orgmode] Re: Announcing org-contacts, a bbdb-like contact manager for Org) Julien Danjou
2011-03-18 18:16 ` Completing with anything Stefan Monnier
2011-03-21 11:23 ` Julien Danjou [this message]
2011-03-21 12:51 ` Tassilo Horn
2011-03-21 13:36 ` Julien Danjou
2011-03-21 14:17 ` Tassilo Horn
2011-03-21 16:27 ` Stefan Monnier
2011-03-21 16:55 ` Dimitri Fontaine
2011-03-21 17:04 ` Julien Danjou
2011-03-21 22:00 ` Stefan Monnier
2011-03-22 10:00 ` Aankhen
2011-03-22 11:57 ` [O] " Tassilo Horn
2011-03-22 12:03 ` Julien Danjou
2011-03-22 12:31 ` Tassilo Horn
2011-03-21 15:19 ` Stefan Monnier
2011-03-21 15:54 ` Julien Danjou
2011-04-09 15:11 ` [O] " Julien Danjou
2011-04-10 4:03 ` Stefan Monnier
2011-04-11 9:21 ` Julien Danjou
2011-04-12 3:42 ` Stefan Monnier
2011-04-12 9:48 ` Julien Danjou
2011-05-04 15:07 ` Stefan Monnier
2011-05-04 15:34 ` Julien Danjou
2011-05-24 3:14 ` Stefan Monnier
2011-05-24 7:33 ` Julien Danjou
2011-05-24 9:16 ` Antoine Levitt
2011-05-24 12:47 ` Stefan Monnier
2011-05-24 13:18 ` Antoine Levitt
2011-05-24 14:04 ` Stefan Monnier
2011-05-24 14:05 ` Stefan Monnier
2011-05-24 14:45 ` Antoine Levitt
2011-05-24 18:05 ` Stefan Monnier
2011-05-24 18:30 ` Antoine Levitt
2011-05-26 2:23 ` Stefan Monnier
2011-05-26 7:50 ` Antoine Levitt
2011-05-28 2:15 ` Stefan Monnier
2011-02-11 11:08 ` Announcing org-contacts, a bbdb-like contact manager for Org Thierry Volpiatto
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=sa362rcg1k2.fsf@cigue.easter-eggs.fr \
--to=julien@danjou.info \
--cc=emacs-devel@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
--cc=tassilo@member.fsf.org \
/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).