all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Peter Milliken" <peter.milliken@gmail.com>
To: "Xah Lee" <xahlee@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: is there summary of template systems for emacs?
Date: Tue, 16 Dec 2008 07:21:27 +1100	[thread overview]
Message-ID: <791153ba0812151221g432b1a1ep972c93ab19391fd7@mail.gmail.com> (raw)
In-Reply-To: <791153ba0812151048iacb4a7ag423e14f24b2ac166@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 10683 bytes --]

Well, I wasn't going to do this (project deadlines you know? Hope my project
manager doesn't monitor this list !:-)) but I couldn't resist...

Just had a quick look at the YaSnippet video on YouTube and the
documentation - without a detailed analysis I didn't see YaSnippet do
anything that ELSE doesn't do. It certainly prompted me to think - "what is
the history of YaSnippet? Did they look at ELSE before they put in this
work?" :-)

The documentation doesn't look that extensive (again, I just browsed it, so
I may well be doing it an injustice - or perhaps ELSE's documentation is too
"verbose"? I do tend to write so a 14 year old could understand - and some
people don't appreciate that! :-)). For example, "transformations" was an
interesting section (personally not sure I would bother with it though :-)),
but I was left wondering - "what are the list of available transformations?"
i.e. capitalize was mentioned in the example - are there more? If so, where
are they documented?

I didn't see any facility in YaSnippet for "cascading" templates at all i.e.
ELSE allows "expansion" of templates that lead to lower (and more detailed)
template structures. A crude example would be when you first invoke
else-mode in a new (and empty) file, it will automatically insert the
initial placeholder e.g.

{compilation_unit}

which, when expanded (C language template used as an example) to:

[module_level_comments]
[{include_files}...]

[{data_types_or_declarations}...]

[{function_definition}...]

[main_function]

Each item enclosed in {}'s or []'s are "placeholders" that can be easily
navigated to and expanded or deleted as required. Most of the placeholders
above lead to more detailed templates when expanded.

YaSnippet implements what are defined as "tokens" in ELSE - there is no
equivalent to the ELSE "placeholder", so there is no auto-repeating feature
in YaSnippet e.g. the ELSE (C language) template for the switch statement
looks like this (this is my "customised" version - not from the release
files):

switch ({expression})
{
    case {constant_expression}:
    [case {constant_expression}:]...
        [statement]...
        break;
    [case_part]...
    default :
        [statement]...
        break;
}

Note that the first "case" portion has an optional case placeholder below it
- the ellipses (...) after the closing ']' indicate that if the user chooses
to expand this then it will be "repeated" automatically by ELSE on either
the next line or the same line (ELSE allows either or tries to determine
from context) i.e. after an expansion of the second case placeholder, you
have:

switch (type_of_fruit)
{
    case ORANGE:
    case APPLE:
    [case {constant_expression}:]...
        [statement]...
        break;
    [case_part]...
    default :
        [statement]...
        break;
}

When the user decides that a placeholder (text enclosed by either {}'s or
[]'s) is nolonger required/desired then the placeholder can be deleted with
a single command/keystroke.

I presume that new "snippets" are easily defined - ELSE allows the user to
modify a definition "on the fly" by allowing the extraction of the
definition in the current buffer and then re-compilation for that session.
If the change looks like being "permanent", then the changed definition can
be saved in the users language customisation template file - which brings to
mind something that YaSnippet doesn't do - cater for multiple users with
common project coding standards. ELSE allows for loading two template files
per major mode - firstly a <lang>.lse file (which would come from a common
project directory) and then a <lang>-cust.lse file which could come from the
users local directory - the user places their own pet template definitions
in the later file (which don't violate the project coding standards! :-)).
The later template file can "override"/replace any definitions from the
primary template file.

Don't get me wrong though - I do like the look of YaSnippet. It has a very
concise definition syntax by the look of it and it is more straightforward
in allowing the definition of "mirrors" than ELSE (ELSE allows/implements
"mirrors" but the mirror definition is usually removed one level from where
it is used). It has a nice "look and feel" to it - it is not intrusive like
skeleton et el.

So I believe that ELSE does "more" - whether your typical user would
consider the "more" to be worth while or not, is entirely problematical! :-)

Pete


On Tue, Dec 16, 2008 at 5:48 AM, Peter Milliken <peter.milliken@gmail.com>wrote:

> Hi Xah,
>
> Well, I use gmail to manage all of the mailing lists I am on - makes it
> much easier to keep track of things as it keeps track of the threads and
> everything for me :-)
>
> I might have a look YaSnippet and possibly make comments on the Emacs Wiki
> page as to how it compares - something which is sometimes not easy because
> many packages have strengths and weakness, so drawing comparisons is not
> always straight forward! :-)
>
> I have done some experimentation with generating "autocompletion" with ELSE
> templates in the past (autocompletion in the sense of the user trying to
> complete a function call) - this was done with Python. From memory it went
> quite well, but I never polished it off and took it to completion - probably
> because of the general lack of desire in people to have autocompletion or
> template systems in general i.e. why put in work when nobody will use it?
> :-)
>
> Anyway, all the best with your efforts, I see a lot of emails from you on
> the mailing list, so you are obviously putting a lot of effort into using
> Emacs and trying to make it better! So thanks for that :-)
>
> Pete
>
>
> On Mon, Dec 15, 2008 at 8:37 AM, Xah Lee <xahlee@gmail.com> wrote:
>
>> 2008-12-14
>>
>> On Dec 7, 11:14 am, "Peter Milliken" <peter.milli...@gmail.com> wrote:
>> > Hi Xah,
>> >
>> > I'd be interested in your opinion of ELSE. I haven't tried some of the
>> > others that you mention - ELSE suits me fine. I have tried tempo and
>> > skeleton etc but were turned off by the "intrusive" and horribly awkward
>> > interfaces that they presented to the user. I had been exposed to DEC's
>> LSE
>> > in the past (circa 1985), and found that it didn't "get in my face" or
>> cause
>> > awkward usage problems, so I decided to "port" their language sensitive
>> > editor functionality to Emacs (hence E(macs)LSE :-)).
>> >
>> > But facilities such as ELSE, tempo, skeleton etc are obviously not very
>> > popular (which I have never been able to understand!) i.e. I have shown
>> many
>> > fellow programmers ELSE over the years and not a single one of them has
>> ever
>> > taken up it's use. In fact, through all the time ELSE has been available
>> on
>> > the Internet, I have only ever received less than 10 queries/expressions
>> of
>> > interest in it - which may argue that it just doesn't hit the mark! :-)
>> But
>> > given the alternatives that were available (especially in the "early
>> days")
>> > I don't think that was the case. Of course, these days, it is even less
>> > likely because Emacs just isn't that popular as an editor i.e. there are
>> > probably 30 - 40 programmers at my current place of employ and there is
>> only
>> > one other programmer here that uses Emacs - so the opportunities for
>> > creating "converts" are not good at all!
>> >
>> > ELSE does not use (e)lisp like syntax. It has it's own template file for
>> > generating new templates. It has (what I believe is) extensive
>> documentation
>> > - something that has always annoyed me about many Emacs packages (such
>> as
>> > tempo and skeleton) - when they were first available it was very much
>> "read
>> > the code and examples" - I believe that has changed for skeleton but I
>> had
>> > long since lost interest by the time somebody rectified that!
>> >
>> > So I would echo Drew's call - by all means do a comparison and share the
>> > results if you can with us all.
>> >
>> > Peter
>> >
>> > On Wed, Dec 3, 2008 at 11:34 AM, Drew Adams <drew.ad...@oracle.com>
>> wrote:
>> > > > there seems to be a lot elisp packages for defining templates. Has
>> > > > anyone studied them and can give a comparison? Basically, i just
>> need
>> > > > a brief explanation of their syntax and feature.
>> >
>> > > > the emacswiki page
>> > > >http://www.emacswiki.org/emacs/CategoryTemplates
>> > > > is very helpful in listing them but a clear summary and comparison
>> is
>> > > > lacking. here's what i found so far....
>> >
>> > > Good idea. Please update the wiki with a summary of the info you found
>> and
>> > > whatever else comes out of this thread that might be helpful. The next
>> > > person
>> > > who looks where you did will then find that missing help. ;-)
>>
>> Hi Peter,
>>
>> Sorry i missed your post. (i use google groups and sometimes i miss
>> posts. (regular newsgroup client won't help much in this regard))
>>
>> Anyway, i've followed Drew's advice and cleaned up the emacswiki a bit
>> based on what i've studied.
>>
>> http://www.emacswiki.org/emacs/CategoryTemplates
>>
>> though, i haven't looked into ELSE. Right now i pretty much settled on
>> yasnippet.
>>
>> I really feel sorry emacs's user base is dying. The most important
>> thing i think is to get emacs to use modern terminologies and be
>> compatible with the minimum of standard modern UI. On the Mac, emacs
>> modernization is a huge success with Aquamacs Emacs, which is emacs
>> with pretty much complete Mac OS X UI. On Windows, there's EmacsW32 by
>> Lennart Borgman, but i think it primarily just changes emacs the Alt
>> key to conform to Window's Alt=Menu behavior and the core philosophy
>> of EmacsW32 is a emacs add-on improvement, as opposed to a whole,
>> complete, "download and use it" software. If Lennart would change his
>> philosophy and marketing a bit, i think it'd complete revolutionize
>> emacs overnight, together with Aquamacs, solves the emacs
>> modernization problem like XEmacs did 18 years ago.
>>
>> In this year since June, i've filed 40 bug reports to bug-gnu-emacs.
>> (
>> http://groups.google.com/group/gnu.emacs.bug/search?q=xah&start=0&scoring=d&
>> )
>> About maybe 20 has been fixed. About maybe only 5 of my all reports
>> are suggestions. (these are really conservative ones, most of these
>> suggestions are suggested by other developers's encouragement for
>> sending it to bug-gnu-emacs, as opposed to my owe ideas of critical
>> modernization issues) Roughly, anything that's not bugs are either
>> receives no reply, or marked as not bug with a explanation (e.g. emacs
>> does it THIS way), or piled to "wish list".
>>
>>  Xah
>> ∑ http://xahlee.org/
>>
>> ☄
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 13092 bytes --]

  reply	other threads:[~2008-12-15 20:21 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02  2:53 is there summary of template systems for emacs? Xah Lee
2008-12-02  4:28 ` Xah Lee
2008-12-03  0:34 ` Drew Adams
2008-12-07 19:14   ` Peter Milliken
     [not found]   ` <mailman.2168.1228677280.26697.help-gnu-emacs@gnu.org>
2008-12-14 21:37     ` Xah Lee
2008-12-15 18:24       ` Distributed Maintenance for Emacs (was: is there summary of template systems for emacs?) Leo
2008-12-15 18:45         ` Distributed Maintenance for Emacs Paul R
2008-12-15 18:48       ` is there summary of template systems for emacs? Peter Milliken
2008-12-15 20:21         ` Peter Milliken [this message]
2008-12-15 19:46       ` Drew Adams
     [not found]       ` <mailman.2806.1229365513.26697.help-gnu-emacs@gnu.org>
2008-12-15 19:31         ` Emacs's popularity (was: Distributed Maintenance for Emacs) Teemu Likonen
2008-12-15 20:42           ` Peter Milliken
2008-12-15 21:09           ` Jonathan Groll
2008-12-15 21:37             ` Emacs's popularity Teemu Likonen
2008-12-15 21:41               ` Lennart Borgman
     [not found]               ` <mailman.2823.1229377291.26697.help-gnu-emacs@gnu.org>
2008-12-15 22:28                 ` Richard Riley
2008-12-15 22:59                   ` Lennart Borgman
     [not found]                   ` <mailman.2834.1229381955.26697.help-gnu-emacs@gnu.org>
2008-12-15 23:40                     ` Richard Riley
2008-12-16  0:53                       ` Lennart Borgman
     [not found]                       ` <mailman.2836.1229388824.26697.help-gnu-emacs@gnu.org>
2008-12-16  1:01                         ` Richard Riley
2008-12-16  8:37                           ` Lennart Borgman
     [not found]                           ` <mailman.2845.1229416641.26697.help-gnu-emacs@gnu.org>
2008-12-16 10:41                             ` Richard Riley
2008-12-16  2:37                       ` Charles philip Chan
2008-12-16 10:09                       ` Tim X
2008-12-16 11:20                         ` Richard Riley
     [not found]                       ` <mailman.2843.1229395204.26697.help-gnu-emacs@gnu.org>
2008-12-16 10:17                         ` Tim X
2008-12-16 11:34                     ` Phil Carmody
2008-12-16 11:58                       ` Juanma Barranquero
     [not found]                       ` <mailman.2853.1229428708.26697.help-gnu-emacs@gnu.org>
2008-12-16 12:36                         ` Phil Carmody
2008-12-16 12:52                           ` Juanma Barranquero
     [not found]                           ` <mailman.2855.1229431948.26697.help-gnu-emacs@gnu.org>
2008-12-16 13:03                             ` Phil Carmody
2008-12-16 14:07                               ` Juanma Barranquero
     [not found]                               ` <mailman.2858.1229436444.26697.help-gnu-emacs@gnu.org>
2008-12-16 15:09                                 ` Phil Carmody
2008-12-16 15:50                                   ` Richard Riley
2008-12-16 17:43                                     ` Andrea Vettorello
2008-12-16 16:05                                   ` Juanma Barranquero
2008-12-16 16:21                                   ` Paul R
     [not found]                                   ` <mailman.2867.1229443519.26697.help-gnu-emacs@gnu.org>
2008-12-16 17:15                                     ` Richard Riley
2008-12-17  1:35                                     ` Phil Carmody
2008-12-16 16:56                       ` Andreas Politz
2008-12-17  1:34                         ` Phil Carmody
2008-12-17  7:43                       ` Tim X
2008-12-17 14:17                         ` B Smith-Mannschott
2008-12-15 23:55               ` Óscar Fuentes
     [not found]               ` <mailman.2835.1229385349.26697.help-gnu-emacs@gnu.org>
2008-12-16 10:21                 ` Tim X
2008-12-16 12:35               ` William Case
2008-12-15 22:03             ` Emacs's popularity (was: Distributed Maintenance for Emacs) Drew Adams
2008-12-15 22:07               ` Lennart Borgman
2008-12-15 22:19                 ` Drew Adams
2008-12-15 22:22                   ` Lennart Borgman
     [not found]                   ` <mailman.2830.1229379766.26697.help-gnu-emacs@gnu.org>
2008-12-16 10:33                     ` Emacs's popularity Tim X
2008-12-16 13:18                   ` Emacs's popularity (was: Distributed Maintenance for Emacs) Jonathan Groll
2008-12-16 17:46                     ` Drew Adams
2008-12-19  2:10                       ` Sean Sieger
2008-12-18 16:30               ` David L
2008-12-18 17:50                 ` Drew Adams
2008-12-19 16:53                   ` David L
2008-12-19 17:20                     ` Drew Adams
2008-12-19  2:37                 ` Sean Sieger
     [not found]             ` <mailman.2825.1229378627.26697.help-gnu-emacs@gnu.org>
2008-12-16 10:22               ` Tim X
2008-12-16 11:56                 ` Richard Riley
2008-12-16 18:29                   ` Drew Adams
2008-12-15 22:49           ` Emacs's popularity Teemu Likonen
2008-12-16  2:10           ` Giorgos Keramidas
2008-12-15 21:28         ` Distributed Maintenance for Emacs (was: is there summary of template systems for emacs?) Richard Riley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=791153ba0812151221g432b1a1ep972c93ab19391fd7@mail.gmail.com \
    --to=peter.milliken@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=xahlee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.