From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23471 invoked by alias); 7 Jan 2015 20:42:46 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19705 Received: (qmail 15441 invoked from network); 7 Jan 2015 20:42:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=w9KJ2viRVMWyQflmN8SMd+C3BsgIE2Yu3rfJ0HImR1k=; b=GhVYJ7L3U2ddKjIj+TILcBAcVENvPOxNcw2Hph8vbStoLKdrRLmukn4uzYsExzr45q kdqAOUDW6zPwTSSwh80p6gVl2K1smoUGnzoi3XDS4x/KS1aiOHNeC2c8/2ChE7aKnm8G t0j3H947DMqVCyzzmMc+r7XqD3wDfk804/beJTdC/4tT8c4fqiDr2DOGIsqAM3xjwGhY 34eote+qCtEz0C9nytAlbaXPXYNr6ra3guh5hpm1+njM2gfmwoVXhHiDCJOzpvSfF6li wb2h/4NHs+9xZk98VLcghKX59qBsa0/c/eDZJ5Qul1/pfyu8q0N9EsLs9DQIposJ/DWe 6pAw== X-Gm-Message-State: ALoCoQk2f5kKnXWpJUeQj9H6gMosL4RrgkJhdd17nFbWIu+g730xO6S6GIn9+hChLcC6/GY+63cL MIME-Version: 1.0 X-Received: by 10.194.62.76 with SMTP id w12mr10415474wjr.5.1420663361801; Wed, 07 Jan 2015 12:42:41 -0800 (PST) In-Reply-To: References: <5488D414.6010300@eastlink.ca> <30453.1418258082@thecus.kiddle.eu> <5488F0AC.2040901@eastlink.ca> <141210214454.ZM12261@torch.brasslantern.com> <5489C8F4.8030703@eastlink.ca> <141211092824.ZM13349@torch.brasslantern.com> <5489F1BC.5000900@eastlink.ca> <20150107150109.GA14088@ypig.lip.ens-lyon.fr> <54AD8803.4020704@eastlink.ca> Date: Wed, 7 Jan 2015 12:42:41 -0800 Message-ID: Subject: Re: completion From: Bart Schaefer To: Zsh Users Content-Type: multipart/alternative; boundary=047d7ba977a406a8fa050c15f7d5 --047d7ba977a406a8fa050c15f7d5 Content-Type: text/plain; charset=UTF-8 On Jan 7, 2015 11:51 AM, "Bart Schaefer" wrote: > > The hardest part of the zstyle mechanism is grasping the "reverse pattern match" lookup mechanism. Your hypothetical assassination example is inaccurate because you're applying the patterns in the wrong "direction". Here's possibly a way to think about this. Let's consider two applications of patterns, globbing and zstyle. Globbing starts with a search space full of very specific objects: Individual file names. You provide a general description (the pattern) and globbing looks up all the specific objects. Zstyle starts with an *empty* search space and a whole lot of very specific *searches* (at least one for every possible word-on-the-command-line you might want to complete). These searches are called style contexts. You populate the search space with general descriptions of the style contexts you care about, and zstyle looks up the single general description that best fits a specific search. This is why there are wildcards in the commands that set styles. There are no wildcards in the commands that test or look up styles. Globbing: "Show me the dogs in this park that are on a leash." You search the park for dogs, there may be lots but it is an instantaneous finite number. Zstyle: "All dogs in this park must be on a leash." You check every animal you see entering the park to see if it is a dog and has a leash. You have no idea how many animals or leashes you may eventually find, but if the current animal is a dog, you know it has to have a leash to be allowed in the park. --047d7ba977a406a8fa050c15f7d5--