473,473 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Anyone use ELSE minor-mode in Emacs?

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
Jul 18 '05 #1
6 1847
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,

Peter
"Christian Seberino" <se******@spawar.navy.mil> wrote in message
news:bf*************************@posting.google.co m...
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

Jul 18 '05 #2
Peter

Hello! Thank you very much for your detailed reply to my
comp.lang.python post about ELSE. I downloaded the
else-mode.el file and was able to load it. I'm having problems
getting the Python template file loaded (Python.lse).

Can I put this in my home directory and/or specify the path
to it instead of placing it somewhere else? Can I load
it from Emacs myself??

Also, Python doesn't have as much junk as C to type.
Is ELSE still useful in Python since Python has no
braces, semicolons, etc. that one needs to automate?

Chris
--
_______________________________________

Christian Seberino, Ph.D.
SPAWAR Systems Center San Diego
_______________________________________


"Peter Milliken" <pe****@resmed.com.au> wrote in message news:<D7*****************@nnrp1.ozemail.com.au>...
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,

Peter
"Christian Seberino" <se******@spawar.navy.mil> wrote in message
news:bf*************************@posting.google.co m...
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

Jul 18 '05 #3
[Christian Seberino]
Also, Python doesn't have as much junk as C to type. Is ELSE still
useful in Python since Python has no braces, semicolons, etc. that one
needs to automate?


I used ELSE for Python for prototyping the overall structure of modules
(beginning shebang and comments, an empty doc-string, my usual Main
class, and the usual stanza "if __name__ == 'main', etc." stanza at the
end. ELSE may be useful to start a class, including the skeleton for
"def __init__(self):". And also for a few other tiny own habits. As
far as I am concerned, besides the few things above, Python is so clean
that ELSE was not as useful that it may be for other languages.

P.S. - If I'm using past instead of present, about ELSE, this is because
not so long ago, I switched my habits away from Emacs (towards Vim).

--
François Pinard http://www.iro.umontreal.ca/~pinard

Jul 18 '05 #4
François Pinard <pi****@iro.umontreal.ca> writes:
[...]
P.S. - If I'm using past instead of present, about ELSE, this is because
not so long ago, I switched my habits away from Emacs (towards Vim).


Why?

Interesting to see an emacs 'power user' switch to vi. But maybe you
were originally a vi user, and have just had a long emacs detour?
John
Jul 18 '05 #5
[John J. Lee]
François Pinard <pi****@iro.umontreal.ca> writes:
[...]
P.S. - If I'm using past instead of present, about ELSE, this is because
not so long ago, I switched my habits away from Emacs (towards Vim).
Why? [...] But maybe you were originally a vi user, and have just had
a long emacs detour?


No. You cannot imagine how much I could not stand `vi' for myself. On
machines without Emacs or some form of Emacs clone, I was using `ed', or
even `sed', just for avoiding finding myself stuck within `vi'. So, to
see myself using Vim now, represents an astonishing conversion! :-)

The "Why?" is a bit difficult to tell in a few words. Especially since
I still consider Emacs as a wonder. I explained my reasons to a few
friends and saved my notes, and I'll probably turn them into some Web
page if I find some more free time. Let me post the URL here then...

Let me say right away is that I would have never ever considered Vim if
it did not offer proper Python support. Pymacs seems more powerful to
me that Python in Vim, yet Python in Vim is neat and quite usable.

Vim surprisingly has many functionalities, under paradigms which vary
slightly or greatly, which I thought Emacs was alone to offer. This
helped me to "swallow the snake", which admittedly has been rough :-).

--
François Pinard http://www.iro.umontreal.ca/~pinard

Jul 18 '05 #6
Francois,

I was disappointed when I read of your "defection". However, I can perhaps
understand it. I have participated in "constructive" "my editor is better
than your editor" threads over in comp.editors in the past. Vim has an
impressive array of tricks - the discussion basically came to a "draw" with
the only thing that I use in Emacs that Vim couldn't offer was ELSE - enough
for me to stay with Emacs! :-)

Allow me to summarise it all with the following:

From ``The Zen of Programming'':

Hearing a disturbance, The master programmer went into the novices
cubicle.

``Curse these personal computers!'' cried the novice in anger, ``To
make them do anything I must use three or even four editing
programs. Sometimes I get so confused that I erase entire files.
This is truly intolerable!''

The master programmer stared at the novice. ``And what would you
do to remedy this state of affairs?'' he asked.

The novice thought for a moment. ``I will design a new editing
program,'' he said, ``a program that will replace all these others.''

Suddenly the master struck the novice on the side of his head. It
was not a heavy blow, but the novice was nonetheless surprised.
``What did you do that for?'' exclaimed the novice.

``I have no wish to learn another editing program,'' said the
master.

And suddenly the novice was enlightened.
Emacs did it all at a time when there was no other editor that had the
features and worked across/on all platforms - now that other editors have
"caught up", I see no reason to change :-)

Peter

"François Pinard" <pi****@iro.umontreal.ca> wrote in message
news:ma*************************************@pytho n.org...
[John J. Lee]
François Pinard <pi****@iro.umontreal.ca> writes:
[...]
P.S. - If I'm using past instead of present, about ELSE, this is because
not so long ago, I switched my habits away from Emacs (towards Vim).
Why? [...] But maybe you were originally a vi user, and have just had
a long emacs detour?


No. You cannot imagine how much I could not stand `vi' for myself. On
machines without Emacs or some form of Emacs clone, I was using `ed', or
even `sed', just for avoiding finding myself stuck within `vi'. So, to
see myself using Vim now, represents an astonishing conversion! :-)

The "Why?" is a bit difficult to tell in a few words. Especially since
I still consider Emacs as a wonder. I explained my reasons to a few
friends and saved my notes, and I'll probably turn them into some Web
page if I find some more free time. Let me post the URL here then...

Let me say right away is that I would have never ever considered Vim if
it did not offer proper Python support. Pymacs seems more powerful to
me that Python in Vim, yet Python in Vim is neat and quite usable.

Vim surprisingly has many functionalities, under paradigms which vary
slightly or greatly, which I thought Emacs was alone to offer. This
helped me to "swallow the snake", which admittedly has been rough :-).

--
François Pinard http://www.iro.umontreal.ca/~pinard
Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: EKL | last post by:
What do I have to do to guarantee that the objects that my code creates are reclaimed by only minor garbage collection runs? In other words, what do I have to do to only generate garbage for minor...
27
by: Ron Adam | last post by:
There seems to be a fair amount of discussion concerning flow control enhancements lately. with, do and dowhile, case, etc... So here's my flow control suggestion. ;-) It occurred to me (a...
8
by: MS | last post by:
Hello, I have a form with a LoanRequired field which accepts numeric data only. If user enters >14900 then I want the user to continue as normal with the default form. If user enters <1000 then...
8
by: Siv | last post by:
Hi, Does anyone have a function that when called returns which operating system we are running on. E.g: Select Case GetOSVer() Case 1 'Win95 ... Case 2 'Win98 ... Case 3 'Win98SE
5
by: Geoff Jones | last post by:
Hi Does anybody use the Visual Basic Resource Kit? I have a question about it and I've either discovered a bug in it or have a problem with my installation. Geoff
3
by: MLH | last post by:
Some sites I've rolled out mde's to allow user to press F-11 & bring up database window. Others do not. Anybody know what setting controls this? Strange is that the app is the same in each...
66
by: QuantumG | last post by:
Decompilation is the process of recovering human readable source code from a program executable. Many decompilers exist for Java and .NET as the program executables (class files) maintain much of...
0
by: custom | last post by:
First off, I don't know very much about programming. My problem is, I have a lottery program written in 1989, and I need minor changes made to it so I can use it. I did find the Borland name, but...
1
by: Slain | last post by:
I am a new hire in a company and have started working for the development team. Ofcourse, I took some C++ courses in my grad school, but there is such a big difference in the programs you encounter...
2
by: dp_pearce | last post by:
I have some code that takes data from an Access database and processes it into text files for another application. At the moment, I am using a number of loops that are pretty slow. I am not a...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.