Ok, I've given this a go.
There's a patch over in my gitorious clone, on the "function-rename" branch:
http://gitorious.org/~otherchirps/fish-shell/otherchirps-fish-shell
It's at a "works for me stage". :)
Example output:
> function foo
echo Hello
end
> foo
Hello
> functions --rename foo bar
> foo
fish: Unknown command 'foo'
> bar
Hello
> functions --rename fish_prompt old_prompt
> function fish_prompt
printf "{Boo!}%s" (old_prompt)
end
{Boo!}>
Note in the last case, the new fish_prompt is calling its old definition,
which was my original aim.
Now, I'm still getting my head around the codebase, so let me know if I've
broken something.
I'm really not sure if my new function_copy() function is doing the right
thing.
Specifically with the way it's trying to wire up the new function clone with
the old one's events.
Is it registering with the same events ok? *Should* it be registering with
the same events at all?
Anyway, feedback is welcome.
- Chris.
On 29 August 2010 22:04, Jan Kanis <j...@jankanis.nl> wrote:
>
>
> On Sat, Aug 28, 2010 at 20:27, Christopher Nilsson <
> christop...@otherchirps.net> wrote:
>
>> Hi Jan & Info,
>>
>> Thanks -- that's just what I was after! I do prefer only messing with the
>> in-memory function, as this prompt prefixing is only meant to be temporary.
>> Jan's method, with the deletion of the tmpfile before adding a new
>> fish_prompt, sounds like the closest match to that.
>>
>>
>> A builtin way of doing this would be cool. eg.
>>
>> functions --rename fish_prompt old_prompt
>>
>>
> I totally agree this is needed.
>
> Jan
>
>
>
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users