[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: abbrevs and cursor control
From: |
Harry Putnam |
Subject: |
Re: abbrevs and cursor control |
Date: |
Sat, 15 Feb 2003 03:18:53 GMT |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) |
kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:
> Harry Putnam <hgp@sbcglobal.net> writes:
>
>> After poring over C-h f define-abbrev I got sort of close I guess, but
>> this:
>>
>> (define-abbrev TABLE NAME EXPANSION &optional HOOK COUNT SYSTEM-FLAG)
>>
>> Though its the kind of thing lisp programmers consider the epitome of
>> lucid. Its not very helpfull to laypeople. No indication of where
>> parens might go or other really usefull stuff.
>>
>> I tried this:
>>
>> (define-abbrev cperl-mode-abbrev-table "hpb" "" hp-pbase 0 )
>
> (define-abbrev cperl-mode-abbrev-table "hpb" "" 'hp-pbase)
>
> Does this work?
Yes.. and thanks. I'm not sure how long I would have stumbled around
before I hit that particular combination.
>
>> This piece from C-h f:
>> If EXPANSION is not a string, the abbrev is a special one,
>> which does not expand in the usual way but only runs HOOK.
>>
>> Kind of sounds like EXPANSION shouldn't be a string at all. Not even
>> the empty one "".
>
> Yes, try nil instead of "". You already know more about
> define-abbrev than I do :-)
It doesn't work that way:
(define-abbrev cperl-mode-abbrev-table "hpb" nil 'hp-pbase)
So I guess the confusing line from C-h f does mean the empty string
("")..
But now that I see how to do it... my abbrev powers have increased by
several orders of magnitude. Won't be long before:
(define-abbrev cperl-mode-abbrev-table "npscr" "" 'hp-newp)
Will insert a functional debugged full bore search application.
Oh, how might I have spotted the correct syntax.. from the help
provided?