Coder Social home page Coder Social logo

Comments (7)

redguardtoo avatar redguardtoo commented on June 12, 2024

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.

Opioid avatar Opioid commented on June 12, 2024

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.

Opioid avatar Opioid commented on June 12, 2024

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.

redguardtoo avatar redguardtoo commented on June 12, 2024

Could you give me an example? What's the project directory layout?

from counsel-etags.

Opioid avatar Opioid commented on June 12, 2024

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.

redguardtoo avatar redguardtoo commented on June 12, 2024

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.

Opioid avatar Opioid commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.