all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: `completion-in-region'
Date: Mon, 12 Apr 2010 16:51:06 +0100	[thread overview]
Message-ID: <xbaityrgzn2t.fsf@cam.ac.uk> (raw)
In-Reply-To: jwvk4sexbvp.fsf-monnier+emacs@gnu.org

On 2010-04-11 16:32 +0100, Stefan Monnier wrote:
>>> completion-in-region-functions is indeed meant for situations where you
>>> want to either completely replace the completion UI with some other one
>>> (à la completion-ui.el), or where you want to let-bind some completion
>>> variables.  But indeed, it hasn't been used much yet, so maybe a better
>>> interface would make sense.
>> BTW, some modern text editors (such as textmate) have started offering
>> fuzzy completion as default.
>
> Interesting.  Do you have any details of what is meant by "fuzzy"?
> [ BTW, I expect fuzzy matching to be a completion-style rather than
>   a completion-ui.  The IO part is the part that chooses which keys do
>   what, where/how to display the list of completions, etc... whereas
>   the completion-style controls what is the possible list of
>   completions given a completion-table and a user input.  ]

I haven't used textmate. I am afraid if I try it I might like it. So
that comment is from me watching a few screencasts of textmate. There
are a lot of them on the internet.

And using ido and the fuzzy completion in slime. None seems to suggest
it is a bad default.

>> I was trying to return a list of (beg end collections) and let
>> completion-in-region do the job. But in the end I did something like
>> this:
>
>> (defun TeX-completion-at-point ()
>>   (let ((list TeX-complete-list) entry)
>>     (while list
>>       (setq entry (car list)
>>           list (cdr list))
>>       (if (TeX-looking-at-backward (car entry) 250)
>>         (setq list nil)))
>>     ;; ignore the useless ispell completion
>>     (when (numberp (nth 1 entry))
>>       (when (looking-at "\\w")
>>         (forward-word 1))
>>       (TeX-complete-symbol)
>>       ;; try leaving point in between parenthesis
>>       (when (looking-back "\\s)" (line-beginning-position))
>>         (skip-syntax-backward ")"))
>>       ;; this is discouraged
>>       ;; return a function that does nothing
>>       'ignore)))
>
> I don't see where this adds a terminating }.

TeX-complete-symbol from AUCTeX does that automatically.

>> I haven't used pcomplete before so I will look at it later on.
>
> My suggestion doesn't have anything to do with pcomplete.el except for
> the fact that it's one place where I've used c-t-with-terminator.
> I.e. I'm suggesting you use completion-table-with-terminator and the
> pcomplete.el is just telling you where you can see it in use.
> But "grep completion-table-with-terminator lisp/**/*.el" will show you
> a few other uses (in meta-mode and make-mode, for example).

OK. I will keep that in mind.

[...]
>> The completion I was talking about was for function
>> `snippet-completion-at-point' which completes abbrevs and do the
>> expansion if the completed string is an abbrev name; the abbrev
>> expansion is then processed by snippet-region.
>
> I see.  So what problems have you encountered in this context?

Currently no except it returns a function which is discouraged as said
in the doc string of `completion-at-point-functions'.

> [ BTW, you may want to generalize it to abbrev-complete-at-point since
>   it's likely to be easy to generalize to any abbreviation table.
>   We could install this in abbrev.el.  ]
> 
>         Stefan

I have added this to my TODO. Unfortunately I might be away from
internet for quite a while but I will send that in next time if nobody
does that already.

Thanks.

Leo





      parent reply	other threads:[~2010-04-12 15:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06 14:37 `completion-in-region' Leo
2010-04-09  3:05 ` `completion-in-region' Stefan Monnier
2010-04-11 12:56   ` `completion-in-region' Leo
2010-04-11 15:32     ` `completion-in-region' Stefan Monnier
2010-04-11 18:05       ` `completion-in-region' Drew Adams
2010-04-11 19:44         ` `completion-in-region' Stefan Monnier
2010-04-11 19:56           ` `completion-in-region' Drew Adams
2010-04-11 20:49             ` `completion-in-region' Stefan Monnier
2010-04-11 21:13               ` `completion-in-region' Drew Adams
2010-04-11 20:08           ` `completion-in-region' Lennart Borgman
2010-04-11 20:51             ` `completion-in-region' Stefan Monnier
2010-04-11 21:06               ` `completion-in-region' Lennart Borgman
2010-04-12  2:10                 ` `completion-in-region' Stefan Monnier
2010-04-12  9:46                   ` `completion-in-region' Lennart Borgman
2010-04-12 13:10                     ` `completion-in-region' Stefan Monnier
2010-04-12 14:50                     ` `completion-in-region' Davis Herring
2010-04-11 21:12             ` `completion-in-region' Drew Adams
2010-04-12 15:36       ` `completion-in-region' Leo
2010-04-12 18:10         ` `completion-in-region' Stefan Monnier
2010-04-12 15:51       ` Leo [this message]

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

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

  git send-email \
    --in-reply-to=xbaityrgzn2t.fsf@cam.ac.uk \
    --to=sdl.web@gmail.com \
    --cc=emacs-devel@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.