LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-21-2003, 07:02 PM   #1
skibud2
Member
 
Registered: Sep 2003
Location: Waltham MA
Distribution: Mandriva 2007 w/ KDE
Posts: 87

Rep: Reputation: 15
emacs-autocomplete


I have been very unsuccessful in getting autocomplete to work in emacs. I can get the M-/ to work (for general variable completion). I would like to get this type of completion to work:

#include <stdio.h>
int main()
{
pri (hit something to autocomplete to get printf. In MS Visual studio,
I would just hit ctrl-spc)
return EXIT_SUCCESS;
}

I don't know if this is possible in emacs. Hopefully it is.

Thanks

-Mike

By the way, I did a bunch of searches in the manuals and on the web and I have not had any luck.
 
Old 09-21-2003, 07:11 PM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
im not a big user of emacs but i think you need to run etags with the option to go into system header files, then load the tags file into emacs and use M-<TAB> to complete the word.
 
Old 09-21-2003, 07:33 PM   #3
skibud2
Member
 
Registered: Sep 2003
Location: Waltham MA
Distribution: Mandriva 2007 w/ KDE
Posts: 87

Original Poster
Rep: Reputation: 15
do you know what the option is to go into the system header files? I looked in the man files and could not find it.
 
Old 09-21-2003, 07:50 PM   #4
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
it doesnt look like there is one(i was only guessing), i think the best solution would be to produce a tags file for each major library you use then if you want to use it in your current project pass the -i option to etags.
 
Old 09-21-2003, 07:54 PM   #5
skibud2
Member
 
Registered: Sep 2003
Location: Waltham MA
Distribution: Mandriva 2007 w/ KDE
Posts: 87

Original Poster
Rep: Reputation: 15
I tried etags /usr/include/c++/3.2.2/iostream -l c++ -o ~/iostreamTAG for example , then
etags test.cpp -i iostreamTAG where test.cpp is the program above with cout instead of printf. I am not getting autocompletion .

Thanks for all your help so far
 
Old 09-21-2003, 08:14 PM   #6
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
ive just been playing about with it and i can get it to pick up classes but not variables, its too late for me, i'll have another go tomorrow.

you could just write yourself a tags file of all the objects/functions your gonna use most often.
 
Old 09-22-2003, 08:27 AM   #7
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
ive had a quick play with it this morning and have discovered the following,
  • it doesnt work if you specify -l c++ to etags
  • by passing --member to etags i can get it to put cin/cout in the tags file but emacs wont autocomplete them
  • emacs will only autocomplete if im in C++ abbrev mode

sorry i couldnt be of more help but i dont use autocomplete(i can type an identifier quicker than i can press M-<TAB>) Dark_Helmet might know this but i havnt seen him around for a while.

Last edited by kev82; 09-22-2003 at 08:28 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
edb (emacs database) won't open file - emacs 20 & 21 tip184 Linux - Software 0 04-03-2004 07:31 AM
command - autocomplete ethanchic *BSD 8 04-26-2003 12:02 AM
autocomplete figadiablo Linux - General 6 03-13-2002 04:19 PM
autocomplete marksstroud Linux - Newbie 1 11-11-2001 01:02 PM
Autocomplete in Redhat hazza96 Linux - General 9 06-24-2001 11:13 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration