Re: Contextual modes for operators.

2012-08-15 Thread Andreas Liljeqvist
Will have a look at eieio, thanks.

Just to be clear: the exact behavior of the modified functions are low
priority.
What I see as the main goal is building a framework for contextual
editing/navigating.
And making it easy for the end-user to extend it.

Check out the repo I posted earlier, it has a lot of nice functionality for
repls.

2012/8/15 Simon Hafner 

> 2012/8/15 Andreas Liljeqvist :
> > I am not really familiar with elisp though, what are the equivalence of
> > multimethods as found in clojure for example?
>
> According to #emacs, there is eieio, if I you associate multimethods
> with dynamic dispatch.
>
> > "cW" stopping in the case of structure(parenthesis etc) when in
> lispy-modes.
>
> I'm not sure, this might give some WTF situations. parenthesis
> movement is covered by `%`. But making `%` mode-aware to move between
> e.g. `do` and `end` in ruby-mode would be awesome.
>
> > "gd" Using whatever we have available for definition.
>
> semantic-mode might help here.
>
> > "i" Going to the first available actual input-area. (mostly for repls)
>
> Good idea.
>
> ___
> implementations-list mailing list
> implementations-list@lists.ourproject.org
> https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
>
___
implementations-list mailing list
implementations-list@lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list


Re: Contextual modes for operators.

2012-08-15 Thread Simon Hafner
2012/8/15 Andreas Liljeqvist :
> I am not really familiar with elisp though, what are the equivalence of
> multimethods as found in clojure for example?

According to #emacs, there is eieio, if I you associate multimethods
with dynamic dispatch.

> "cW" stopping in the case of structure(parenthesis etc) when in lispy-modes.

I'm not sure, this might give some WTF situations. parenthesis
movement is covered by `%`. But making `%` mode-aware to move between
e.g. `do` and `end` in ruby-mode would be awesome.

> "gd" Using whatever we have available for definition.

semantic-mode might help here.

> "i" Going to the first available actual input-area. (mostly for repls)

Good idea.

___
implementations-list mailing list
implementations-list@lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list


Contextual modes for operators.

2012-08-15 Thread Andreas Liljeqvist
Hi, recently I have done a merge request for my nrepl-branch:
https://gitorious.org/evil/evil/merge_requests/33

That got me thinking, we should really have a system for providing
mode-specific operators or motions.
Of course one could just say that the end user just have to redefine the
associated function, but I think we could do better.

Dispatch on major-mode and on optional list of minor-modes.
I think many of the operations can be a simple dispatch on "(eq type
'line)".
Then doing a eventual modification on the beg-end area.

I am not really familiar with elisp though, what are the equivalence of
multimethods as found in clojure for example?

We can do context aware stuff like:

"cW" stopping in the case of structure(parenthesis etc) when in lispy-modes.
"gd" Using whatever we have available for definition.
"i" Going to the first available actual input-area. (mostly for repls)

I would leave visual selection as is.
All this can be done inline in the relevant function, but the core quickly
gets messy, so I would like the code to reside in evil-integration.el
Also the end user should be able to easy define a code path for their mode
without copy-pasting the original function.

This would be a bit of work though, but I would like if Evil could offer
sane operators for many frequently used modes.

I would like some feedback before I start hacking on this, since I have
very limited experience with both elisp and evil.

Thanks
___
implementations-list mailing list
implementations-list@lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list