[Openmcl-devel] Emacs, anyone?

alex crain alexcrain at mail2.widgetworks.com
Mon Oct 18 11:07:16 PDT 2004


Um, thats really a cool idea, but it's a little beyond what I was 
thinking of.

Hemlock is implemented as a set of commands, like "Forward Character"
and "Self Insert". Many of these commands are bound to key sequences
and some of them are mode specific.

It would be straight forward enough to have binding sets, which would be
files containing a bunch of statements in the form:

	(bind-key "Forward Character" #k"control-f")

If there is a demand for multiple binding sets, I can add a preference
so that users can load whatever set they want. We can even have
local binding sets for specific buffers.

As for myself, I like emacs. I pretty much live in emacs and have done 
so
for the last 15 years, so I would be content if every editor ever made 
used
emacs bindings, including my playstation. I recognize that my view is
not universally shared, however, so I ask -

Does anyone care if I make Hemlock default to emacs bindings?

:alex

On Oct 18, 2004, at 1:39 PM, Pascal J.Bourguignon wrote:

> 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.
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>




More information about the Openmcl-devel mailing list