gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: snippet.el -- TextMate-like templates


From: Kevin Rodgers
Subject: Re: snippet.el -- TextMate-like templates
Date: Tue, 28 Jun 2005 13:40:57 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Nic Ferrier wrote:
> This is not necessary. The more natural elisp would be this:
>
>   (define-abbrev python-mode-abbrev-table
>     "for"
>     ""
>     (let ((fn
>            (lambda ()
>              (snippet-insert
>               "for $${element} in $${sequence}:"))))
>       (put 'fn 'no-self-insert t)
>       fn))
>
> Which isn't *so* onerous.

But it is confusing:

define-abbrev is a function, so all its arguments are evaluated.  The
4th argument is the let form, which returns a list:
(lambda () (snippet-insert ...))

The let form also sets the fn symbol's no-self-insert property, which
can't possibly have any effect on the expansion of the abbreviation
since the lambda doesn't reference the symbol.

--
Kevin Rodgers





reply via email to

[Prev in Thread] Current Thread [Next in Thread]