On Sat, Aug 19, 2017 at 6:42 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:
> These are really cool utilities!
> Let's see if I understand them correctly.
> I can enter "funced foo" and create a new function named "foo".
> I can immediate execute that by entering "foo".
> But if I exit the session, I'll lose it.
> I can enter "funcsave foo" and it will be written to
> ~/.config/fish/functions/foo.fish.
> Then it will be available in all future sessions.
> Great!
>
> Later I can edit it again with "funced foo".
> However, that just edits the in-memory version of the function.
> It doesn't write the changes to the file unless I run "funcsave foo" again.
>
> I was expecting that funced might realize the function was already saved
> to a file and save the changes there. Either that or I thought there would
> be a switch on funced to tell it to do that.
>
> I'm curious why neither of those is the way it works.
>
First, while `funced` can be used to create a function on the fly it's
primary purpose is to edit an existing function. If I run `funced` more
often than not I am testing something such as a change to my `fish_prompt`
function. And because I'm testing something I do not want that change to be
automatically reflected in the autoloaded script. If I do want a permanent
change I can either run `funced` followed by `funcsave` or just directly
edit the autoloaded script in ~/.config/fish/functions. Existing fish
sessions will notice within a few seconds that the script file has changed
and reload it.
--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users