[Openmcl-devel] Emacs, anyone?

Pascal J.Bourguignon pjb at informatimago.com
Mon Oct 18 17:39:04 UTC 2004


alex crain writes:
>
> > binding themes?
> 
> User controlled bindings are a given - we could even implement the old
> wordstar mode if we wanted - my question is about what should be the out
> of the box default.

My suggestion is obviously not about a user changing ONE binding, but
about a user changing ALL the bindings. With one command, all the
binding would switch to emacs bindings, or to hemlock bindings, or to
X or Y bindings.

The subject is complex because subsets of bindings are defined by the
modes, so each modes in addition to the global should publish _common_
"binding themes".

An example of binding theme implemented by slime was when you could
select between C-z or C-c as prefix key for slime mode bindings.

But changing a binding theme would also change the future bindings
that a mode would install upon invocation.

For example, you start hemblock, you get the default binding theme.
You select another binding theme. You open a lisp file, the lisp mode
activates and install its own mode specific bindings. Well, it
actually installs its bindings in the selected theme.

For example, if you have a binding theme where the meta key sequences
are reversed (a RPL binding theme), you'd get these reversed sequences
even in modes loaded afterward.

Of course, it may be quite difficult to implement it for random modes,
in particular if we leave it to the modes to  define the binding as is
done in emacs. I'd advocate for a new scheme.  Perhaps modes could be
defined as a symbolic command interface. For example in most mode you
have commands to "move" forward and backward in small, medium and big
steps, and may be to "move" "vertically" in small, medium and big
steps.  Therefore we could take the binding business out of the hands
of the modes and specify in a binding theme that
   
   symbol command: move-forward-small  = C-f
                   move-forward-medium = M-f
                   move-forward-big    = C-M-f

You could define another theme where:

   symbol command: move-forward-small  = ->
                   move-forward-medium = Shift ->
                   move-forward-big    = Opt ->

It would probably be worthwhile to organize these symbolic commands
hierarchically.  So you could associate lists of binding to a higher
node, and they would be associated in order automatically to subnodes
present in the mode.

So, instead of defining in the binding mode:

                                 move

                   forward                 backward

            small  medium   big       small  medium   big
            C-f     M-f     C-M-f     C-b    M-b     C-M-b

you could define:
                                 move

                   forward                     backward
        C-f, M-f, C-M-f, A-f, C-A-f   C-f, M-f, C-M-f, A-f, C-A-f

So a mode that would export          would get assigned 
the symbolic commands:               automatically:

        move-forward-atom                    C-f
        move-forward-sexp                    M-f
        move-forward-definition              C-M-f
        move-forward-package                 A-f
             

And another that would export        would get assigned 
the symbolic commands:               automatically:

        move-forward-character               C-f
        move-forward-word                    M-f
        move-forward-line                    C-M-f
        move-forward-paragraph               A-f
        move-forward-section                 C-A-f

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Voting Democrat or Republican is like choosing a cabin in the Titanic.




More information about the Openmcl-devel mailing list