tmr@cs.bham.ac.uk (Tim Read) writes:
> Organization: School of Computer Science, University of Birmingham, UK
> Date: Sat, 5 Dec 1992 16:09:22 GMT
>
> 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.
I believe some HCI people argue that mode-less systems are best. My
view is that modelessness should be the default, but that users
should be able to specify that they would like associate particular
modes with certain sorts of files, or certain sorts of contexts. If
it's forced on people it will almost certainly not suit all users.
VED already has some of these modes determined by variables like
vedbreak, vedindentstep, etc. and there's scope for matching them
to file names using vedfiletypes (See HELP VEDFILETYPES)
Other modes users can turn on and off include cursor wiggling
to indicate matching brackets. See HELP VED_WIGGLE
(Unfortunately, I don't think you can easily make this work
differently for different files. However you could probably
fiddle with the procedure vedinitfile and veddo to achieve this.)
> ....
> So for example, if I am using emacs in pop11-mode, and write an IF
> statement, when I press RETURN it will automatically place my cursor on the
> next line at the correct place to start typing (regardless of nesting),
> without the need to use TABs or the space bar, eg
>
> if foo > 1 then RETURN
> X
>
> (X = cursor position)
>
> Blissful :-)
There is a much unused Pop-11/VED local library developed at Sussex
by Chris Slymon nearly 10 years ago (I think I modified it a bit
some time later). We actually have it here in Birmingham, and I
expect some other sites have it. It's LIB AUTOINDENT.
See HELP AUTOINDENT
A comment near the top says
| This file describes an experimental package, that alters the action
| of the <RETURN>, <TAB>, <LF>, INSERT-LINE-ABOVE, INSERT-LINE-BELOW
| and <DELETE> keys, to produce semi-automatic indentation of POP
| procedures, that will, hopefully, be identical to that produced by
| ENTER tidy.
|
| ***DISCLAIMER***
| This package does not attempt to remove final responsibility for
| program indentation from the user. You still have to do some work,
| but not much.
| ***END OF DISCLAIMER***
It seems to work with things that have since been added to Pop-11
syntax (e.g. things like #| ... |#) as long as they are in
vedopeners and vedclosers. E.g. after loading the library I typed
the #| indented on the next line, and the remaining lines were
automatically indented.
#|
if foo then
baz(a, b)
else
grumble()
endif
|#
(When you type RETURN on a line starting with a closer it de-indents
it.)
Someone should put this into $popcontrib or the PLUG archive, maybe
after improving it and checking whether it screws up VED key
mappings in VEDNEWKEYS.
I've known about it for years, but never use it because I prefer
modeless editing (and I type very fast). I wonder how many people do
use it?
> However when writing email, the line length is critical, and spaces on
> subsequent lines are not. It is trivial to temporarily swap modes so that
> one can write some code within an email message (I have all my favourite
> modes bound into my key map, so I can change them in seconds).
You can do this with the above package by invoking one of the two
procedures
vedpopnewlines();
vedvednewlines();
which you can, of course, map onto keys for rapid mode switching.
> Some questions come to mind: Why are there no modes in ved? (I am unaware of
> any drawbacks of having them),
Except that some people hate 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.
You are lucky to have this readily available here. I'll ask Sussex
people if they object to it being made more widely available.
Aaron
--
Aaron Sloman, School of Computer Science,
The University of Birmingham, B15 2TT, England
EMAIL A.Sloman@cs.bham.ac.uk OR A.Sloman@bham.ac.uk
Phone: +44-(0)21-414-3711 Fax: +44-(0)21-414-4281
|