From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14431 invoked by alias); 20 Dec 2012 14:40:41 -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: 17485 Received: (qmail 26525 invoked from network); 20 Dec 2012 14:40:38 -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,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at sandrowicz.org does not designate permitted sender hosts) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent:x-gm-message-state; bh=itAZaJzbBSLHdJGUj++E1OEIy5btiwqySu73iYRskPQ=; b=UsaFbDQQTPHq8HoR/v4yW0vCrQPlaA6/uxQUHFtKfNl5kvIiLDQ4+Yc10mwprq307a aZUn1fnCTesz9AR6JCbaIxZ+N0RmiA8e4Srrr8PAVe3Oufc/zw0rlRgnD9CUr8uSJ0pK WxfqtTjuEGAotGXhAIu+crAfsXPlIHso0U0Nza/2Me2Z8rR7nU1qP2PcMtcYFfS0NAg5 FlNSkHzYc/YS0v6XhCoq2QGMHUU4RZyC/P2GUdiI3KmUMd5xnI35gBIgSMh0tkDQiCYE cBIsXS6VPqdn0l2g1LLQJNJCo3sBDlOBg/HRGL22O9gyApSmjSD8KWvEFQC36YEim4QF Q64Q== X-Received: by 10.59.13.135 with SMTP id ey7mr13574031ved.37.1355994188553; Thu, 20 Dec 2012 01:03:08 -0800 (PST) Date: Thu, 20 Dec 2012 04:03:05 -0500 From: Brandon Sandrowicz To: czech@sonic.net Cc: zsh-users@zsh.org Subject: Re: Function not found Message-ID: <20121220090305.GD1915@helium> References: <50D1DBBC.20200@eastlink.ca> <20121219235850.GB15388@lorien.comfychair.org> <50D1E541.5030209@eastlink.ca> <37060.148.87.67.207.1355985863.squirrel@webmail.sonic.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37060.148.87.67.207.1355985863.squirrel@webmail.sonic.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQm6vQy9MzXV8lhHg+NbaNRk1pKFE8qlmrRfFmSeFwXNfHwRo3aH14EJnB5bIfHeeXTcf6JT On Wed, Dec 19, 2012 at 10:44:23PM -0800, czech@sonic.net wrote: > Greetings! > > I have a function I use to connect to remote hosts. I call my function _ssh: > > _ssh() { > ssh -XC "czechar@$@" > } > > I keep my functions in a directory under my home dir. I call the directory > .zfuncs. I read my functions in my .zshrc via autoload and add them to my > fpath: > > autoload -- ~/.zfunc/[^_]*(:t) > fpath=( ~/.zfunc $fpath ) The autoload command you have here appears to be your problem. You probably want something like: autoload _ssh fpath=( ~/.zfunc $fpath ) If your _ssh function is defined in the file ~/.zfunc/_ssh, your original command *could* work, but you would have to remove the '[^_]' which prevents files beginning with underscores. To be clear, autoload wants the names of the *functions*, not the names of the files. Your approach above could work so long as each function is in a separate file, and both (file and function) share the same exact name (i.e. can't be _ssh.zsh). > But when I try to use _ssh, zsh tells me: > > Grendel:czech:~> _ssh adc2201650 > zsh: correct '_ssh' to 'ssh' [nyae]? > > I thought I had told zsh not to correct my spelling for ssh via: > > alias ssh='nocorrect ssh' I think that you have the wrong idea here. From my reading of the manpage, nocorrect only disables correction for the current command. What you're attempting to do with it, would have to be accomplished by: alias _ssh='nocorrect _ssh' E.g.: $ function _ssh() { echo "HERE"; } $ alias _ssh='nocorrect _ssh' $ _ssh HERE Now when you run the _ssh function, the alias will expand the call to "nocorrect _ssh" forcing auto-correct to ignore '_ssh'. > The function was working without issue until I ran compinstall. I have > commented out the lines added to my .zshrc by compinstall, but the problem > persists. > > Any ideas on what the problem is here? > > Thanks in advance. > > > > Corwin Disclaimer: I know none of this for sure as I don't use CORRECT or my own autoloads/fpath. I just gleaned this from the manpages, and poking at it in a shell, so it's entirely possible that I don't know what I'm talking about as I'm no zshell wizard. -- Brandon Sandrowicz