From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7322 invoked from network); 5 Aug 2005 15:41:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Aug 2005 15:41:10 -0000 Received: (qmail 31637 invoked from network); 5 Aug 2005 15:41:04 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Aug 2005 15:41:04 -0000 Received: (qmail 6567 invoked by alias); 5 Aug 2005 15:40:56 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9248 Received: (qmail 6557 invoked from network); 5 Aug 2005 15:40:56 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Aug 2005 15:40:56 -0000 Received: (qmail 30530 invoked from network); 5 Aug 2005 15:40:55 -0000 Received: from lila.akte.de (213.239.211.75) by a.mx.sunsite.dk with SMTP; 5 Aug 2005 15:40:51 -0000 Received: (root@lila.akte.de) by lila.akte.de id ; Fri, 5 Aug 2005 17:40:44 +0200 KRecCount: 1 KInfo: virscan ok KInfo: !spam auth Received: from condor.int.spiegl.de (p54976BC2.dip.t-dialin.net [84.151.107.194]) by lila.akte.de via kasmail (2.9) id <1E14JE-4YL-0-lila>; Fri, 05 Aug 2005 15:40:32 GMT Received: from condor.int.spiegl.de (spiegl@localhost [127.0.0.1]) by condor.int.spiegl.de (8.13.4/8.13.4/Debian-3) with ESMTP id j75FeV7B017560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 5 Aug 2005 17:40:31 +0200 Received: (from spiegl@localhost) by condor.int.spiegl.de (8.13.4/8.13.4/Submit) id j75FeUDs017556 for zsh-users@sunsite.dk; Fri, 5 Aug 2005 17:40:30 +0200 X-Authentication-Warning: condor.int.spiegl.de: spiegl set sender to zsh.Andy@spiegl.de using -f Date: Fri, 5 Aug 2005 17:40:30 +0200 From: Andy Spiegl To: zsh-users@sunsite.dk Subject: Re: simple completion example? (aptitude completion doesn't work) Message-ID: <20050805154030.GA16800@spiegl.de> Mail-Followup-To: zsh-users@sunsite.dk References: <20050802180158.GA10402@spiegl.de> <19401.1123058911@trentino.groupinfra.com> <20050803101007.GA9755@spiegl.de> <2356.1123064346@trentino.groupinfra.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: <2356.1123064346@trentino.groupinfra.com> X-PGP-GPG-Keys: mail -s "send pgp" auto@spiegl.de X-Accepted-File-Formats: ASCII OpenOffice .rtf .pdf - *NO* Microsoft files please. X-why-you-shouldnt-use-MS-LookOut: http://www.jensbenecke.de/l-oe-en.php X-warum-man-MS-Outlook-vermeiden-sollte: http://www.jensbenecke.de/l-oe-de.php X-Message-Flag: LookOut! You are using an insecure mail reader which can be used to spread viruses. X-how-to-quote: http://learn.to/quote/ X-how-to-ask-questions: http://www.catb.org/~esr/faqs/smart-questions.html X-stupid-disclaimers: http://goldmark.org/jeff/stupid-disclaimers/ User-Agent: Mutt/1.5.5.1+cvs20040105i X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > It does work with the commands. It runs `aptitude -h' and parses the > result to get a list of the commands (and descriptions) so perhaps you > don't have aptitude installed. Sure do :-) But "aptitude" just beeps. "aptitude -h" lists all the available options. Hm, I can't think of any settings in my RCs that would break the aptitude completion but probably there is one, right? I'll attach my completion options to this mail. Maybe one of them jumps at your eye...? But then again... I tried the following: condor:~>zsh -f condor% echo $ZSH_VERSION 4.2.5 condor% autoload -U compinit condor% compinit -u condor% xauth ? -- list available commands add -- add entry exit -- save changes and exit program extract -- extract entries into file generate -- use server to generate entry help -- print help info -- print information about entries list -- list entries merge -- merge entries from files nextract -- numerically extract entries nlist -- numerically list entries nmerge -- numerically merge entries quit -- abort changes and exit program remove -- remove entries source -- read commands from file condor% aptitude BEEP condor% aptitude -- --assume-yes -- assume yes answer to questions --display-format -- specify output format for search command --download-only -- just download packages - don't install --help -- display help information --prompt -- always display a prompt --show-deps -- show brief explanations of automatic installations and removals --show-versions -- show which versions of packages will be installed --simulate -- print actions without performing them --sort -- specify sort order --verbose -- causes some commands to display extra information --version -- display version information --width -- specify output width --with-recommends -- install recommended packages when installing new packages --with-suggests -- install suggested packages when installing new packages --without-recommends -- ignore recommended packages when installing new packages --without-suggests -- ignore suggested packages when installing new packages So, xauth completion works but aptitude not. Strange, isn't it? > You could also look at _xauth but that doesn't handle options. Ah, great, thanks! Have a nice weekend, Andy. -- o _ _ _ ------- __o __o /\_ _ \\o (_)\__/o (_) -o) ----- _`\<,_ _`\<,_ _>(_) (_)/<_ \_| \ _|/' \/ /\\ ---- (_)/ (_) (_)/ (_) (_) (_) (_) (_)' _\o_ _\_v ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hain't we got all the fools in town on our side? And hain't that a big enough majority in any town? - Mark Twain, "Huckleberry Finn" --/04w6evG8XlLl3ft Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename=complete Content-Transfer-Encoding: quoted-printable if /bin/true && [[ "$ZSH_VERSION_TYPE" =3D=3D 'new' ]]; then autoload -U compinit compinit -u else #print "\nAdvanced completion system not found; ignoring zstyle settings." which zstyle >/dev/null || function zstyle { } which compdef >/dev/null || function compdef { } fi ## compstyle is obsoleted now #which compstyle >/dev/null || alias compstyle=3Dzstyle # General completion technique zstyle ':completion:*' completer _expand_dots _complete _match _correct _7s= lash # oder auch: _approximate _history # first try _match without appending a * zstyle ':completion::match:*' original yes zstyle ':completion::match:*' insert-unambiguous true # options for approximate zstyle ':completion::approximate:*' max-errors 2 numeric zstyle ':completion::approximate:*' insert-unambiguous true # don't complete the directory in which we are zstyle ':completion:*' ignore-parents parent pwd # don't complete the same filenames again zstyle ':completion:*:(rm|cp|mv):*' ignore-line other zstyle ':incremental' completer _complete _correct _7slash zstyle ':predict' completer _complete # Filename suffixes to ignore during completion #fignore=3D(.o \~) # better solution: # filename suffixes to ignore during completion (except after rm command) zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns \ '*?.(o|c~)' '*?~' # if there are other completions, always show them unsetopt rec_exact # we want . and .. to be completed, too #zstyle ':completion:*:paths' special-dirs yes zstyle ':completion:*:(cd|chdir|pushd|popd):*' special-dirs .. # I want this for _all_ commands zstyle ':completion:*:*:*' special-dirs .. # complete case insensitive #zstyle ":completion:*" matcher-list 'm:{A-Z=D6=C4=DCa-z=F6=E4=FC}=3D{a-z= =F6=E4=FCA-Z=D6=C4=DC}' zstyle ":completion:*" matcher-list 'm:{A-Z=F6=E4=FCa-z=D6=C4=DC}=3D{a-z=D6= =C4=DCA-Z=F6=E4=FC}' #zstyle ':completion:*' matcher-list '' 'r:|[._-]=3D* r:|=3D*' 'm:{a-zA-Z}= =3D{A-Za-z}' zstyle ':completion:*' squeeze-slashes true # menu selection if more than 5 files are to be completed # use 'long' to start menu compl. if list is bigger than screen #zstyle ':completion:*' menu yes=3D2 select=3D5 interactive zstyle ':completion:*' menu select=3D5 interactive # show the default prompt while scrolling during menu selection MENUPROMPT=3D setopt LIST_ROWS_FIRST LIST_PACKED ## completion caching #zstyle ':completion::complete:*' use-cache 1 #zstyle ':completion::complete:*' cache-path ~/.zcompcache/$HOST ## Cache functions created by _regex_arguments #zstyle '*' cache-path ~/.zsh/.cache-path zstyle ':completion:*' use-cache on=20 zstyle ':completion:*' cache-path ~/.zsh/cache/$HOST # Expand partial paths # ASp: too slow! :-( #zstyle '*' expand 'yes' ## don't complete backup files as executables #zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~' # Separate matches into groups zstyle '*:matches' group 'yes' zstyle ':completion:*' group-name '' zstyle ':completion:*:*:-command-:*' group-order builtins functions aliases= commands zstyle ':completion:*' group-order files directories # Describe each match group. # This one assumes that your terminal has a dark background. zstyle '*:descriptions' format "$fg_bold[yellow]%d$fg_no_bold[cyan]" # Describe options in full zstyle '*:options' description 'yes' zstyle '*:options' auto-description '%d' # don't show elements from cdpath when completing after cd #zstyle ':completion:*:cd:*' tag-order local-directories path-directories # emacs-like history-search (only search through the last 200 words) zstyle '*:history-words' stop 'verbose' zstyle '*:history-words' remove-all-dups 'yes' zstyle '*:history-words' range '200' # try slice by slice of each 500 words #zstyle '*:history-words' range '200:500' # Hosts, usernames, groups, ports hosts=3D( "${(@)${(@s: :)${(@s: :)${(@)${(@f)$(/dev/null))' fi #: ${(A)_etc_hosts:=3D${(s: :)${(ps:\t:)${${(f)"$(