Anyone use ELSE minor-mode in Emacs?

Peter Milliken peterm at
Wed Dec 10 21:13:23 CET 2003

I use it - but then I'm the author :-)

I am hopeful that the "time to learn it" is very short. Probably the
quickest way to get to learn it is to use the "tokens" i.e. enable the
else-mode minor mode in a .py file and type in "def" and then run the
else-expand-placeholder command (C-c / e - this key encoding is "forced" on
Emacs minor mode authors by Emacs expansion conventions - I use F3
personally :-)). and you should get the appropriate code structure.
Similarly, type in "classC-c / e" and you'll get a class structure.

Then just "expand" every "placeholder" until you start to get a feel for
where it leads. If you stick with just the "tokens" at first, then you'll
quickly get an idea of what ELSE can do. Using "placeholders" follows fairly
naturally from token expansions.

If you don't want to handle the menus etc of using placeholders straight off
the bat then that's no problem, just type directly into a placeholder and it
will disappear and get out of your face :-)

Once you have used it for a while and (hopefully :-)) find it useful, then
perhaps venture into the users manual. I hope I have laid it out reasonably
well, so you can focus in on the areas that interest you.

Please do not stay with the minor mode key-bindings as the idea of ELSE is
to reduce typing - having to type C-c / x all the time where "x" is "e, p,
n, or k" defeats the entire purpose - but those are the "rules" for minor
mode creators in Emacs :-) That is why the ELSE manual recommends that one
of the first priorities is the creating of a convenient key-binding. I use:

F3 - else-expand-placeholder
F4 - else-next-placeholder
F5 - else-previous-placeholder
F6 - else-kill-placeholder

I have a version of else-mode.el that has a command else-show-tokens - this
is useful to quickly see what "tokens" are available for expansion using
this mechanism. At the moment with the current released version of ELSE, you
have to browse the individual language file to see what strings are defined
as tokens. Token definitions are always at the end of the file, BTW :-) Let
me know if you want a copy of that version - I am behind a firewall at work,
so updating the web-site always has to wait for when I have the time to get
on the Internet at home - something that can take weeks to do sometimes :-)

As a general rule, any "keyword" is defined as a token i.e. return, if, def,
try, while etc etc - try them to see what you get :-) It is very easy to
define your own "tokens" (shortcuts for want of a better term), the manual
describes all of this or you could just look at the language template files
for examples.

As for what it does for me - it saves me typing (use it properly and your
main coding experience is the entry of variable names etc) and with more
syntactically strict languages such as C etc it saves me having to type in
{}'s and ;'s :-) If you use ELSE for a language like C then you never get a
compiler error saying you have missed a } or a ; - surely a big time saving

The whole idea behind ELSE is to save typing - which means higher
productivity and allows the programmer to focus on the problem at hand -
writing a program to meet a need. The programmer shouldn't be distracted
from the job at hand worrying about whether they got the language syntax
correct or not :-)

Hope this helps,


"Christian Seberino" <seberino at> wrote in message
news:bf23f78f.0312091603.f91c1e7 at
> I am looking at the ELSE home page and trying to figure out if I should
> invest the time to learn about the ELSE minor mode for Emacs.
> Is there any programmer out there using ELSE that is getting great
> benefit from it?
> What does ELSE minor-mode for Emacs do that is so great for you?
> Chris

More information about the Python-list mailing list