all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* hippie-expand customization challenge. Possible??!!
@ 2005-10-21 10:09 Sune
  2005-10-21 15:41 ` Eric Ludlam
  0 siblings, 1 reply; 3+ messages in thread
From: Sune @ 2005-10-21 10:09 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: hippie-expand customization challenge. Possible??!!
  2005-10-21 10:09 hippie-expand customization challenge. Possible??!! Sune
@ 2005-10-21 15:41 ` Eric Ludlam
  2005-10-21 19:01   ` Sune
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Ludlam @ 2005-10-21 15:41 UTC (permalink / raw)


You might want to look at the CEDET / Semantic tools which already
does something similar to what you are looking to do.

http://cedet.sf.net/semantic.shtml

Eric

>>> "Sune" <sune_ahlgren@hotmail.com> seems to think that:
>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
>

-- 
Eric Ludlam                    The MathWorks x 7556  eludlam@mathworks.com
http://www.siege-engine.com                       http://www.mathworks.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: hippie-expand customization challenge. Possible??!!
  2005-10-21 15:41 ` Eric Ludlam
@ 2005-10-21 19:01   ` Sune
  0 siblings, 0 replies; 3+ messages in thread
From: Sune @ 2005-10-21 19:01 UTC (permalink / raw)


Hi Eric!

I had a look at this package before mailing, but it seems to be
overkill to load such a huge package into Emacs when I only(?) want the
above mentioned feature addition.

I'm afraid it may interfere with some other stuff I have already
loaded. An updated hippie-expand and dabbrev are just enough for me...

Thanks for the hint anyway
Sune

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-21 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-21 10:09 hippie-expand customization challenge. Possible??!! Sune
2005-10-21 15:41 ` Eric Ludlam
2005-10-21 19:01   ` Sune

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.