I am a Linux user (world was pretty neat; less to no headache)-- I've been using vim with cscope to wade through huge code-base....... And for some reason, now I have to use windows machine, here are the things I do have on my PC

git-bash; downloaded Emacs (I start to love it); and within the Emacs package has ctags.exe.

So, I am trying to create the tag file from git-bash

~/Downloads/emacs-26.3-x86_64/bin/ctags.exe -R *

The tag file gets created, but it skips the source code present in the directories, after running the above command I get

bin: Permission denied
contrib: Permission denied
crypto: Permission denied
doc: Permission denied
etc: Permission denied
games: Permission denied
gnu: Permission denied
include: Permission denied
initrd: Permission denied
lib: Permission denied
libexec: Permission denied
nrelease: Permission denied
sbin: Permission denied

Really not sure what I am doing wrong here-- even ran git-bash as an administrator, tried creating tag file from cmd by running it as an admin, yet no luck-- same issue.

What can I do to fix this?

1 Answer 1


I got the answer. Thanks to Eli Zaretskii<eliz@gnu.org>, Gist: ctags on windows won't work on directories.

You are invoking 'ctags' incorrectly: it needs a list of file names to open and scan. You used the wildcard "*" which matches all the files, including the directories, and 'ctags' on Windows cannot open and scan directories, only files.

What you probably want is this instead:

$ find . -name '.[chm]' -o -name '.el' | ~/Downloads/emacs-26.3-x86_64/bin/ctags -

(This assumes you have a GNU 'find' command reachable from the git-bash where you run this.)

Also found this https://www.emacswiki.org/emacs/BuildTags manual, which I ignored initially, because I though when used the switch -R * ctags can recur on directories and build DB out of files, but it wasn't the case and the error it reported Permission denied also added more confusions to the puzzle.

  • ctags should have -e option, quoted from ctags documentation, it "Enable etags mode, which will create a tag file for use with the Emacs editor"
    – chen bin
    Jan 2, 2020 at 14:06
  • How does it either relate to the question or the answer?
    – RaGa__M
    Jan 2, 2020 at 16:53
  • The original cli find . -name '.[chm]' -o -name '.el' | ~/Downloads/emacs-26.3-x86_64/bin/ctags - can NOT create tags file Emacs can parse. You missed the -e option.
    – chen bin
    Jan 3, 2020 at 2:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.