Hot answers tagged

18

aha! (setq tags-add-tables nil) seems to do the trick


6

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 ...


6

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 ...


5

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)))) ...


5

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 ...


4

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/")))) Nevertheless,...


3

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 ...


2

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.


2

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 -...


2

You can have a nice helm interface to interactively use cscope: http://wikemacs.org/wiki/Python#Indexing_sources:_ctags.2C_cscope.2C_pycscope https://github.com/sergey-pashaev/helm-cscope We then have functions like M-x helm-cscope-find-global-definition available. The navigation is quicker.


2

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 ...


2

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, ...


2

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


2

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 ...


2

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 ...


2

Thank you. I've reproduced it in the current master and pushed a fix: 770db45d6769. If you don't build Emacs from Git, you can try applying this patch to your currently installed version.


2

The simple solution: Use ctags -e instead of etags (assuming "Exuberant Ctags"[1]) 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 ...


2

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 ...


1

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. See https://duckduckgo.com/?...


1

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 ...


1

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-...


1

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....


1

You can generate the TAG file like this: find . -name "*.py" | xargs etags -a Then in .emacs file: (setq tags-table-list (list "/path/to/TAG/file/dir/"))


1

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 ...


1

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. BTW, you need create individual TAGS for each language. For example, one TAGS for javascript, another TAGS for PHP. That's pretty easy if you follow ...


1

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. (defun ...


1

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 ...


1

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 ...


1

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. ...


1

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 Documentation: 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 (...


Only top voted, non community-wiki answers of a minimum length are eligible