zsh-users
 help / color / mirror / code / Atom feed
* simple completion example?
@ 2005-08-02 18:01 Andy Spiegl
  2005-08-03  8:48 ` Oliver Kiddle
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Spiegl @ 2005-08-02 18:01 UTC (permalink / raw)
  To: zsh-users

Hi, I am looking for an easy example of a completion script so that I can
start understanding and programming a little bit more complicated one for a
perl script.  It that takes the usual --help, --debug, --dir options
but also needs a command (view, dump, export, demux, ...) and then one or
more files (*.crid) from a directory.

I tried to start with _apt because it also uses "commands" but it's way to
complicated for a beginner like me. :-)

If anyone is interested the skript is here:
 http://spiegl.de/andy/shareware/gigaset

Thanks,
 Andy.

-- 
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 "Cats aren't dirty, they're just covered with cat spit."


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: simple completion example?
  2005-08-02 18:01 simple completion example? Andy Spiegl
@ 2005-08-03  8:48 ` Oliver Kiddle
  2005-08-03 10:10   ` Andy Spiegl
  0 siblings, 1 reply; 9+ messages in thread
From: Oliver Kiddle @ 2005-08-03  8:48 UTC (permalink / raw)
  To: zsh-users

Andy Spiegl wrote:

> I tried to start with _apt because it also uses "commands" but it's way to
> complicated for a beginner like me. :-)

Try looking at _aptitude instead. It's a lot simpler. If you have the
"From bash to Z shell" book, that has an example for completing
subcommands on page 395.

Oliver


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: simple completion example?
  2005-08-03  8:48 ` Oliver Kiddle
@ 2005-08-03 10:10   ` Andy Spiegl
  2005-08-03 10:19     ` Oliver Kiddle
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Spiegl @ 2005-08-03 10:10 UTC (permalink / raw)
  To: zsh-users

> Try looking at _aptitude instead. It's a lot simpler.
Hm, but the aptitude completion doesn't work with the commands (install,
purge, ...) just the options.

Thanks anyway,
 Andy.

-- 
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Ubi libertas, ibi patria.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: simple completion example?
  2005-08-03 10:10   ` Andy Spiegl
@ 2005-08-03 10:19     ` Oliver Kiddle
  2005-08-05 15:40       ` simple completion example? (aptitude completion doesn't work) Andy Spiegl
  0 siblings, 1 reply; 9+ messages in thread
From: Oliver Kiddle @ 2005-08-03 10:19 UTC (permalink / raw)
  To: zsh-users

Andy Spiegl wrote:
> > Try looking at _aptitude instead. It's a lot simpler.
> Hm, but the aptitude completion doesn't work with the commands (install,
> purge, ...) just the options.

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. If it doesn't find aptitude installed, it
won't complete any commands. Try adding in a manual assignment to the
cmds array:

cmds=( install:install/upgrade\ packages remove:remove\ packages )

You should then see how it should work. You could also look at _xauth
but that doesn't handle options.

Oliver


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: simple completion example?  (aptitude completion doesn't work)
  2005-08-03 10:19     ` Oliver Kiddle
@ 2005-08-05 15:40       ` Andy Spiegl
  2005-08-05 17:17         ` Oliver Kiddle
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Spiegl @ 2005-08-05 15:40 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 2955 bytes --]

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<TAB>" 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 <TAB>
?         -- 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 <TAB>
BEEP

condor% aptitude --<TAB>
--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"

[-- Attachment #2: complete --]
[-- Type: text/plain, Size: 7985 bytes --]

if /bin/true && [[ "$ZSH_VERSION_TYPE" == '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=zstyle

# General completion technique
zstyle ':completion:*' completer _expand_dots _complete _match _correct _7slash
# 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=(.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ÖÄÜa-zöäü}={a-zöäüA-ZÖÄÜ}'
zstyle ":completion:*" matcher-list 'm:{A-Zöäüa-zÖÄÜ}={a-zÖÄÜA-Zöäü}'
#zstyle ':completion:*' matcher-list '' 'r:|[._-]=* r:|=*' 'm:{a-zA-Z}={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=2 select=5 interactive
zstyle ':completion:*' menu select=5 interactive

# show the default prompt while scrolling during menu selection
MENUPROMPT=
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 
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=(
	"${(@)${(@s: :)${(@s:	:)${(@)${(@f)$(</etc/hosts)}%%\#*}#*[ 	]*}}:#}"
	$(<~/.zsh/.hosts.up)
	localhost
)
if [[ -r $HOME/.ssh/known_hosts ]]; then
  sshhosts=(
	${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*}
  )
# oder:
# zstyle -e ':completion:*:ssh:*' hosts \
#       'reply=($(sed -e "/^#/d" -e "s/ .*\$//" -e "s/,/ /g" \
#               /etc/ssh_known_hosts ~/.ssh/known_hosts 2>/dev/null))'
fi

#: ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}}
#hosts=(
#    "$_etc_hosts[@]"
#    localhost
#)

#ports=( "${(@)${(@)${(@f)$(</etc/services)}:#\#*}%%[ 	]*}" )

# groups=( $(cut -d: -f1 /etc/group) )
# groups=( $(ypcat group.byname | cut -d: -f1) ) # if you use NIS
# It can be done without forking, but it used too much memory in old zsh's:
groups=( "${(@)${(@f)$(</etc/group)}%%:*}" )
#groups=( "${(@)${(@f)$(ypcat groups)}%%:*}" ) # if you use NIS
users=( "${(@)${(@f)$(</etc/passwd)}%%:*}" )

if [[ "$USER" == "spiegl" && ( -x ~/bin/list.mail.aliases ) ]]; then
  muttaliases=( `~/bin/list.mail.aliases` )
  muttusers=( $muttaliases )
  mailusers=( $users `~/bin/list.mail.aliases -f` )
  #or:
  # _mutt_aliases=(${(o)${${(M)${(f)"$(< ~/.mutt/aliases)"}##alias*}/alias /}%% *})

  # to use these variables in all contexts
  zstyle ':completion:*:mutt:*' users $muttusers
  zstyle ':completion:*:mail:*' users $mailusers
  zstyle ':completion:*:checkalias:*' users $muttaliases

  # where to find mutt "mailboxes" and "alias" settings
  muttrc=~/.mutt/local
fi

zstyle ':completion:*' users $users
zstyle ':completion:*' hosts $hosts $sshhosts
#zstyle ':completion:*' groups $groups
#zstyle ':completion:*' ports $ports


# (user,host) pairs

# All my accounts:
#my_accounts=(
#    joe:
#    {joe,root}:mymachine.com
#    jbloggs:myothermachine.com
#)

# Other people's accounts:
#other_accounts=(
#    bob:
#    {fred,root}:hismachine.com
#    vera:hermachine.com
#)

#zstyle '*:my-accounts' users-hosts $my_accounts
#zstyle '*:other-accounts' users-hosts $other_accounts


# (host, port, user) triples for telnet

#  telnet_hosts_ports_users=(
#    host1::user1
#    host2::user2
#    mail-server:{smtp,pop3}:
#    news-server:nntp:
#    proxy-server:8000:
#  )
# }}}

# complete hostsnames here too
compdef _hosts vnc vnc-view
compdef _vnc xvncviewer

# completers for my aliases tarz, mktarz, ...
compdef _lstarz tarz mktarz lstarz untarz
compdef _lstar mktar lstar untar

# completions for some progs. not in default completion system
zstyle ':completion:*:*:mpg123:*' file-patterns \
'*.(mp3|MP3):mp3\ files *(-/):directories'

zstyle ':completion:*:*:ogg123:*' file-patterns \
'*.(ogg|OGG):ogg\ files *(-/):directories'

zstyle ':completion:*:*:vmware:*' file-patterns \
'*.(vmx|cfg):ogg\ files *(-/):directories'

# generic completions for programs which understand GNU long options(--help)
compdef _gnu_generic df casino wc alien Eterm pump hwclock date mv cp wordtrans rechnerbackup qiv rkhunter

# on processes completion complete all user processes
zstyle ':completion:*:processes' command 'ps -au$USER'

# add colors to processes for kill completion
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'

# show only active PCs for some network programs
#zstyle -e ':completion:*:vnc:*:hosts' hosts 'reply=( $(show.active.pcs) )'
#zstyle -e ':completion:*:vnc-view:*:hosts' hosts 'reply=( $(show.active.pcs) )'

zstyle ':completion:*' use-compctl false

# if no completion can be found, show all files
zstyle ':completion:*:*:muttf:argument*' tag-order globbed-files all-files

# complete according to modification time of files
zstyle ':completion:most-recent-file:*' match-original both
zstyle ':completion:most-recent-file::::' completer _menu _files _match
zstyle ':completion:most-recent-file:*' file-sort modification
zstyle ':completion:most-recent-file:*' file-patterns '*(.):normal\ files'
zstyle ':completion:most-recent-file:*' hidden all
#bindkey '^Xm' most-recent-file
zle -C most-recent-file menu-complete _generic


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: simple completion example? (aptitude completion doesn't work)
  2005-08-05 15:40       ` simple completion example? (aptitude completion doesn't work) Andy Spiegl
@ 2005-08-05 17:17         ` Oliver Kiddle
  2005-08-05 19:36           ` Andy Spiegl
  0 siblings, 1 reply; 9+ messages in thread
From: Oliver Kiddle @ 2005-08-05 17:17 UTC (permalink / raw)
  To: zsh-users

Andy Spiegl wrote:
> 
> 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...?

It's more likely something in your normal options that is breaking the
parsing of `aptitude -h'. Perhaps the output has changed and you're
running a newer or older version of aptitude. If you're not running
sarge, could you perhaps send me the output.

If aptitude -h is giving you a German (or other) translation, try adding
LC_MESSAGES=C in but I don't think that translation would actually break
it in this particular case.

Otherwise, the best is to start with zsh -f, run compinit and then try
bits of your setup file until it breaks.

Thanks

Oliver


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: simple completion example? (aptitude completion doesn't work)
  2005-08-05 17:17         ` Oliver Kiddle
@ 2005-08-05 19:36           ` Andy Spiegl
       [not found]             ` <30056.1123491980@trentino.groupinfra.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Spiegl @ 2005-08-05 19:36 UTC (permalink / raw)
  To: zsh-users

Hi Oliver,

> Otherwise, the best is to start with zsh -f, run compinit and then try
> bits of your setup file until it breaks.
But that's what I did!  :-)

> If aptitude -h is giving you a German (or other) translation, try adding
> LC_MESSAGES=C in but I don't think that translation would actually break
> it in this particular case.
YES, that was it!  Of course, why didn't I think of that!?

But there isn't such a big difference...Hm, maybe Verwendung instead of usage?
Can you think of a workaround for international users like me?

Here is the German version:

condor:~#aptitude -h
aptitude 0.2.15.9
Verwendung: aptitude [-S dname] [-u|-i]
            aptitude [Optionen] <Aktion> ...
Aktionen (wenn keine angegeben wird, startet Aptitude interaktiv):
 install        Installiere/Aktualisiere Pakete
 remove         Entferne Pakete
 purge          Entferne Pakete und ihre Konfigurationsdateien
 hold           Pakete auf »zurückhalten« setzen
 unhold         Einen »hold«-Befehl zurücknehmen
 markauto       Pakete als automatisch installiert markieren
 unmarkauto     Pakete als manuell installiert markieren
 forbid-version Upgrade auf eine bestimmte Paketversion verbieten
 update         Neue Listen neuer/aktualisierbarer Paketen laden
 upgrade        Sicheres Upgrade durchführen
 dist-upgrade   Upgrade durchführen, dabei ggf. Pakete installieren/entfernen
 forget-new     Vergessen welche Pakete »neu« sind
 search         Pakete nach Namen oder Ausdruck suchen
 show           Details über ein Paket anzeigen
 clean          Heruntergeladene Pakete löschen
 autoclean      Alte heruntergeladene Pakete löschen
 changelog      Änderungsprotokoll eines Pakets
 download       Die .deb-Datei eines Pakets herunterladen

Optionen:
 -h             Dieser Hilfetext
 -s             Aktionen simulieren, aber nicht wirklich durchführen.
 -d             Pakete nur herunterladen, nichts installieren oder entfernen.
 -P             Immer zur Bestätigung nachfragen
 -y             Annehmen, dass die Antwort auf einfache ja/nein-Fragen "ja" ist
 -F format      Format für die Suchergebnisse angeben;  vgl. Anleitung
 -O order       Wie die Suchergebnisse sortiert werden sollen;  vgl. Anleitung
 -w breite      Die Breite für die Formatierung der Suchergebnisse angeben
 -f             Aggressiv versuchen kaputte Pakete zu reparieren.
 -V             Anzeigen, welche Version eines Pakets installiert wird
 -D             Abhängigkeiten automatisch veränderter Pakete anzeigen
 -Z             Größenveränderung der einzelnen Pakete anzeigen
 -v             Mehr Informationen ausgeben (kann mehrfach verwendet werden)
 -t [release]   Das »Release«, aus dem Pakete installiert werden sollen
                (z.B. stable, unstable, sarge, ...)
 -o schl=wert   Die Einstellung 'schl' direkt setzen
 --with(out)-recommends
                Angeben, ob »Empfehlungen« wie starke
                Abhängigkeiten gehandhabt werden sollen
 -S fname       Die erweiterten Aptitude-Statusinformationen aus »fname« laden
 -u             Neue Paketlisten beim Start laden.
 -i             Installationslauf am Anfang durchführen.


And English:
condor:~#aptitude -h
aptitude 0.2.15.9
Usage: aptitude [-S fname] [-u|-i]
       aptitude [options] <action> ...
  Actions (if none is specified, aptitude will enter interactive mode):

 install      - Install/upgrade packages
 remove       - Remove packages
 purge        - Remove packages and their configuration files
 hold         - Place packages on hold
 unhold       - Cancel a hold command for a package
 markauto     - Mark packages as having been automatically installed
 unmarkauto   - Mark packages as having been manually installed
 forbid-version - Forbid aptitude from upgrading to a specific package version.
 update       - Download lists of new/upgradable packages
 upgrade      - Perform a safe upgrade
 dist-upgrade - Perform an upgrade, possibly installing and removing packages
 forget-new   - Forget what packages are "new"
 search       - Search for a package by name and/or expression
 show         - Display detailed information about a package
 clean        - Erase downloaded package files
 autoclean    - Erase old downloaded package files
 changelog    - View a package's changelog
 download     - Download the .deb file for a package

  Options:
 -h             This help text
 -s             Simulate actions, but do not actually perform them.
 -d             Only download packages, do not install or remove anything.
 -P             Always prompt for confirmation or actions
 -y             Assume that the answer to simple yes/no questions is 'yes'
 -F format      Specify a format for displaying search results; see the manual
 -O order       Specify how search results should be sorted; see the manual
 -w width       Specify the display width for formatting search results
 -f             Aggressively try to fix broken packages.
 -V             Show which versions of packages are to be installed.
 -D             Show the dependencies of automatically changed packages.
 -Z                 Show the change in installed size of each package.
 -v             Display extra information. (may be supplied multiple times)
 -t [release]   Set the release from which packages should be installed
 -o key=val     Directly set the configuration option named 'key'
 --with(out)-recommends Specify whether or not to treat recommends as
                strong dependencies
 -S fname: Read the aptitude extended status info from fname.
 -u      : Download new package lists on startup.
 -i      : Perform an install run on startup.

                  This aptitude does not have Super Cow Powers.

Thanks,
 Andy.

-- 
      http://francisco.spiegl.de  Our cute son :-)
      http://peru.spiegl.de       Projekt Radio Marañón, Jaén, Perú
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Debian - when you have better things to do than fixing a system


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: simple completion example? (aptitude completion doesn't work)
       [not found]             ` <30056.1123491980@trentino.groupinfra.com>
@ 2005-08-09 13:29               ` Andy Spiegl
  2005-08-10 11:39                 ` Mikael Magnusson
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Spiegl @ 2005-08-09 13:29 UTC (permalink / raw)
  To: zsh-users

> In general, the patch below adding LC_MESSAGES=C does the job.
Thanks, but I found that LC_MESSAGES=C isn't enough.
I have to put LC_ALL=C there, then it works as expected.

Could that be my fault?
In my RCs I've got:
  export LANGUAGE=de_DE@euro
  export LANG=de_DE@euro
  export LC_ALL=de_DE@euro

And what's strange is that "export LC_MESSAGES=C" doesn't change the output
of "locale":

 condor:~>locale
 LANG=de_DE@euro
 LC_CTYPE="de_DE@euro"
 LC_NUMERIC="de_DE@euro"
 LC_TIME="de_DE@euro"
 LC_COLLATE="de_DE@euro"
 LC_MONETARY="de_DE@euro"
 LC_MESSAGES="de_DE@euro"
 LC_PAPER="de_DE@euro"
 LC_NAME="de_DE@euro"
 LC_ADDRESS="de_DE@euro"
 LC_TELEPHONE="de_DE@euro"
 LC_MEASUREMENT="de_DE@euro"
 LC_IDENTIFICATION="de_DE@euro"
 LC_ALL=de_DE@euro

 condor:~>export LC_MESSAGES=C
 condor:~>locale
 LANG=de_DE@euro
 LC_CTYPE="de_DE@euro"
 LC_NUMERIC="de_DE@euro"
 LC_TIME="de_DE@euro"
 LC_COLLATE="de_DE@euro"
 LC_MONETARY="de_DE@euro"
 LC_MESSAGES="de_DE@euro"
 LC_PAPER="de_DE@euro"
 LC_NAME="de_DE@euro"
 LC_ADDRESS="de_DE@euro"
 LC_TELEPHONE="de_DE@euro"
 LC_MEASUREMENT="de_DE@euro"
 LC_IDENTIFICATION="de_DE@euro"
 LC_ALL=de_DE@euro

> It's very tempting to try to make the parsing work with the German
> output so that people get translated descriptions. However, if the
> formats aren't consistent it's probably only asking for trouble. And the
> completion code probably wouldn't handle the umlauts too well either.
English completion is 100% better than nothing. :-)

Thanks,
 Andy.

-- 
      http://peru.spiegl.de       Projekt Radio Marañón, Jaén, Perú
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Minds, like parachutes, function best when open


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: simple completion example? (aptitude completion doesn't work)
  2005-08-09 13:29               ` Andy Spiegl
@ 2005-08-10 11:39                 ` Mikael Magnusson
  0 siblings, 0 replies; 9+ messages in thread
From: Mikael Magnusson @ 2005-08-10 11:39 UTC (permalink / raw)
  To: zsh-users

On 8/9/05, Andy Spiegl <zsh.Andy@spiegl.de> wrote:
> > In general, the patch below adding LC_MESSAGES=C does the job.
> Thanks, but I found that LC_MESSAGES=C isn't enough.
> I have to put LC_ALL=C there, then it works as expected.
> 
> Could that be my fault?
> In my RCs I've got:
>   export LANGUAGE=de_DE@euro
>   export LANG=de_DE@euro
>   export LC_ALL=de_DE@euro
> 
> And what's strange is that "export LC_MESSAGES=C" doesn't change the output
> of "locale":

like (i think) someone or me said earlier in this thread, LC_ALL
overrides everything else.

> Thanks,
>  Andy.

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-08-10 11:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-02 18:01 simple completion example? Andy Spiegl
2005-08-03  8:48 ` Oliver Kiddle
2005-08-03 10:10   ` Andy Spiegl
2005-08-03 10:19     ` Oliver Kiddle
2005-08-05 15:40       ` simple completion example? (aptitude completion doesn't work) Andy Spiegl
2005-08-05 17:17         ` Oliver Kiddle
2005-08-05 19:36           ` Andy Spiegl
     [not found]             ` <30056.1123491980@trentino.groupinfra.com>
2005-08-09 13:29               ` Andy Spiegl
2005-08-10 11:39                 ` Mikael Magnusson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).