Summary: | ZSH-completion update using cache | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Bapt <baptiste.daroussin> |
Component: | Current packages | Assignee: | Mamoru KOMACHI (RETIRED) <usata> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | oberyno |
Priority: | High | Keywords: | Inclusion |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Patch for the update
_gentoo_packages _portage patch global patch equery patch |
Description
Bapt
2004-11-21 09:23:53 UTC
Created attachment 44419 [details, diff]
Patch for the update
I don't think Gentoo completion cache is worth to enable(it's not enabled by default anyway), but I'll look into it for those who may want to use it. Any way, using the completion or not, I think it's a good idea to use _gentoo_packages or _gentoo_functions for common function to prevent copying them each time a new function is created, because, if the function is updated, we only have to do it ones and not for "each copy". Yes, I think it good thing to separate the function from each files. However, I would also want to add oberyno's patch in bug #71532 (it contains many bug fixes). Could you update your patch to work with his patch? I agree with baptux that having packages completed separately is a good thing. With _gentoo_packages, a user can use premade completion functions for custom commands, with something like this in their .zshrc: compdef '_gentoo_packages available' ecd I'm not sure, but I don't think _portage_pkglist was accessible in such a way before when everything was grouped together. Also, is "_tags packages && " actually doing anything? As far as I know, we're trying to assign a tag to a list, and it doesn't seem to be working. For example, putting this in a .zshrc should make all packages blue: zstyle ':completion:*:emerge:*:packages' list-colors '=*=32' It works for me with _wanted: _wanted packages expl 'packages' compadd... I think we should try to keep completion without cache as fast as possible also. In my first bug, I added cache to =pkg-ver, which was much faster than no cache. My last patch removed the cache in favor of matching $PREFIX which was slightly slower than cache. I think a solution that has cache for those who want it and $PREFIX matching for everyone else would work nicely. Also, is cache needed for installed packages? Sorry I'm leaving for a while in africa, and won't have internet access so I can't integrate with a send it before I come back. A good idea is to point each part that can be done by a "super function" like I've done for _portage_packages and write, like that, it would be easier to write new functions bug #71532. For the cache your are probably right, no real speed improvements ;) Created attachment 45679 [details]
_gentoo_packages
Here's a version that's pretty much straight from my last patch.
I couldn't figure out a decent way to source make.conf outside of the _gentoo
functions, so make.conf is sourced within each function.
Also, all cat/pkg completions have the tag "cat_packages".
Oh, and there's no cache.
Created attachment 45680 [details, diff]
_portage patch
Created attachment 46949 [details, diff]
global patch
I'm back, and made some small works.
Here is a global patch (against zsh-completion-20040730) integrated all the
great work made by oberyno, and added some small changes :
_gentoo_packages:
Added category to list each available category
_gentoolkit:
Updated to completly use _gentoo_packages and use the new
installed_versions
I think this time it could be integrated in portage, works great for me ;)
Merry Christmas ;)
Created attachment 47825 [details, diff]
equery patch
Ok, one final patch atop baptux's global patch.
_gentoo_packages:
useflag completion
_gentoolkit:
redid equery to work in a state based manner
added all the recent options (hasuse, depends, --filter for files, ...)
--options can be completed after the main argument, i.e., equery size zsh
-<tab> works
list asks for a pattern as per its description
--help is not treated specially; i.e. equery --help files <tab> brings up
belongs args. I'm not quite sure what to do about that.
Sorry for the delay. I submitted my thesis yesterday, so hopefully I have time to check and include this by the end of his week :) No problem. Still a couple bugs though. The description for --fetch-all-uri is wrong. Oops. "Fetch all possible files for all packages" would be better. Also, xorg-x11 should be added to opengl-update. Ok for me it's your turn to work Mamoru all seems ok for everybody... Good luck for your thesis ;) Thanks for your great work. I like the _gentoo_portage thing. Tested on several of my servers for several weeks already :) Commited to CVS. |