From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27789 invoked by alias); 28 Apr 2014 17:35:38 -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: 18778 Received: (qmail 3559 invoked from network); 28 Apr 2014 17:35:31 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140428103511.ZM7452@torch.brasslantern.com> Date: Mon, 28 Apr 2014 10:35:11 -0700 In-reply-to: <140426141023.ZM31797@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: zsh-newuser-install" (Apr 26, 2:10pm) References: <140416102727.ZM19090@torch.brasslantern.com> <534FE710.3020601@eastlink.ca> <140417123722.ZM22179@torch.brasslantern.com> <20140423165024.1480528a@pws-pc.ntlworld.com> <140426141023.ZM31797@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: zsh-newuser-install MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Apr 26, 2:10pm, Bart Schaefer wrote: } } Here's an idea: Let's collect some default completion zstyles and put } them in a file in $fpath, named so that compinit arranges for it to be } autoloaded the same way it picks up completers etc. Silly me, I forgot about "compinstall": ------ If the system was installed completely, it should be enough to call the shell function compinit from your initialization file; see the next section. However, the function compinstall can be run by a user to configure various aspects of the completion system. Usually, compinstall will insert code into .zshrc, although if that is not writable it will save it in another file and tell you that file's location. Note that it is up to you to make sure that the lines added to .zshrc are actually run; you may, for example, need to move them to an earlier place in the file if .zshrc usually returns early. So long as you keep them all together (including the comment lines at the start and finish), you can rerun compinstall and it will correctly locate and modify these lines. Note, however, that any code you add to this section by hand is likely to be lost if you rerun compinstall, although lines using the command `zstyle' should be gracefully handled. The new code will take effect next time you start the shell, or run .zshrc by hand; there is also an option to make them take effect immediately. However, if compinstall has removed definitions, you will need to restart the shell to see the changes. To run compinstall you will need to make sure it is in a directory mentioned in your fpath parameter, which should already be the case if zsh was properly configured as long as your startup files do not remove the appropriate directories from fpath. Then it must be autoloaded (`autoload -U compinstall' is recommended). You can abort the installation any time you are being prompted for information, and your .zshrc will not be altered at all; changes only take place right at the end, where you are specifically asked for confirmation. ------ compinit arranges to autoload compinstall, so you can always run it if you have the completion system loaded. However, that doesn't mean it's a bad idea to have an additional file of defaults that are easily overridden by the user or local admin. I suggest calling it "compdefaults" and autoloading it at the same point in compinit where compinstall et al. are autoloaded. Then the question is when to run it.