Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That's as a good question as I've recently read here, so I'll try explain the difference in more detail:</p> <p><strong>Point 1:</strong></p> <p><code>etags</code> and <code>ctags</code> both generate an index (a.k.a. tag/TAGS) file of language objects found in source files that allows these items to be quickly and easily located by a text editor or other utility. A tag signifies a language object for which an index entry is available (or, alternatively, the index entry created for that object). The tags generated by ctags are richer in terms of metadata, but Emacs cannot interpret the additional data anyways, so you should consider them more or less the same (the main advantage of <code>ctags</code> would be its support for more languages). The primary use for the tags files is looking up class/method/function/constant/etc declaration/definitions.</p> <p><code>cscope</code> is much more powerful beast (at least as far as C/C++ and Java are concerned). While it operates on more or less the same principle (generating a file of useful metadata) it allows you do some fancier things like find all references to a symbol, see where a function is being invoked, etc (you can find definitions as well). </p> <p>To sum it up:</p> <p><code>ctags</code> one allows you to navigate to symbol declaration/definitions (what some would call a <em>one-way lookup</em>). <code>ctags</code> is a general purpose tool useful for many languages.</p> <p>On the other hand (as mentioned on the project's page) <code>cscope</code> allows you to:</p> <ul> <li>Go to the declaration of a symbol</li> <li>Show a selectable list of all references to a symbol</li> <li>Search for any global definition</li> <li>Functions called by a function</li> <li>Functions calling a function</li> <li>Search for a text string</li> <li>Search for a regular expression pattern</li> <li>Find a file</li> <li>Find all files including a file</li> </ul> <p>It should come as no surprise to anyone at this point, that when I deal with C/C++ projects I make heavy use of <code>cscope</code> and care very little about <code>ctags</code>. When dealing with other languages the situation would obviously be reversed.</p> <p><strong>Point 2.</strong> </p> <p>To have intelligent autocompletion you need a true <a href="http://en.wikipedia.org/wiki/Parsing">source code parser</a> (like semantic), otherwise you won't know the types of the objects (for instance) in your applications and the methods that can be invoked on them. You can have an autocompletion based on many different sources, but to get the best results you'll ultimately need a parser. Same goes for syntax highlighting - currently syntax highlighting in Emacs major modes is based simply on regular expressions and that's very fragile and error prone. Hopefully with the inclusion of semantic in Emacs 23.2 (it used to be an external package before that) we'll start seeing more uses for it (like using it to analyse a buffer source code to properly highlight it)</p> <p>Since Emacs 24.1 semantic is usable from the Emacs completion framework. The easiest way to test it is to open up a C source code file and typing <kbd>M-TAB</kbd> or <kbd>C-M-i</kbd> and watch as semantic automagically completes for you. For languages where semantic is not enabled by default, you can add it the following line to your major mode hook of choice:</p> <pre><code>(add-to-list 'completion-at-point-functions 'semantic-completion-at-point-function) </code></pre> <p><strong>Point 3.</strong> </p> <p>semantic brings true code awareness (for the few languages it currently supports) and closes the gap between IDEs and Emacs. It doesn't really interface with tools like <code>etags</code> and <code>cscope</code>, but it doesn't mean you cannot use them together.</p> <p>Hopefully my explanations make sense and will be useful to you. </p> <p>P.S. I'm not quite familiar with <code>global</code> and <code>ebrowse</code>, but if memory serves me they made use of etags.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload