> -----Original Message----- > From: Sebastian Zaha > Sent: venerdì 19 agosto 2005 21.57 > To: jed-users-l@xxxxxxxxxxxxxx > Subject: Dabbrev issues > > > Hello. > > I've checked out the dabbrev mode and I've been thinking > about creating > some functions that will load the included .h libraries as > buffers (when > editing C code) as to favor code-completion. > I'm wondering if this has been done before (I couldn't find > anything on the > net). Or if there is another way to do this thing in a better way. > Well, I must say that I agree with Marko, using ctags could easy a lot this problem. you can try loading the tags file to a buffer (i.e. '*funcnames*'), removing anything but the names, and binding a key to 'dabbrev("*funcnames*"). I haven't tried it, but it should work. You may find useful for this my 'new' tags engine, it can load more than one tags file (e.g. I can tag all the headers in /usr/include, keep the file somwhere, and use both this file and the tags file from the program I'm working on), cicle between all the matches, tries to find the first match in a clever way (not "the first one"). But this may be interesting for you because optionally it gives these functions: intellijed() - shows a message with the parameters for a function: very nice if bound to the '(' key. intellijed_insert() - as above, but inserts the parameters in the buffer. intellipointer() - given a variable, finds the definition of the *variable type*. All this at http://www.paneura.com/~dino/ntags.html. I am a heavy user of dabbrev, but I want a bit more: I wanted expansion of function and variable names for SLang and C (but also other languages), but also structure member expansion, and function parameters expansion. Other people wrote custom completion systems (e.g. sltabc from klaus schmid, or complete from Paul Boekholt at http://jedmodes.sourceforge.net/mode/complete/) All this is possible if we can write a function that knows the rules for the file I'm editing, and generates the completions based on context. So I wrote a file that does it: it acts as a generic completion system (but is able to do a 'dabbrev like expansion'), and some 'backends': a slang completion system (it gets the names from _apropos()) and a C completion system (it can get symbols using 'nm' on an executable, or from a tags file). Note that it's not finished: it depends too much of having a word prefix, it can register only one completion routine, and should be converted to use 'keys' hooks. Anyways, maybe it can help you. I have attached the needed files to this mail, as I have never released those before. Put all the files in a directory within JED_LIBRARY_PATH, except jed.rc: it's an examble of what you need to write in your .jedrc. > Thanks in advance. > Well, I have not a solution for you, but a lot of code to read :-) hope this helps, Dino
Attachment:
bufmake.sl
Description: Binary data
Attachment:
complete.sl
Description: Binary data
Attachment:
sl_compl.sl
Description: Binary data
Attachment:
c_compl.sl
Description: Binary data
Attachment:
jed.rc
Description: Binary data