I use etags-table, available as a package from Marmalade. Install the package and put
(setq etags-table-search-up-depth 99)
in your init file. Then, then you do a tag lookup, Emacs will look for a TAGS file in the directory containing the current file and in the parent directories recursively up to 99 levels. More generally, Emacs remembers the associated ...
I'm writing a guide for Ebrowse and will release it in this week.Ebrowse is a fast parser used to process C++ source files to produce a database that contains the class hierarchy that is later processed by Emacs to produce a class tree representation. It is somewhat like GNU Global, but is built-into Emacs and produce a class tree, so it will take longer to ...
You can use https://github.com/redguardtoo/counsel-etags/blob/master/counsel-etags.el which originally called aysnc-shell-command to run shell command ctags -e -R.
Or else write your own implementation. Just three lines:
(let* ((async-shell-command-buffer 'new-buffer)
(display-buffer-alist '(("Async Shell Command" display-buffer-no-window))))
I don't have that problem, using find-tag over TRAMP resolves the filenames over TRAMP as well.
That said, that works only if the TAGS file contains relative paths (relative to the location of the TAGS file itself, therefore over TRAMP), and not absolute ones.
I guess it'd be better if in case of absolute filenames over TRAMP, the resolution was smart ...
All your attempts to set tags-table-list are errorneous.
All cases except the second one do not define a mapping of modes to alists of settings and are therefore wrong.
Only the second case remains to be discussed. In the following I add the missing closing parenthesis ):
((nil (tags-table-list ("/R/Source/R-devel-SVN/" "/gitRepos/DADS/"))))
Please be more clear about exactly what you are doing wrt "working on a local file", so people can better help you.
(From those messages, I don't think Emacs is building a TAGS file here, but it is using a TAGS file.)
If you use recentf-mode then check your recent files. If one of them is remote then that's probably your problem. Remove it and make ...
If you use Cygwin, just download Exuberant Ctags and compiled then install it; or install via Cygwin installer. Then, you can simply run:
ctags -e -R
At your project root to generate Emacs-compatible TAGS file for your project.
etags can't find any *.el files because there are none in the directory that you ran it in (see, the compile command says: default-directory "~/"). etags is not recursive. If you'd like it to be, you need to pass it file names like this:
dir /b /s *.el | etags
Or on Unix-like systems/with find:
find . -type f -iname "*.el" | xargs etags -...
You can have a nice helm interface to interactively use cscope:
We then have functions like M-x helm-cscope-find-global-definition available. The navigation is quicker.
For your use case, there's still hope though. Since you use etags, it can be used with helm-etags-select, the Helm built-in command. To use it, simply follow theses steps:
First, run the command to generate TAGS file.
Second, use find-tag to feed it to Emacs; if the TAGS file is too large and Emacs asks you to confirm, just accept it. Your whole TAGS file ...
I encountered the similar problem weeks ago and found it was caused by desktop.el: once you enable desktop-save-mode in your init file, some global variables (specified by user option desktop-globals-to-save, which includes tags-table-list by default) will be recovered and also override you own setting in init file. So if you was in the same situation, ...
You can write a hook for loading visit-tags-table:
(add-hook 'c++-mode-hook (lambda ()
(locate-dominating-file (file-name-directory (buffer-file-name)) ".git/etags"))
Although, from what I'm reading at the docs, the tags-table-list is the way to go.
EDIT: Shortened code per @phils
The etags program that comes with Emacs is a solid option. In 25.1, Eli added Ruby support, as well as fixed some parsing problems that are still present in the commonly used version of ctags.
"Why 8GB" is a good question, though. To try to answer it, you can open the generated file and look inside. The contents are mostly human-readable. Does it have ...
A tag table is a project-specific lookup index. It must be generated and updated periodically. You can use etags or ctags to do that kind of thing, I do for example run etags *.c *.h in emacs/src to index all C and header files. The resulting TAGS file is placed in the same directory and needs to be selected by M-x find-tag for it to discover definition ...
The simple solution: Use ctags -e instead of etags (assuming "Exuberant Ctags")
While man ctags explicitly says that etags is preferred for use with emacs, ctags seems to have much better fortran support. I now use:
ctags -e --recurse
# : :
# : `- Recursive processing of subdirectories.
# : Apparently also filters by ...
I'd use etags because it comes with Emacs and is what the default implementation of M-. targets.
Given a C project you can use etags *.c *.h to generate the TAGS file in that directory and select it when prompted by M-.. Some C projects already provide a Makefile target for that, for example you can run make tags in the Emacs sources to generate them for the ...
ctags supports regular expression which could be used to parse tags.
Add below code into ~/.ctags,
--regex-fortran=/^[ \t]*MODULE[ \t]+(PROCEDURE|SUBROUTINE)[ \t]+([a-zA-Z0-9_]+)/\2/s,subroutines/
hello.f is like,
MODULE PROCEDURE MySubroutineName1 ! or
MODULE SUBROUTINE MySubRoutineName2
Then run ctags -e hello.f to test.
Ctags by itself only list tag name, file path and line number.
But you can still use Emacs Lisp code to get more precise result (https://github.com/redguardtoo/counsel-etags):
Use negative file path pattern to exclude some candidates manually through ivy's filter UI (counsel-etags uses ivy)
Write lisp rules to exclude noise automatically. For example, find ...
Are my expectations realistic? I.e does the ctags system contain enough information to know that the model_ I'm clicking on belongs to the class whose member function I'm editing?
No, a TAGS file is just a list of names and where to find them. If you have duplicate names, you need to specify which one you want.
i.e. TAGS are poorly-suited to object-...
You should use the new advice system `nadvice` instead of the old one.
xref-find-definitions prompts the user already in its `interactive-form`. So you need to run `open-tags-file` in the interactive-form of your advice for the case that xref-find-definitions is called interactively.
I use the interactive specification of xref-find-definitions of emacs 25.3....
So, as it turns out, this is actually a pretty quick way to parallelize the work for generating a tags file. Here are two strategies that I've found effective. You can rewrite either shell fragment to use xargs instead of parallel.
Use GNU Parallel with the --files option to generate separate temporary files for each job.
swap ^L and \n when processing the ...
the list of tags is stored in tags-table-list, when you load a file, you know the full path of that file (C-h v buffer-file-name), so you can tweak tags-table-list by buffer-file-name and make it buffer local.
The following code demonstrates the direct use of semantic for jumping to tags.
Make sure you configured semantic-c-dependency-system-include-path right.
The following code displays the tag in another buffer.
You can adapt the code to jump to the tag if you really want that.
There should already exist something like that. But, I did not find it.
create multiple smaller TAGS in sub-directory instead of one big TAGS in root directory,
insert below code into ~/.emacs,
(setq tags-table-list "~/proj/sub-dir1/TAGS" "~/proj/sub-dir2/TAGS")
That's all you need to do.
BTW, I don't like visit-tags-table which basically just (setq tags-file-name "~/proj/TAGS"). To use tags-table-list, tags-file-name should ...
For C developers, I suggest ctags.
The problem of GNU Gloal is that it treats the function declaration as reference. That's awkward if you want to check the declaration of function ONLY. C++ code does not have this issue because function is always inside class/struct.
You can use https://github.com/redguardtoo/counsel-etags which provides everything you ...
I could think of two solutions as of now,
Speedbar mode - A separate frame pop-ups with the list of files/folders related to the current project. More Info (https://www.emacswiki.org/emacs/SpeedBar). Comes bundled with emacs. No extra tools needed.
GGtags mode - Generate tags for the project in the root directory, and navigate the source using M-., M-* etc. ...
From emacs describe-variable (SPC h d v):
tags-add-tables is a variable defined in ‘etags.el’.
Its value is nil
Original value was ask-user
Control whether to add a new tags table to the current list.
t means do; nil means don’t (always start a new list).
Any other value means ask the user whether to add a new tags table
to the current list (...