# test1 **Repository Path**: mygit245/test1 ## Basic Information - **Project Name**: test1 - **Description**: test1 - **Primary Language**: C - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-11-13 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README This is an extension to GNU Emacs and X-Emacs TAGS functionality, with a server-side component that narrows down the view of a potentially large TAGS file and serves the narrowed view over the wire for better performance. Emacs Lisp client, python client, and vim extensions supplied. List of files: gtags.cc - server (this is required) etags.el - GNU Emacs etags implementation (comes with GNU Emacs, required for Xemacs) gtags.py - python library to talk to the server gtags.sh - shell implementation to talk to server gtags.vim - vim client gtags_vim.py - support for vim client rtags.py - callgraph indexing for java, python, c/c++ gentags.py - create indexes for java, python, c/c++ EMACS commands: google-first-tag: The equivalent of Emacs's built-in find-tag. We recommend google-show-tag-locations instead. google-next-tag: Cycles between all tags. (To be used with google-first-tag) google-show-tag-locations: Enter the name of the identifier you're searching on. If there's only one place where the identifier is defined, then EMACS takes you to that definition. If there are multiple matches, then GTAGS will pop up a new window with the identifier, the path to the file (relative to the top of google3), and a snippet showing the declaration. Click on any of the items (or hitting enter after moving the cursor into the relevant region) will take you to the definition. google-show-tag-locations-regexp: lets you enter a regular expression. google-pop-tag will return you to the context from which you did google-show-tag-locations. google-show-matching-tags: pops up a window showing all tags in the tags database that match. The window that google-show-matching-tags open is a special GTAGS mode that will automatically do a google-show-tag-locations on the tag that your cursor is one when you hit ENTER google-show-callers: will show you who all the callers of a particular function are. google-show-tag-locations-under-point,google-show-callers-under-point: just like the similarly named functinos, but eliminates the prompt and just use whatever your cursor is currently pointed at for the moment. google-search-definition-snippets: search all the definition lines. You can also use regular expressions. google-list-tags: see all the tags for a particular file in a concise, alphabetized form. It defaults to the file opened by the current buffer. In Emacs, whenever you're asked for the name of the tag you want to look up, you can press TAB for completion in the usual Emacs way. Setting up: Run gentags.py from the top level of the source tree. This generates TAGS, TAGSC, JTAGS, JTAGSC, PTAGS, and PTAGSC. (The postfix "C" indicates this shows the callers) After the TAGS file is done, run the gtags server: gtags TAGS 2223 (The first argument is the name of the TAGS database. The second argument is the PORT.) Point your EMACS at the appropriate server by setting the google-tags-host-port-alist: (setq google-tags-host-port-alist '((c++-mode . (("localhost" . 2223))))) Then run google-show-tag-locations. To prevent denial-of-service attacks, google-show-matching-tags and google-show-tag-locations-* return at most 1000 results, so if you have too many results the server won't be kept busy showing just results that are of interest to you. google-show-matching tags also works in two modes. If a user types just text (without regular expression wildcards), then google-show-matching-tags will perform a partial match and show everything with the string in it. Otherwise, google-show-matching-tags will only perform a full match. GDoc mode M-x gdoc-mode turns on gdoc mode. gdoc-mode brings up two windows, one to show an "implicit search" over whatever your cursor is hanging over, and the other to show a "best guess" as to what you might be interested in as you browse. To turn off gdoc-mode, type M-x gdoc-mode again. (We'll admit that gdoc-mode could use some improvements, but it'll be interesting to see what others make of it) Non-Emacs Users gtags.py contains a python library that talks to the gtags server exactly the same way EMACS does. You can use this to augment any python-capable editor to provide the same functionality. GTags on the command-line Sitaram Iyer wrote a command-line script interface to gtags. This is generally useful for browsing code with less on the command line, and wanting to look up a tag (definition or invocation) as you go along. Usage and examples follow.
  Command-line interface to gtags.

  Usage: gtags.sh [flags] tag ...
  flags:
    -L|--lang c++|java|python|szl # language of source files to look in
    -w|--word                     # match whole word only (same as ^tag$)
    -i|--invocations              # match invocations *and* definitions of tag
    -v|--vi  |  -l|--less         # emit vi or less commands instead of file:line
    -r|--restrict <google3_dir>   # restrict matches to google3/<dir>/
    --color | --nocolor           # override "use ansi colors if isatty(stdout)"

  (tip: may be convenient to alias 't' to gtags.sh)

  Example usage:                   gtags.sh -w -r mapreduce Output
  which is equivalent to:          gtags.sh --color ^Output$ | grep \ mapreduce/

  For invocations and definitions: gtags.sh -i -w -r mapreduce Output
  Emit vi cmds for cut-and-paste:  gtags.sh -v -w -r mapreduce Output
Credits - Piaw Na wrote the gtags server and the initial elisp implementation - Arthur Gleckler wrote many elisp extensions (including gdoc-mode) - Laurence Gonsalves wrote the VIM extensions - Sitaram Iyer wrote the shell interface - Ken Ashcraft provided much needed assistance for multi-server support - Arun Sharma provided the autoconf and portable Make support