From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28713 invoked by alias); 3 Oct 2015 19:18:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36761 Received: (qmail 21148 invoked from network); 3 Oct 2015 19:18:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=mRkJcPskYE4i33WByP/xSqpJrcjpD8wtm4yN0pAqBO0=; b=MNgsnUfwZSK3pIKu1Wo4OWHADPB62CZNi305OQJuWiWLMpXcNREAqkrtmZHTNjlsUz +JdkereC4nPaW9eyaDik0yw1oFdQ6RaabPMAgwuWDaABgjQAUcGpXRo1TFBwdEL6PJNZ sqt3WlzazsDvktBwlOgBcCCU8m6p4To2iGPJzhAnRLRERKJR3J7Gq+SNtuxOeTvTwmbb bc4/qlKDBjOi6IBM2TLKCtH9445v5SdkV2FKDOcoYs9GjVpHdWpxgqw7zOgAIIppXTwK u/GZV4AAghTIaLFHMLcFXAAaNA8F7TowkBJ23di39aLRrbWMvevOO7bM1djnv2l5/YJ8 +RWg== X-Gm-Message-State: ALoCoQnaQf2UU/SZxCDb7cCN/urwzLxvbafTRijHTVzEwaFuzUZqhwgdIUe2aYdSbO6SbXnC64gC X-Received: by 10.202.168.197 with SMTP id r188mr12449007oie.44.1443899933866; Sat, 03 Oct 2015 12:18:53 -0700 (PDT) From: Bart Schaefer Message-Id: <151003121851.ZM4733@torch.brasslantern.com> Date: Sat, 3 Oct 2015 12:18:51 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Zed obtains fresh text of function" (Oct 3, 12:44pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Zed obtains fresh text of function MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 3, 12:44pm, Sebastian Gniazdowski wrote: } Subject: Zed obtains fresh text of function } } Hello, } creating simple function tst in */site-functions: } } echo "Hello tst abcd" } } doing: } autoload zed } autoload tst } zed -f tst } } And then repeating: } zed -f tst } } after each update of the tst file/function - will result in zed } loading the most recent version of the function, i.e. from disk. Yes, if you ctrl+c out of zed then it does not save the function in the current shell, so it remains undefined/autoloadable. Then the next time you run zed, it loads from the $fpath file again. This is the intended behavior; you need to exit from zed with ^X^W (or ZZ if in vicmd mode) in order to save your changes (even if you didn't explicitly make any -- autoloading was an implicit change). Even if you ^X^W the state is only saved to the current shell (memory), not written back to the source file. } Not sure if this is expected, however I face an obvious situation - I } update autoloaded function and run it, and it is the disk version that } is being run, not the one from first load If the ONLY "first load" is with zed, then the function was never really loaded -- it was only pulled into a vared buffer to await that final write command. You aborted the process of parsing it into a runnable state by hitting ctrl+c. If this isn't what you mean, then you're going to have to give a more explicit example.