Fwd: [climacs-devel] "Vial" mode for Climacs?

Brad Beveridge brad.beveridge at gmail.com
Thu Oct 26 05:46:54 UTC 2006

I mistakenly posted to Troels only.

---------- Forwarded message ----------
From: Brad Beveridge <brad.beveridge at gmail.com>
Date: 25-Oct-2006 16:25
Subject: Re: [climacs-devel] "Vial" mode for Climacs?
To: Troels Henriksen <athas at sigkill.dk>

On 25/10/06, Troels Henriksen <athas at sigkill.dk> wrote:
> "Brad Beveridge" <brad.beveridge at gmail.com> writes:
> > So my thinking is that if I want to really be sensible (damn logic!),
> > I at least need to figure out how hard it would be to make a Vial mode
> > for Climacs.
> I could say that it would be easy, and assume that you want something
> half-baked.
I don't use Viper for precisely the reason that it feels half-baked.
Vial doesn't need to implement all Vim's features, but must have
proper Vi finger feel - otherwise it is not a solution in my mind.

> That's not likely to work well - the BASE table really is the base,
> and doesn't do much in itself. The higher-level command tables,
> including the syntax-specific ones, would override your Vim-like
> behavior. You really need a self-contained command table tree I think
> (which is the reason for my comment about probably needing a lot of
> not-very-complicated code).
So the problem here is that I want to rebind keys at a very general
level, but sub-modes of Climacs will go and blow away my bindings when
the more specific mode becomes active?  At the same time I want to
keep the same modes of Climacs, because modes effect things like
syntax as well as key bindings.  I would like to prevent sub-modes
from breaking the Vial bindings, but keep the other mode features.  I
also want to provide my own sub-mode maps that _will_ effect the Vial
commands.  This sounds like something of a thorny problem.  Any
pointers on where to look in Climacs so that I may begin to understand
what work is required here?

> > So I think I have two options:
> I have a novel ideal, that relies on some functionality available in
> an experimental version of ESA (the library responsible for Climacs
> command processing, among other things) I'm working on. Basically, I
> define the concept of a "command processor" that is fed gestures and
> uses these gestures to look up commands in command tables - really,
> what CLIM does by default. However, you can create a new command
> processor (all it needs to do is to obey the command processor
> protocol) that implements more Vi-like behavior. As it can do
> gesture-processing however it likes, it can implement Vi-style
> pairings of editing and movement commands.
I like the sound of this idea.  Is this experimental command processor
in ESA cvs right now?  Also, when you say "fed gestures" I assume you
mean that the command processor is getting input from McClim?

> I still recommend using
> command tables for lookup, if for nothing else, then because Climacs
> and ESA already has some semantics for syntax-specific command
I think there is a gap in my understanding here.  I don't see how
command tables would fit in with a Vi-style command processor module
in ESA.

> tables. You'd probably also need to wrap many commands, as they
> generally expect to be used with the Emacs concept of the region,
> instead of with Vi-style movement commands. A simple implementation
> might be to temporarily move point and mark to the edges of the region
> traversed by the provided movement command.
For operations that are line centric, I think it is fair to move the
point and create a region that consists of whole lines only.  That way
Vial mode and Emacs mode should be able to share pretty much all the
same editing primitives.

> No matter what, this will require a lot of code and reworking of some
> Climacs internals - the current code is not engineered for the
> flexibility needed by a proper implementation of a Vi-like editor.
I don't mind a lot of work in the long run, but I'm the type of person
who likes/needs gratification early, so I hope that getting something
half baked working will be pretty fast :)


More information about the climacs-devel mailing list