Zsh Mailing List Archive
Messages sorted by:
Re: Zed obtains fresh text of function
- X-seq: zsh-workers 36761
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Zed obtains fresh text of function
- Date: Sat, 3 Oct 2015 12:18:51 -0700
- In-reply-to: <CAKc7PVCAoJaV0q5d65TyiL6NP16CZH=S=Mw2irZo_LOQEqi8jA@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCAoJaV0q5d65TyiL6NP16CZH=S=Mw2irZo_LOQEqi8jA@mail.gmail.com>
On Oct 3, 12:44pm, Sebastian Gniazdowski wrote:
} Subject: Zed obtains fresh text of function
} creating simple function tst in */site-functions:
} echo "Hello tst abcd"
} autoload zed
} autoload tst
} zed -f tst
} And then repeating:
} zed -f tst<Enter><Ctrl-C>
} 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.
Messages sorted by: