From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Ludlam Newsgroups: gmane.emacs.help Subject: Re: hippie-expand customization challenge. Possible??!! Date: Fri, 21 Oct 2005 11:41:08 -0400 Organization: The MathWorks, Inc., Natick, MA 01760 Message-ID: References: <1129889394.623547.258430@g49g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129912177 1895 80.91.229.2 (21 Oct 2005 16:29:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Oct 2005 16:29:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 21 18:29:27 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ESziu-0002AK-4a for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Oct 2005 18:26:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ESzit-00017E-HX for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Oct 2005 12:26:27 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!nx01.iad01.newshosting.com!newshosting.com!216.196.98.140.MISMATCH!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!news.mathworks.com!not-for-mail Original-Newsgroups: comp.emacs,gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: ludlamelinux.dhcp.mathworks.com Original-X-Trace: fred.mathworks.com 1129909274 13151 144.212.109.174 (21 Oct 2005 15:41:14 GMT) Original-X-Complaints-To: news@mathworks.com Original-NNTP-Posting-Date: Fri, 21 Oct 2005 15:41:14 +0000 (UTC) User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:JcQQKhPbfwp72jkS4a33Ti/LEcI= Original-Xref: shelby.stanford.edu comp.emacs:90394 gnu.emacs.help:134855 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:30442 Archived-At: 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" 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 => 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 > >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