Comments (3)
(cl-defun global-tags--get-dbpath (&optional (dir default-directory))
"Filepath for database from DIR."
(pcase (gethash dir global-tags--dbpath-cache)
('empty nil)
('nil
(puthash dir 'empty global-tags--dbpath-cache)
(when-let*
=== BLA ===
(when (file-exists-p dbpath)
(puthash dir dbpath global-tags--dbpath-cache))))
(code code)))
from emacs-counsel-gtags.
I'm actually using somewhat the first solution you propose, using cache, at work. I hadn't updated that code, although it's stable now. I'm actually inheriting wrapping global-tags-try-project-root
with a function that first checks cached roots before calling any global-tags
function. This is a great feature of the extensible design of project.el
and xref.el
what I'm doing is using a persist-defvar
with a list of already-used "project roots per gtags". Since I don't tend to delete source code at work, I've never had to worry about that list including deleted code. I don't know if it's the same for anyone else, but I guess that a Emacs-session-local var should be enough for everyone.
Should we have a timeout for cached project roots? How much? 24h? Refreshing the cache list can be done in the background using async
, so that's not a problem.
from emacs-counsel-gtags.
I'm actually using somewhat the first solution you propose, using cache, at work. I hadn't updated that code, although it's stable now. I'm actually inheriting wrapping
global-tags-try-project-root
with a function that first checks cached roots before calling anyglobal-tags
function. This is a great feature of the extensible design ofproject.el
andxref.el
The second solution is actually better because project-find-functions
may have more than one function to try, and it is useful to avoid repeating the search with global-tags--get-dbpath
when it failed in this session once.
I actually reported an emacs bug bug#49264 to see if they add some caching features to project.el because the vc backend is also very slow.
what I'm doing is using a
persist-defvar
with a list of already-used "project roots per gtags". Since I don't tend to delete source code at work, I've never had to worry about that list including deleted code. I don't know if it's the same for anyone else, but I guess that a Emacs-session-local var should be enough for everyone.Should we have a timeout for cached project roots? How much? 24h? Refreshing the cache list can be done in the background using
async
, so that's not a problem.
That may be a custom... so 0 means disable cache, a number the time in whatever unit you want and nil disable auto erasing.
from emacs-counsel-gtags.
Related Issues (17)
- Tramp issues HOT 12
- ivy-call: Symbol’s value as variable is void: line HOT 2
- Listing (and filtering) tags does not work with Tramp HOT 8
- Old link in packages-list HOT 2
- counsel-gtags-find-definition does not filter symbols HOT 12
- find_tag_other_window? HOT 2
- global:invalid regular expression. HOT 11
- color codes not getting filtered HOT 4
- Few parameters for counsel-gtags-path-style HOT 2
- Critical issue with counsel-gtags-find-definition and other commands HOT 13
- get "function definition is void: interactive-call" error when counsel-gtags-dwim is executed HOT 2
- counsel-gtags-find-symbol shows error code 1 HOT 6
- Issue in global-tags HOT 4
- Feature request: counsel-gtags-dwim also find include files HOT 4
- counsel-gtags-find-definition gives "(wrong-number-of-arguments (1 . 1) 2)" HOT 1
- counsel-gtags-find-file folder switch HOT 1
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 emacs-counsel-gtags.