geany/doc/html/ch03s07.html
Enrico Tröger 011fcde8ea Updated for Geany 0.11.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1551 ea778897-0a13-0410-b9d1-a72fbfd435f5
2007-05-21 15:24:27 +00:00

78 lines
7.0 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Tags</title><link rel="stylesheet" href="geany.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="index.html" title="Geany 0.11"><link rel="up" href="ch03.html" title="Chapter 3. Usage"><link rel="prev" href="ch03s06.html" title="Search, replace and go to"><link rel="next" href="ch03s08.html" title="Preferences"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Tags</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s06.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Usage</th><td width="20%" align="right"> <a accesskey="n" href="ch03s08.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tags"></a>Tags</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2811464"></a>Workspace tags</h3></div></div></div><p>
Tags for each document are parsed whenever a file is loaded or saved. These are
shown in the Symbol list in the Sidebar. These tags are also used for autocompletion
and calltips in other documents open in the current session.
</p><p>
The <span class="emphasis"><em>Go to Tag</em></span> commands can be used with all workspace tags.
See <a href="ch03s06.html#search_gototag" title="Go to tag definition">the section called “Go to tag definition”</a>.
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="tags_global"></a>Global tags</h3></div></div></div><p>
Global tags are used to provide autocompletion and calltips without having to open
the corresponding source files. This is intended for library APIs, as the tags file
only has to be updated when you upgrade the library.
</p><p>
You can load a custom global tags file in two ways:
</p><div class="itemizedlist"><ul type="disc"><li><p>Using the <span class="emphasis"><em>Load Tags</em></span> command in the File menu.
</p></li><li><p>By creating a directory <code class="filename">~/.geany/tags</code>,
and moving or symlinking the tags files there before starting
<span class="application">Geany</span>.
</p></li></ul></div><p>
</p><p>
You can either download these files or generate your own.
They have the format:
</p><p>
<code class="filename">libraryname.lang_ext.tags</code>
</p><p>
<span class="emphasis"><em>lang_ext</em></span> is one of the extensions set for the filetype
associated with the tags. See <a href="ch04s02.html" title="Filetype extensions">the section called “Filetype extensions”</a> for more
information.
</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2811571"></a>Default global tags files</h4></div></div></div><p>
For some languages, a list of global tags is loaded when the corresponding filetype
is first used. Currently these are for:
</p><div class="itemizedlist"><ul type="disc"><li><p>C - GTK+ and GLib</p></li><li><p>Pascal</p></li><li><p>PHP</p></li><li><p>HTML - <code class="literal">&amp;symbol;</code> completion, e.g.
for ampersand, copyright, etc.</p></li><li><p>LaTeX</p></li></ul></div><p>
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="tags_generating"></a>Generating a global tags file</h4></div></div></div><p>
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Filetypes support</h3><p>
Currently this is not yet supported for Pascal, PHP and LaTeX filetypes.
</p></div><p>
</p><p>
You can generate your own global tags files by parsing a list of source files.
The command is:
</p><p>
geany -g &lt;Tag File&gt; &lt;File list&gt;
</p><p>
</p><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Tag File</em></span> should be in the format described
earlier - see <a href="ch03s07.html#tags_global" title="Global tags">the section called “Global tags”</a>.</p></li><li><p><span class="emphasis"><em>File list</em></span> is a list of filenames, each with
a full path (unless you are generating C/C++ tags and have set the CFLAGS
environment variable appropriately).</p></li></ul></div><p>
</p><p>
Example for the wxD library for the D programming language:
</p><pre class="programlisting">geany -g wxd.d.tags /home/username/wxd/wx/*.d</pre><p>
</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2811688"></a>Generating C/C++ tag files</h5></div></div></div><p>
For C/C++ tag files, <code class="filename">gcc</code> and <code class="filename">grep</code> are
required, so that header files can be preprocessed to include
any other headers they depend upon.
</p><p>
For C/C++ files, the environment variable CFLAGS should be set with appropriate
<code class="literal">-I/path</code> include paths.
The following example works with the <code class="filename">bash</code> shell, generating
tags for the GnomeUI library:
</p><pre class="programlisting">CFLAGS=`pkg-config --cflags libgnomeui-2.0` geany -g gnomeui.c.tags
/usr/include/libgnomeui-2.0/gnome.h</pre><p>
</p><p>
You can adapt this command to use CFLAGS and header files appropriate for
whichever libraries you want.
</p><p>
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Replacing the default C/C++ tags file</h3><p>
<span class="application">Geany</span> currently uses a default global tags file
<code class="filename">global.tags</code>
for C and C++, commonly installed in <code class="filename">/usr/share/geany</code>. This
file can be replaced with one containing tags parsed from a different set of
header files. When <span class="application">Geany</span> is next started, your custom
tags file will be loaded instead of the default <code class="filename">global.tags</code>.
You should keep a copy of the generated
tags file because it will get overwritten when upgrading
<span class="application">Geany</span>.
</p><p>This is a temporary solution - in later versions this will be unnecessary.
</p></div><p>
</p></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s08.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Search, replace and go to </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Preferences</td></tr></table></div></body></html>