Update funced

* Editor mode is no the default
* Use -i or --interactive or -e fish to edit function in interactive
  mode
* tmpname is now created with random number added and check that file
  do not already exist
* check $TMPDIR existence and put /tmp if it does not exist
* There is an undocumented feature to use functions, started with dash.
  Introduce necessary changes to funced, functions, def_function()
  in order to make it work properly.
* Delete editor guessing. Use $EDITOR variable or -e key
This commit is contained in:
maxfl
2012-06-30 10:22:41 +08:00
committed by ridiculousfish
parent bc9bae0f7f
commit ab62fe6496
4 changed files with 93 additions and 80 deletions

View File

@@ -1097,7 +1097,9 @@ static void functions_def( const wcstring &name, wcstring &out )
event_get( &search, &ev );
out.append(L"function ");
out.append(name);
if ( name[0]!=L'-' ){
out.append(name);
}
if (! desc.empty())
{
@@ -1165,7 +1167,11 @@ static void functions_def( const wcstring &name, wcstring &out )
append_format( out, L" %ls", named.at(i).c_str() );
}
}
if ( name[0]==L'-' ){
out.append(L" -- ");
out.append(name);
}
/* This forced tab is sort of crummy - not all functions start with a tab */
append_format( out, L"\n\t%ls", def.c_str());