[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Dec 6 19:32:23 1992 
Subject:Re: Modes for ved 
From:Steve Knight 
Volume-ID:921207.04 

In comp.lang.pop, tmr@cs.bham.ac.uk (Tim Read) writes:
> One of the features I particularly like about emacs is its use of modes.  A
> mode is the way that the editor defines the functionality of a buffer and
> the associated set of key bindings that go along with it.

Well doubtless Aaron will come up with a dozen different ways of doing
this in VED, together with an explanation of why you shouldn't in the
first place.  However, as I've always been one to pour oil on a fire, read
on ....

Modes?  Modes?! [Say this second one with a horrified squeak.]  VED is one
of the few editors carefully crafted to avoid modes to the best possible
extent.  When it does have modes (e.g. interactive mode) it gives you 
clear feedback on the fact.  

Naturally, by hacking vedfiletypes you can invent all the disgusting
modes you like (BLETCH).  But why bother?

> A very simple example is the differences in use of RETURN, line length and
> tab positions between a programming language mode and an email mode. 
[Example deleted]

So just redefine the mapping for RETURN and TAB.  Not exactly difficult.
If you want to have several different modes, bind modes to different kinds
of buffers for automatic selection, bind modes to different keystrokes for
exceptional choices, this is just a SMOP[*].

A legitimate complaint might be, why haven't these mode-things been added
to VED already?  The somewhat weak answer is that no one has thought them
useful enough to write and publish.  If anyone has done something similar
they have probably stuffed it in their personal library and forgotten about
it.  I did.

> Some questions come to mind: Why are there no modes in ved? (I am unaware of
> any drawbacks of having them), and How do I emulate my emacs modes within
> ved as it stands at the moment? I would particularly like the pop11-mode, I
> get really fed up having to do it manually.

Most people feel that modes are a Bad Thing because it means that you have
to learn different bindings for different contexts.  Unless these contexts
are easily distinguished (which, to be fair, they generally are in EMACS)
then this makes the system clumsy and difficult to learn.  Great for power
users, though.

My belief is that VED hasn't got modes because it isn't used as a general
purpose text interface in the way that EMACS is.  EMACS is much much more
than a text editor -- I always think of it as the world's best mailer.
I don't think much of it as an editor, but it beats the heck out of most
mailers that I've seen.  Since VED only gets used for 2 tasks, in the main,
there is too little requirement for multiple modes.

To get the effect of auto-indentation, I suggest rebinding the return
key to a procedure that inspects the current line and makes a sensible
decision on how to indent.  If Aaron hasn't done this already I shall
have a go later on ....

Steve


[*] SMOP -- a Small Matter Of Programming.  My favourite Merry-ism.