gnu-emacs-sources
[Top][All Lists]
Advanced

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

Re: ;;; anything.el --- open anything


From: Tassilo Horn
Subject: Re: ;;; anything.el --- open anything
Date: Tue, 07 Aug 2007 15:01:32 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

"address@hidden" <address@hidden> writes:

>> I think that would make sense.  But how would you go with sources
>> that don't have a type field?
>
> I plan to generalize source attributes, so that type would be a
> fallback for those attributes which are not specified by the source.
>
> So, for example, instead of using anything-candidate-transformers,
> candidate transformation would be a simple source attribute which the
> source could specify directly, or via its type.
>
> So instead of
>
> (setq anything-candidate-transformers
>       '((file . some-func)))
>
> it would either be
>
> (setq anything-sources '((name . "Some Source")
>                          ...
>                          (candidate-transformer . some-func)))
>
> or
>
> (setq anything-sources '((name . "Some Source")
>                          ...
>                          (type . file)))
>
> (setq anything-type-attributes
>       '((file ((candidate-transformer . some-func)
>                ...
>               )))

Shouldn't it be `candidate-transformers' and a list of transformer
functions?  Then there would be no need to add `some-func' whose only
purpose is to aggregate the effects of some other transformer functions.
Then I simply could say

(defvar anything-type-attributes
        '((file . (candidate-transformers
                   ((anything-c-shadow-boring-files
                     anything-c-shorten-home-path))))
          ...))

> And it would be the same for anything-candidate-transformers and
> anything-action-transformers, so these would all be obsoleted.
>
> That's of course impacts anything-config.el heavily, so I only want to
> do it if you agree

I agree. I'm not too happy with the current approach because there's
quite a lot duplicate code for action and candidate transformers.

> and when you have the time to work on it.

Well, the changes are not too complex, so I think I could port it to the
new framework in two hours, say.  If you say that the new stuff won't
change in the next time, I'll do it.

> Naturally, everything will be backward compatible until the transition
> is complete, so I won't remove the existing framework until then.

Ok.

> I plan to do it in incremental steps. The first step will be
> generalizing anything-filtered-candidate-transformers. You don't use
> it yet in anything-config.el, so that's the simplest, and it will help
> to finalize the adaptive sorter.

Yeah, that would be good.  I haven't looked into these till now.  Could
you PING me when that's implemented and tell me what source could
benefit from it, so that I can implement it to get a feeling.

> When it's done then the rest can be done incrementally.
>
> What do you think of this plan?

I think it's a good idea, so lets do it. ;-)

Bye,
Tassilo
-- 
According to  the Bible,  God created the  universe in six  days. Before
that, Chuck Norris created God by snapping his fingers.





reply via email to

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