Jose,

Something I've experimented with, though never put into 'factor.el' is an 
electric ';' key.

The ':' is shifted and it's used often. The idea is to overload the ';' key:

    If you're not in a word definition, insert ':'

    If you are in a word definition, insert ';'

A bare-bones implementation which simply checks if you're at the beginning of 
a line is:

(defun factor-insert-colon ()
  (interactive)
  (if (bolp)
      (insert ":")
    (insert ";")))

And of course:

(define-key factor-mode-map ";" 'factor-insert-colon)

That's "level one" functionality. :-) Level two is a little wackier:

If you're not in a word definition, insert a word template:

    : | ( -- ) ;

The cursor will be placed where the '|' is located. You type the word name. If 
you press ';' again the cursor will jump to the effect-in area:

    : breatharian ( | -- ) ;

You type some effects:

    : breatharian ( diet-coke quarter-pounder| -- ) ;

You press ';' again, you jump to the effect-out area:

    : breatharian ( diet-coke quarter-pounder -- | ) ;

Type the out:

    : breatharian ( diet-coke quarter-pounder -- 5th-dimension| ) ;

Hit ';' to jump to the word body:

    : breatharian ( diet-coke quarter-pounder -- 5th-dimension )
        | ;

Enter the body:

    : breatharian ( diet-coke quarter-pounder -- 5th-dimension )
        "$25,000,000" donate| ;

Finally, hit ';' to jump out of the word:

    : breatharian ( diet-coke quarter-pounder -- 5th-dimension )
        "$25,000,000" donate ;

    |

I don't think this kind of "electric key" behaviour is for everybody, but it 
might be worth experimenting with. Definately should be easy to opt out 
of. :-) Maybe even be off by default.

Another possibility is using the ']' key to close the current expression (i.e. 
it might insert '}' or ']').

We type double quotes a whole lot more often than single quotes. Maybe the 
single-quote key should insert a double-quote.

Finally, crazy stuff like 'paredit.el' is also interesting. I.e. navigating 
Factor code in semantic chunks.

Ed

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to