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

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

Re: Fire defun by typing keyword


From: Emanuel Berg
Subject: Re: Fire defun by typing keyword
Date: Tue, 05 Nov 2013 03:50:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Again, it would work just as abbrev, only instead of
>> a table lookup and replace, it would trigger a defun.
>
> An abbrev can have a "hook", which is indeed a
> function that gets called after inserting the
> expansion.  So, you can do the above with an abbrev
> like
>
>   ("mydate" "" date)

Yes, I can confirm that this works. Setup as just
another abbrev (so abbrev mode must be enabled). Also,
it is dynamic in the sense that `date' doesn't have to
be defined at the time the abbrev is setup; also, if
date is changed, this is immediately reflected the next
time you type "mydate". So it is the same old
super-dynamic dynamigth that you expect from (almost)
all Elisping.

But, apart from inserting the date, I don't know what to
do with this newfound input method. That's always the
case with my great ideas, I only find but a few use
cases for each...

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


reply via email to

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