⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 faq

📁 ultraEdit的Ctag标签工具的实现源代码
💻
📖 第 1 页 / 共 2 页
字号:
Frequently Asked Questions
==========================

    * 1.  Why do you call it "Exuberant Ctags"?
    * 2.  Why doesn't my editor work with these tag files?
    * 3.  What are these strange bits of text beginning with ;"?
    * 4.  Why doesn't XEmacs' Speedbar module work with Exuberant Ctags?
    * 5.  Why doesn't Xemacs correctly locate the tag in the source file?
    * 6.  Why doesn't NEdit correctly locate the tag in the source file?
    * 7.  Why can't I jump to "class::member"?
    * 8.  How can I avoid having to specify my favorite option every time?
    * 9.  Why do I end up on the wrong line when I jump to a tag?
    * 10.  How do I jump to the tag I want instead of the wrong one by the
           same name?
    * 11.  What is "Vim"?
    * 12.  How can I locate all references to a specific function or variable?
    * 13.  Why does appending tags to a tag file tag so long?
    * 14.  How do I get regex support for Win32?
    * 15.  How should I set up tag files for a multi-level directory hierarchy?

  ----------------------------------------------------------------------
1.  Why do you call it "Exuberant Ctags"?

Because one of the meanings of the word "exuberant" is:

    exuberant : produced in extreme abundance : PLENTIFUL syn see PROFUSE

Compare the tag file produced by Exuberant Ctags with that produced by any
other ctags and you will see how appropriate the name is.

  ----------------------------------------------------------------------
2.  Why doesn't my editor work with these tag files?

3.  What are these strange bits of text beginning with ;" which follow
    many of the lines in the tag file?

These are "extension flags". They are added in order to provide extra
information about the tag that may be utilized by the editor in order to
more intelligently handle tags. They are appended to the EX command part of
the tag line in a manner that provides backwards compatibility with existing
implementations of the Vi editor. The semicolon is an EX command separator
and the double quote begins an EX comment. Thus, the extension flags appear
as an EX comment and should be ignored by the editor when it processes the
EX command.

Some non-vi editors, however, implement only the bare minimum of EX commands
in order to process the search command or line number in the third field of
the tag file. If you encounter this problem, use the option "--format=1" to
generate a tag file without these extensions (remember that you can set the
CTAGS environment variable to any default arguments you wish to supply). Then
ask the supplier of your editor to implement handling of this feature of EX
commands.

  ----------------------------------------------------------------------
4.  Why doesn't XEmacs' Speedbar module work with Exuberant Ctags?

The default command line switches used by XEmacs for "etags" are not
compatible with Exuberant Ctags options. By default, Exuberant Ctags installs
a symbolic link, "etags", pointing to the ctags executable. When Exuberant
Ctags is started with the name "etags", it produces Emacs-style tag files by
default.

To fix this, add the following lines to your .emacs file, replacing the path
to "etags" with the path where the symbolic link was installed.

(autoload 'speedbar "speedbar")
(setq speedbar-fetch-etags-command "/usr/local/bin/etags"
      speedbar-fetch-etags-arguments '("-f" "-"))

  ----------------------------------------------------------------------
5.  Why doesn't Xemacs correctly locate the tag in the source file?

This has been observed with version 20.3. It seems that when Xemacs searches
for a tag, it searches using the tag name instead of the search string located
in the TAGS file. This is a bug in Xemacs and does not occur in the GNU
version of Emacs.

  ----------------------------------------------------------------------
6.  Why doesn't NEdit correctly locate the tag in the source file?

Versions of NEdit prior to 5.1 did not support the extended tag file format
generated by Exuberant Ctags by default. Either upgrade to version 5.1 or
specify the option "--format=1" when running ctags to output the old tag file
format.

  ----------------------------------------------------------------------
7.  Why can't I jump to "class::member"?

Because, by default, ctags only generates tags for the separate identifiers
found in the source files. If you specify the --extra=+q option, then
ctags will also generate a second, class-qualified tag for each class member
(data and function/method) in the form class::member for C++, and in the form
class.method for Eiffel and Java.

  ----------------------------------------------------------------------
8.  How can I avoid having to specify my favorite option every time?

Either by setting the environment variable CTAGS to your custom
options, or putting them into a .ctags file in your home directory.

  ----------------------------------------------------------------------
9.  Why do I end up on the wrong line when I jump to a tag?

By default, ctags encodes the line number in the file where macro (#define)
tags are found. This was done to remain compatible with the original UNIX
version of ctags. If you change the file containing the tag without
rebuilding the tag file, the location of tag in the tag file may no longer
match the current location.

In order to avoid this problem, you can specify the option "--excmd=p",
which causes ctags to use a search pattern to locate macro tags. I have
never uncovered the reason why the original UNIX ctags used line numbers
exclusively for macro tags, but have so far resisted changing the default
behaviour of Exuberant Ctags to behave differently.

  ----------------------------------------------------------------------
10.  How do I jump to the tag I want instead of the wrong one by the
     same name?

A tag file is simple a list of tag names and where to find them. If there
are duplicate entries, you often end up going to the wrong one because the
tag file is sorted and your editor locates the first one in the tag file.

Standard Vi provides no facilities to alter this behavior. However, Vim
has some nice features to minimize this problem, primarly by examining all
matches and choosing the best one under the circumstances. Vim also provides
commands which allow for selection of the desired matching tag.

  ----------------------------------------------------------------------
11.  What is "Vim"?

Vim is a vi-compatible editor available as source and compilable for any
platform. Yeah, I know the first reaction is to shy away from this. But you
will never regret getting it, and you will become greatly attached to its
features, which you can learn gradually. I would be willing to say that it
is the best vi-clone available within 4 light-years of Alpha Centauri. It
works (nearly) exactly like standard vi, but provides some incredibly useful
extensions (some of which I have participated in designing with the author).
Most Linux distributions have adopted Vim as its standard vi.

  ----------------------------------------------------------------------
12.  How can I locate all references to a specific function or variable?

There are several packages already available which provide this capability.
Namely, these are: GLOBAL source code tag system, GNU id-utils, cscope,
and cflow. As of this writing, they can be found in the following locations:

GLOBAL:    http://www.gnu.org/software/global
id-utils:  http://www.gnu.org/software/idutils/idutils.html
cscope:    http://cscope.sourceforge.net
cflow:     ftp://www.ibiblio.org/pub/Linux/devel/lang/c

  ----------------------------------------------------------------------
13.  Why does appending tags to a tag file tag so long?

Sometimes, in an attempt to build a global tag file for all source files in
a large source tree of many directories, someone will make an attempt to run
ctags in append (-a) mode on every directory in the hierarchy. Each time
ctags is invoked, its default behavior is to sort the tag file once the tags
for that execution have been added. As the cumulative tag file grows, the sort
time increases arithmetically.

The best way to avoid this problem (and the most efficient) is to make
use of the --recurse (or -R) option of ctags by executing the following
command in the root of the directory hierarchy (thus running ctags only once):

        ctags -R

If you really insist on running ctags separately on each directory, you can
avoid the sort pass each time by specifying the option "--sort=no". Once the
tag file is completely built, use the sort command to manually sort the
final tag file, or let the final invocation of ctags sort the file.

  ----------------------------------------------------------------------
14.  How do I get regex support for Win32?

You need to download the GNU regex package for Win32 from the following
location:

    http://people.delphiforums.com/gjc/gnu_regex.html

Then point the makefile macro, REGEX_DIR, found in mk_mvc.mak and mk_bc5.mak,
to the directory created by extracting this archive.

  ----------------------------------------------------------------------
15.  How should I set up tag files for a multi-level directory hierarchy?

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -