Replies: 26 comments
-
@masatake, as you may have noticed, I am already an Emacs contributor with an active copyright assignment. If you're suggesting that I can refer to @AmalKinono's code, then it doesn't really matter what its license is: if I can be considered to have copied it, then @AmalKinono will also need to do a copyright assignment. It would be easier for me simply to do a clean-room implementation if a copyright assignment is not possible. Of course, it would be best if I could use @AmalKinono's code with a copyright assignment in place. |
Beta Was this translation helpful? Give feedback.
-
As far as I know, xref-etags.el loads whole TAGS file into a buffer? @AmaiKinono's elisp doesn't load tags file into the buffer. |
Beta Was this translation helpful? Give feedback.
-
@masatake, that sounds like a useful optimization. However, especially in order to increase the chances of getting the code accepted into Emacs itself, it would be good to have a pure Elisp implementation that reads the ctags file itself. I was thinking I would start by looking at |
Beta Was this translation helpful? Give feedback.
-
I don't think extending etags.el is better. The readtags is part of u-ctags. So we can expect the readtags command is avaiable where tags file is. I would like to see https://docs.ctags.io/en/latest/man/readtags.1.html#expression, too. |
Beta Was this translation helpful? Give feedback.
-
I agree that supporting the use cases you mention is a good idea. However, as far as I can see, universal-ctags is the only implementation that supports |
Beta Was this translation helpful? Give feedback.
-
Sorry for the late reply. I'll be busy till the end of this year, but I'll keep an eye on this topic.
Actually I think I could just make it public. It's not yet finished, but it already has a comprehensive readtags interface and xref integration. I think it's a good idea to make it public so people could learn/copy from it.
Is it possible to do it online? I don't have experience sending international mail. But I'll be happy to assign one anyway.
My code is completely based on readtags, so maybe it's not a valuable reference if xref-ctags.el doesn't use readtags. I also vote for using it. As far as I know, Exuberant Ctags also comes with a readtags implementation, which is not as feature-rich as the one in u-ctags, but it can do binary search, can filter tags by prefix, so it should be enough for xref-ctags. I heard there are some other ctags implementations but I never saw them in real life, so it should be safe to assume that ctags users will have readtags on their machines. Even if xref-ctags are going to load the tags file (don't know if the RAM usage would be a problem though...), I think it's a good idea to implement binary search on our own. The |
Beta Was this translation helpful? Give feedback.
-
Just made it public. Here: https://github.com/AmaiKinono/citre I wrote a bit about the design in |
Beta Was this translation helpful? Give feedback.
-
@masatake once proposed that Emacs itself could include a readtags interface ( |
Beta Was this translation helpful? Give feedback.
-
@AmaiKinono, thank you. |
Beta Was this translation helpful? Give feedback.
-
Thanks, @AmaiKinono, I shall look at your code as soon as I can. It would be a good idea to put a copyright assignment in place if you can start that now, as it can take some time. It should be possible to do it paperlessly: please write to emacs-devel@gnu.org as described in https://www.gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html |
Beta Was this translation helpful? Give feedback.
-
I write what I know about the availablity of readtags command. Exuberant-ctags is the most popular ctags implementation. However, "make install" target of Exuberant-ctags doesn't install its readtags command. |
Beta Was this translation helpful? Give feedback.
-
Thanks, @masatake, I didn't know there was a (non-installed) version of But I think I will start with @AmaiKinono's code: it seems like it may be possible already to use |
Beta Was this translation helpful? Give feedback.
-
Oh, it is not my intention. What I would like to write is that I recommend you to assume it is u-ctags' readtags if readtags is there. |
Beta Was this translation helpful? Give feedback.
-
http://emacs.1067599.n8.nabble.com/gtags-ctags-etags-cscope-support-td478663.html#a478669 |
Beta Was this translation helpful? Give feedback.
-
I have found some time to look at citre. Unfortunately there is no README at present, but I managed to install it and get I cannot find a Vala parser or branch in universal-ctags at the moment; am I missing something? So instead, I used anjuta-ctags (which we've discussed before), since its As far as I can see, all that |
Beta Was this translation helpful? Give feedback.
-
I think @masatake's main concern is to have a built-in client tool in Emacs, rather than a package that could be "easily installed" (though the latter is also important and needed). |
Beta Was this translation helpful? Give feedback.
-
That will be much harder to persuade the developers of: why would the Emacs developers want to take on the burden of several thousand lines more elisp? It cannot be because of the readtags functionality, because for that they would have to take universal-ctags itself upstream into Emacs. (That would be nice!) The obvious question would be "why does Emacs need ctags support when it already has etags support, and universal-ctags can already output in etags format?" |
Beta Was this translation helpful? Give feedback.
-
Umm, first I didn't meant to merge Citre into GNU Emacs, in case you may misunderstood it.
We could make
Ah, this is a real question... maybe @masatake have an answer. I'd say the ctags format is simply better. If you edit the source file, then use Citre to find a definition in it, it could still find the right line most of the time. This is because ctags uses a search pattern to locate a line, so it's still useable after editing. This can't be done using etags format. Also, u-ctags offers many useful fields that could offer additional annotations in the xref UI. Citre uses the But yes, I understand that things are not accepted by Emacs just because they are cool. The reasons I gave looks insufficient even to myself. |
Beta Was this translation helpful? Give feedback.
-
@AmaiKinono I think we're going round in circles here. I suggested a straightforward ctags interface, but @masatake said they preferred support for |
Beta Was this translation helpful? Give feedback.
-
We can discuss on these things. But, maybe it's better to hear how Emacs people think of it (if we could) than we three trying to decide on a design here. |
Beta Was this translation helpful? Give feedback.
-
@AmaiKinono, it depends what "it" is. What's the suggestion? I can certainly write to the Emacs developers' list with a concrete proposal. Of course, it's better if it's for something for which code already exists :) As I said, I think the best thing would be ctags support that mirrors the current etags support. However, it's not very useful in the short term. In the long term it would be great if Emacs could drop etags support altogether (from both Emacs itself, and from Emacs's implementation of ctags). |
Beta Was this translation helpful? Give feedback.
-
@rrthomas, the branch is at #2677 . I wonder it is possible to write a useful tags file frontend without readtags. I run ctags and etags on the source tree of Linux kernel.
tags output is larger than 600MB. However, this tags file is optimized in size. An alternative approach for avoiding to load tags file into a buffer is integrating libreadtags, |
Beta Was this translation helpful? Give feedback.
-
Supporting huge tags files comes with the price of introducing external dependencies. Considering
I actually have some alternative ideas:
|
Beta Was this translation helpful? Give feedback.
-
Just a note to say that I found the vala branch of @masatake's ctags repo, so I will be using |
Beta Was this translation helpful? Give feedback.
-
@rrthomas, please note that the branch will be rebased frequently. |
Beta Was this translation helpful? Give feedback.
-
@masatake noted, thanks! |
Beta Was this translation helpful? Give feedback.
-
@rrthomas has an interest in this topic.
@AmaiKinono has some good code in @AmaiKinono's private repo.
I think we can it as a base. It is GPL'ed. So, in my understanding, referring to it never becomes an issue for our future contribution for GNU/Emacs. See https://www.emacswiki.org/emacs/Copyright_Assignment to know what I care about.
@AmaiKinono, are you still be in busy?
I would like you to add @rrthomas to your private repo.
Beta Was this translation helpful? Give feedback.
All reactions