ivalkeen / guard-ctags-bundler

Guard gem for generating ctags for project files and gems from project's bundle.
https://github.com/ivalkeen/guard-ctags-bundler
MIT License
108 stars 24 forks source link

merge tags and gems.tags to TAGS for emacs #4

Closed antono closed 12 years ago

antono commented 12 years ago

to avoid extra configs for emacs

antono commented 12 years ago

@diasjorge yep. i saw this part and i just do not want to call visit-tags-table twice for project and gem tags. Nice catch about run_on_change. Fix added.

ivalkeen commented 12 years ago

I'm using VIM and I don't want to merge these 2 files because of sorting. Vim by default uses binary search for tags, which is very fast, but requires tags file(s) to be sorted. When you merge them into one, they become unsorted and binary search doesn't work. I'm sure that searching for tags in 2 sorted tagfiles is much faster than searching in one unsorted. Besides, tag files contain header, which is duplicated when merging and becomes incorrent (because it says that file is sorted). But I don't know how emacs work with tags. If you guys sure, thay it is not the case for emacs, I will merge it.

diasjorge commented 12 years ago

In my opinion this doesn't need to be merged, there are some alternatives to this.

http://www.emacswiki.org/emacs/EtagsSelect http://www.emacswiki.org/emacs/EtagsTable

I haven't had anytime to make a configuration for emacs...although you can just use visit-tags-table function

antono commented 12 years ago

@diasjorge , @ivalkeen i've added this merge in order to avoid manual emacs tweaking. its up to you. i'll keep it in my fork anyway :)

svperfecta commented 12 years ago

+1 - For emacs is much easier to have a single file generated.

ivalkeen commented 12 years ago

Any ideas about how it should be done?

antono commented 12 years ago

@ivalkeen proposed patch works for me as expected. Without this patch i have to visit both files first time when i need my tags.

ivalkeen commented 12 years ago

Yes, but resulting file is incorrect (unsorted and with 2 headers). Получается же что у него 2 шапки, причем одна в середине, плюс в шапке написано что он сортированный, а на самом деле он получается не сортированный, поэтому поиск может косячить или как минимум просто медленнее работать. Я думал над решением вырезать одну шапку вручную и через sort прогнать, тогда файл валидный будет, но теряется приоритет локальных тегов над гемовскими (что мне очень нравится в решении с 2-мя файлами). Есть мысли?

diasjorge commented 12 years ago

@antono maybe you could make it an extra option to merge the files? I don't know what can be expected from having the incorrect headers, you say it works for you so I guess it's not a problem.

svperfecta commented 12 years ago

+1 For emacs, having them merged is much simpler. Actually, I'd vote for creating individual files and merging them. There's less overhead during the regeneration.

On Tue, Jun 19, 2012 at 6:18 AM, Jorge Dias reply@reply.github.com wrote:

@antono maybe you could make it an extra option to merge the files? I don't know what can be expected from having the incorrect headers, you say it works for you so I guess it's not a problem.


Reply to this email directly or view it on GitHub: https://github.com/ivalkeen/guard-ctags-bundler/pull/4#issuecomment-6421297

ivalkeen commented 12 years ago

Ok, it seems that in emacs mode, there is no meta-information header in tags files, so it seems that it is OK to merge them. Thanks.

antono commented 12 years ago

Cool. Thanks :)