Emacs is my favorite editor, I started to use it since 2003 after graduating from high school, I can't image working on Unix-like environment without it, just like driving a car without steering wheel. Emacs is so Powerful, so flexible and so complex, I can't thoroughly explain how to use it. Instead I only focus on how to navigate through FreeEMS source code
1.First download GNU gtags package
2.Use Emacs compile mode to configure, compile and install package
3.Locate gtags elisp extension file and open it
Use Emacs to navigate through FreeEMS source code
Use Emacs to navigate through FreeEMS source code
Last edited by HotCat on Wed Jan 18, 2012 6:39 am, edited 1 time in total.
Re: Use Emacs to navigate through FreeEMS source code
4.Follow the comments to configure your emacs
5.Navigate to FreeEMS source directory and run shell command 'gtags' from Emacs
6.Three file should be generated
Re: Use Emacs to navigate through FreeEMS source code
7.Explore what gtags can do with our source code, use 'gtags-parse-file' command to list C functions in a C source file and locate the function body
Press 'enter' key to locate the function body
here it is
Last edited by HotCat on Wed Jan 18, 2012 6:23 am, edited 3 times in total.
Re: Use Emacs to navigate through FreeEMS source code
8.Find the macro definition of 'cliConfiguredOffset' using 'gtags-find-tag' command
Place cursor around the 'cliConfiguredOffset' variable and issue 'gtags-find-tag' command Press 'enter' key to locate whatever definition you prefer to see See how it was defined for Hyundai
Place cursor around the 'cliConfiguredOffset' variable and issue 'gtags-find-tag' command Press 'enter' key to locate whatever definition you prefer to see See how it was defined for Hyundai
Last edited by HotCat on Wed Jan 18, 2012 6:36 am, edited 5 times in total.
Re: Use Emacs to navigate through FreeEMS source code
9.Find the definition of 'calculateFuelAndIgnition' using 'gtags-find-tag' command
Place cursor around the 'calculateFuelAndIgnition' function and issue 'gtags-find-tag' command here it is
Place cursor around the 'calculateFuelAndIgnition' function and issue 'gtags-find-tag' command here it is
Last edited by HotCat on Wed Jan 18, 2012 6:31 am, edited 1 time in total.
Re: Use Emacs to navigate through FreeEMS source code
10.Find how the function was referenced using 'gtags-find-rtag' command
Place cursor around the 'generateDerivedVars' function and issue 'gtags-find-rtag' command There maybe a few candidates, press 'enter' key to choose which one you love it Here it is
Place cursor around the 'generateDerivedVars' function and issue 'gtags-find-rtag' command There maybe a few candidates, press 'enter' key to choose which one you love it Here it is
Last edited by HotCat on Wed Jan 18, 2012 6:35 am, edited 4 times in total.
Re: Use Emacs to navigate through FreeEMS source code
11.Sometimes you have to use 'gtags-find-symbol' command to locate some macro definition
When 'gtags-find-tag' command does not work, try this one you must choose Here it is
When 'gtags-find-tag' command does not work, try this one you must choose Here it is
Last edited by HotCat on Wed Jan 18, 2012 6:58 am, edited 2 times in total.
Re: Use Emacs to navigate through FreeEMS source code
End of this topic, thanks for watching ![Cheeky :lol:](./images/smilies/icon_lol.gif)
![Cheeky :lol:](./images/smilies/icon_lol.gif)
Re: Use Emacs to navigate through FreeEMS source code
HotCat, cool article, this is the most inspired I've EVER been to use emacs! (More than when my best friend tried to convince me) Still not enough to actually do it, though :-)
If you want to edit it freely in future I can leave it here, or I can promote it to article status in the article section. If I do that, though, you have to ask me to get it edited.
LOL @ johntramp :-)
Fred.
If you want to edit it freely in future I can leave it here, or I can promote it to article status in the article section. If I do that, though, you have to ask me to get it edited.
LOL @ johntramp :-)
Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!