Hello, Les!
LM> I don't mind that the keywords accepted by the compiler have to be
LM> uppercase. I just think an editor which accepted either/both
LM> case(s) and changed each keyword to uppercase immediately after
LM> <ret> was pressed would be a big improvement.
This kind of fix would make plain (non-program) text editing rather
annoying, including comments (**) where you don't want to BEGIN or
END everything in capitals. If we would want to be able to
switch this behaviour on and off, we would introduce a mode to the
BlackBox (much like CapsLock mode). And this still would be
inconvenient as we'd have to worry about its current state when
switching between program and plain text editing.
I ecnountered another approach in Plug-In Oberon (see EditKeys.mod
and EditKeys.text). The point is this: when I press certain key
(Insert, for instance) the text before current cursor position is
treated as a macro command. The macro executes a command or simply
replaces itself with some text and cursor is assigned a new position
(usually inside inserted text).
Macros are defined in a text file and may be easily edited.
Macros may call other macros.
Syntax of macro invocations:
MacroInvocation = {Argument ":"} MacroName.
Argument = { <arbitrary graphic character except : and " > } | TextStretch.
Examples of macro definitions:
Initials ("JM" write)
M ("MODULE " write arg0 write "; (** " write Initials " " write
stamp " **)" write cr
caret cr "END " write arg0 write "." write cr)
P ("PROCEDURE " write arg0 write ";" caret write cr
indent "BEGIN" write cr
indent "END " write arg0 write ";" write)
So, for example, if you want to write a new procedure, you don't
have to type everything by hand. You just type this:
NewProc:P
press "magic button" (Ins) and instantly get this:
PROCEDURE NewProc;|
BEGIN
END NewProc;
with proper intendation and caret instead of "|".
Maybe something like that already exists in CPC, I don't know.
If not, it shoudn't be very hard to port from Plug-In Oberon.
---=====---
Alexander
Received on Sun May 21 2006 - 19:38:18 UTC