From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anselm Helbig Newsgroups: gmane.emacs.help Subject: Re: Source code navigation in emacs Date: Wed, 08 Jul 2009 10:00:46 +0200 Organization: Freie Universitaet Berlin Message-ID: <87r5wrd2oh.wl%anselm.helbig+news2009@googlemail.com> References: <87skh8dgd6.wl%anselm.helbig+news2009@googlemail.com> <3b9893450907071220i41bea8ccw3fceb20343ee422b@mail.gmail.com> <868wj0kwrk.wl%djcb@djcbsoftware.nl> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1247042575 14640 80.91.229.12 (8 Jul 2009 08:42:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jul 2009 08:42:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 08 10:42:48 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MOSjT-0001Ng-OB for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Jul 2009 10:42:28 +0200 Original-Received: from localhost ([127.0.0.1]:32921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOSjT-0004dL-5u for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Jul 2009 04:42:27 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 69 Original-X-Trace: news.uni-berlin.de eYChsAknu2PSMqy2/o8V3whGUi/xDwjxnWN6Kn1oWkZzS94i46VuU7ovGl Cancel-Lock: sha1:QuPEqipnmk1AErhTFJneX8X4sLM= In-Reply-To: Mail-Followup-To: anselm.helbig+news2009@googlemail.com Original-Xref: news.stanford.edu gnu.emacs.help:170632 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:65833 Archived-At: At Tue, 7 Jul 2009 16:53:31 -0700, n179911 wrote: > > On Tue, Jul 7, 2009 at 2:29 PM, Dirk-Jan C. Binnema wrote: > > > > Hi, > > > >>>>>> "n179911" == n179911   writes: > > > > > >    >>> Can someone please recommend what is the way to setup code navigation > >    >>> in emacs?  I have setup xcope.el with cscope run in emacs. > >    >>> > >    >>> But I read here, it said some thing about gnu global with emacs? > >    >>> http://emacs-fu.blogspot.com/2009/01/navigating-through-source-code-using.html > > > > > >    >> The most generic way is to just use a tags table, see the manual: > > > >    >> etags supports more languages than gnu global, and there is an > >    >> etags program coming with exuberant-ctags that supports even > >    >> more. There are alternative, more capable solutions for specific > >    >> programming languages. What are you working with? > > > > Anselm, is there any reason to prefer etags over GNU-Global for C/C++? I am > > quite happy with GNU-Global (I actually wrote the above blogpost) -- in what > > way would etags be better? > > > > And can you please help me understand why GNU-Global is better than > xcope.el + cscope for emacs? As I said, using tags tables is the most generic approach. Support for it has been in emacs for a long time. Any installation of emacs should also come with the etags program, which supports many different languages, compare: cscope C, C++ global C, C++, Yacc, Java and PHP4 etags (emacs 23) C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang, Forth, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl, PHP, Postscript, Python, Prolog, Scheme and most assembler-like syntaxes etags (exuberant) Asm, Asp, Awk, Basic, BETA, C, C++, C#, Cobol, Eiffel, Erlang, Fortran, HTML, Java, JavaScript, Lisp, Lua, Make, Pascal, Perl, PHP, Python, REXX, Ruby, Scheme, Sh, SLang, SML, SQL, Tcl, Vera, Verilog, Vim, YACC It doesn't do fancy stuff, e.g. keeping an index of function references. That's the kind of thing gnu global and cscope can do for you, if you're working with a language that they support. I'm using ruby and javascript at the moment, so I don't have a real alternative. I should look at CEDET again, though. 8-) HTH, Anselm -- Anselm Helbig mailto:anselm.helbig+news2009@googlemail.com