[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
hippie-expand customization challenge. Possible??!!
From: |
Sune |
Subject: |
hippie-expand customization challenge. Possible??!! |
Date: |
21 Oct 2005 03:09:54 -0700 |
User-agent: |
G2/0.2 |
Hi all!
I want to use hippie-expand for C function completion. I've but
together a script which parses my header files and lists them one by
one like so:
foo1( prm1, prm2);
goo2( prm1, prm2);
in a file I call emacs_auto_comp.
First I have updated hippie expand to only expand like below:
(setq hippie-expand-try-functions-list '(try-expand-line-all-buffers))
(setq hippie-expand-only-buffers '("emacs_auto_comp"))
This works good if I type
f<expand-key> => foo1( prm1, prm2);
from the beginning of a line.
BUT if I want to expand from the middle of the row say I have already
written:
if( f
and hit my <expand-key>
I get 'No expansion found' from Emacs.
I want it to work like this:
- From current cursor position go backwards until you find either a
beginning-of-line or a space ' ' character.
- Use only what was found from the initial cursor position to whichever
of the 2 cases stopped your back tracing when performing expansion.
In the example above :
'f' was found, then space broke the back tracing
- Use the token found (in the example 'f') and expand as if 'f' was
found in the beginning of the line.
=> if( foo1( prm1, prm2);
(I can live with the semicolon being added)
I am not Elisp-clever enough to make this happen. Are you?
Thanks a LOT
/Sune
- hippie-expand customization challenge. Possible??!!,
Sune <=