Comments (7)
See counsel-etags-update-tags-backend
in latest code.
(setq counsel-etags-update-tags-backend
(lambda (src-dir)
(cond
((string-match "myproj1" src-dir)
(shell-command "rust-tags ~/projs/myproj1"))
(t
(counsel-etags-scan-dir-internal src-dir)))))
from counsel-etags.
When I try the code you provided I get a message about "Wrong number of arguments: (lambda (src-dir) [...]), 0". Any idea what that could mean?
(EDIT: I'm not sure if I updated after your last changes. I will try again tomorrow on that machine.)
Is there a way to try to guess the project languange? E.g. look for Cargo.toml to detect rust or maybe a .counseletags file to make per project configurations?
from counsel-etags.
It works! Thanks!
I am still interested in a way to handle this in a more generic way, or at least control the settings per project. Do you have any ideas?
from counsel-etags.
Could you give me an example? What's the project directory layout?
from counsel-etags.
The easiest way I can think of, would be to have something like a .counesl-etags
file in the root folder, containing counsel-etags-update-tags-backend = rusty-etags
or whatever. Then you could configure on a per project basis from within the project.
Another possibility would maybe be to somehow couple it to the current major-mode. So in my example, if we are in rust-mode then always use the following backend. For another-mode use this-and-that and for all other cases use the default.
I also noticed, that generating the TAGS file the first time indeed works with the specified backend, but subsequent updates don't work for some reason.
Messages-buffer contains this for initial creation:
counsel-etags-scan-dir called => e:/projects/workspace/projects/bud/
Fetching source and metadata ...
Creating tags for: ["bud"] ...
Messages-buffer contains this for updates:
Making tags completion table for e:/projects/workspace/projects/bud/TAGS...done
So maybe it is not calling the same backend?
from counsel-etags.
Use .dir-locals.el
, see https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html
counsel-etags-update-tags-backend
is used to create tags file. The backend runs every 3 minutes and it's a quiet process.
The last message is output of API tags-completion-table
which is NOT used by counsel-etags
.
I don't know which 3rd party plugins is using it. Maybe company-etags
from company-mode
?
from counsel-etags.
Ok, I can use .dir-locals.el
!
Hm. For some reason I thought the TAGS are updated on save as well. If it is always updated after counsel-etags-update-interval
, I just wasn't patient enough.
from counsel-etags.
Related Issues (20)
- counsel-etags-grep cant' follow parameters? HOT 6
- Issue with creating a TAGS file when in Tramp mode HOT 2
- counsel-etags did not auto update TAG file. HOT 11
- need CI and tdd HOT 1
- How to color candidate/selection when 'counsel-etags-grep' like swiper does? HOT 8
- could add function name in when looking up tags
- how to do case insensitive grep? HOT 4
- When calling "counsel-etags-find-tag-at-point", rg report separator is error HOT 6
- Unable to use counsel-etags-grep under the windows version of emacs (spacemacs) HOT 3
- Ctags Will Scan Code When Jump Next Tag HOT 12
- How to go back to previous position after I executed counsel-etags-find-tag-at-point ? HOT 2
- 如何指定tag的输出路径 HOT 4
- about ctags cache HOT 4
- counsel-etags-find-tag-at-point-other-window
- How can I append external tags? HOT 4
- Please don't provide a feature in my-byte-compile HOT 2
- "No tag is found." although TAGS file contains this tag HOT 6
- Counsel-etags-grep can only find results in some files HOT 6
- 当tag搜索不到想要的内容时回退到使用ripgrep HOT 4
- 调用 counsel-etags-grep 时可以忽略tag文件 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from counsel-etags.