emacs-devel
[Top][All Lists]
Advanced

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

Re: find-file-project


From: Dmitry Gutov
Subject: Re: find-file-project
Date: Wed, 20 Jan 2016 18:40:07 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Thunderbird/44.0

On 01/20/2016 05:25 AM, Stefan Monnier wrote:
Were you going to attach it?

I was, yes.

Thank you.

The default method will handle lists/alists/hash-tables and
functions.  The specialized methods will handle "dispatchable" types.

Right, but that still requires the a new "dispatchable" kind of
completion-table.

But why do we care about that? Each backend author could invent their own "dispatchable" completion table (with cl-defstruct), or just use

(cons
 'my-special-table
 (lambda (string pred action)
   ...))

That would allow us to keep using functions (rather than add a new kind
of completion-table), and simply give them a dispatchable type when we
need it.

Ah, so they'll be kind of named closure subtypes.

I'm still not sure how I feel about dispatching on such type. E.g. with cl-defmethod it would be like adding a new "method" to [the new special kind of] function.

Do we really need for the new kind of table to be callable? Because if we just use the (cons ...) value above for this purpose, we can be sure that nobody will call all-completions on it by mistake (or they'll get a very weird result, at least).



reply via email to

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