1. Pre-emptive; editor auto-completion

This is all a bit pre-emptive; I'm just looking for initial
feedback/thoughts/other cases. There are way too many
keywords/inbuilts/win32lib calls etc etc etc, so all I want is your
top 10s. I've put my top 11 below 'cos I'm allowed to cheat.
Please try and keep things alphabetical for ease of reference.

(I've LOTS of stuff to do yet so take your time..)

====
While working on changes to Mike's editor a few thoughts have cropped
up about auto-completion.

Basically, if return or backspace puts the cursor on a blank line
[&/or eg F8], then the next one, two or three keystrokes (max) could
behave as listed below.

Alternatively/additionally ctrl+shift+key creates the templates
described below.

NOTE: Mike's editor already has auto-indent so 1st column / 1st
non-blank is already quite a natural distinction/behaviour.

Implementationwise, a few extra tests per keystroke (no parsing, no
semantics or such horrors) would have no noticeable overhead. It would
be rather trivial to piggyback this ontop of the existing macro and
undo(*) functions, it seems. [just need to subroutine the macro code]
(*) eg undo(while)==>undo(the last 17 chars "typed" [count 'em]), 
	  undo(procedure)==>undo last 25, etc.

In the following "rules"
_ indicates the resulting cursor position. It does NOT mean there will
be a physical space.
Any other key deactivates the function (a-z, up, down, the lot)
Backspace would have special handling such that if keyed immediately
after an auto-completion if would undo it completely and deactivate
the function. Undo (Ctrl z) would behave as backspace
in these special conditions.
There would be an option to turn this or selected bits of it off
(individual pick & choose)

a
[[if column 1]]-->
atom _

c
[[if column 1]]-->
constant _

f
[[if column 1]]-->
function _()
end function

f
[[iff 1st non-blank]] -->
for _= to do
end for

Note: ctrl right already jumps to "to" then "do" following this

i
[[if column 1]]-->
integer _

Note: also: include (better choice of the two, or int/inc, I think)

i
[[iff 1st non-blank]] -->
if _ then
end if

"if" specials:
BACKSPACE ON TAB
[[iff 1st non-blank]] -->
else
	_

Note: the editor auto-inserts tabs for you.

BACKSPACE ON TAB[2]
[[iff BACKSPACE ON TAB was last action]] -->
elsif _ then

Note: 3rd backspace would get rid of elsif _ then in this special case

p
[[if column 1]]-->
procedure _()
end procedure

pr
[[iff 1st non-blank]] -->
printf(1,"_",{})

pu
[[iff 1st non-blank]] -->
puts(1,"_")

s
[[if column 1]]-->
sequence _

w
[[iff 1st non-blank]] -->
while _ do
end while


Or, would it be better to type eg "proc" rather than just "p".
what should happen if you continue to type "rocedure"?
what if you _meant_ "procedure rocedure()"?
Should the editor rely on you getting used to the new feature rather
than trying to second guess you?

Pete

new topic     » topic index » view message » categorize

2. Re: Pre-emptive; editor auto-completion

i would like to see a button which would re-indent the entire program. this
can be a good way to see mistakes when things are not paired correctly.

george
----- Original Message -----
From: <petelomax at blueyonder.co.uk>
To: "EUforum" <EUforum at topica.com>
Subject: Pre-emptive; editor auto-completion



This is all a bit pre-emptive; I'm just looking for initial
feedback/thoughts/other cases. There are way too many
keywords/inbuilts/win32lib calls etc etc etc, so all I want is your
top 10s. I've put my top 11 below 'cos I'm allowed to cheat.
Please try and keep things alphabetical for ease of reference.

(I've LOTS of stuff to do yet so take your time..)

====
While working on changes to Mike's editor a few thoughts have cropped
up about auto-completion.

Basically, if return or backspace puts the cursor on a blank line
[&/or eg F8], then the next one, two or three keystrokes (max) could
behave as listed below.

Alternatively/additionally ctrl+shift+key creates the templates
described below.

NOTE: Mike's editor already has auto-indent so 1st column / 1st
non-blank is already quite a natural distinction/behaviour.

Implementationwise, a few extra tests per keystroke (no parsing, no
semantics or such horrors) would have no noticeable overhead. It would
be rather trivial to piggyback this ontop of the existing macro and
undo(*) functions, it seems. [just need to subroutine the macro code]
(*) eg undo(while)==>undo(the last 17 chars "typed" [count 'em]),
  undo(procedure)==>undo last 25, etc.

In the following "rules"
_ indicates the resulting cursor position. It does NOT mean there will
be a physical space.
Any other key deactivates the function (a-z, up, down, the lot)
Backspace would have special handling such that if keyed immediately
after an auto-completion if would undo it completely and deactivate
the function. Undo (Ctrl z) would behave as backspace
in these special conditions.
There would be an option to turn this or selected bits of it off
(individual pick & choose)

a
[[if column 1]]-->
atom _

c
[[if column 1]]-->
constant _

f
[[if column 1]]-->
function _()
end function

f
[[iff 1st non-blank]] -->
for _= to do
end for

Note: ctrl right already jumps to "to" then "do" following this

i
[[if column 1]]-->
integer _

Note: also: include (better choice of the two, or int/inc, I think)

i
[[iff 1st non-blank]] -->
if _ then
end if

"if" specials:
BACKSPACE ON TAB
[[iff 1st non-blank]] -->
else
_

Note: the editor auto-inserts tabs for you.

BACKSPACE ON TAB[2]
[[iff BACKSPACE ON TAB was last action]] -->
elsif _ then

Note: 3rd backspace would get rid of elsif _ then in this special case

p
[[if column 1]]-->
procedure _()
end procedure

pr
[[iff 1st non-blank]] -->
printf(1,"_",{})

pu
[[iff 1st non-blank]] -->
puts(1,"_")

s
[[if column 1]]-->
sequence _

w
[[iff 1st non-blank]] -->
while _ do
end while


Or, would it be better to type eg "proc" rather than just "p".
what should happen if you continue to type "rocedure"?
what if you _meant_ "procedure rocedure()"?
Should the editor rely on you getting used to the new feature rather
than trying to second guess you?

Pete

new topic     » goto parent     » topic index » view message » categorize

3. Re: Pre-emptive; editor auto-completion

>i would like to see a button which would re-indent the entire program. 
> >this
>can be a good way to see mistakes when things are not paired correctly.
>
>george

I second the motion.
Maybe even provide a menu to let them customize the standard style.

MrTrick

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu