Change configuration file names if installing in $HOME

darcs-hash:20050926123306-ac50b-c2a277903de798d553fe61e1045eb6c3dae0036d.gz
This commit is contained in:
axel 2005-09-26 22:33:06 +10:00
parent b445294ff9
commit 6e1af6d9c3
8 changed files with 54 additions and 4758 deletions

View file

@ -78,5 +78,8 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* System configuration directory */
#undef SYSCONFDIR
/* Evil kludge to get Power based machines to work */
#undef TPUTS_KLUDGE

4692
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script.
AC_INIT(fish,1.14.0,axel@liljencrantz.se)
AC_INIT(fish,1.14.1,axel@liljencrantz.se)
AC_CANONICAL_TARGET
@ -47,16 +47,12 @@ else
fi
if echo $prefix | grep \^$HOME >/dev/null; then
AC_SUBST(sysconfdir,[$HOME])
AC_SUBST(fishdir,[/.fish.d])
AC_SUBST(fishfile,[/.fish])
AC_SUBST(fishinputfile,[/.fish_inputrc])
AC_SUBST(sysconfdir,[$HOME/etc])
AC_MSG_NOTICE(["Install in $HOME"])
else
AC_SUBST(fishdir,[/fish.d])
AC_SUBST(fishfile,[/fish])
AC_SUBST(fishinputfile,[/fish_inputrc])
fi
AC_SUBST(fishdir,[/fish.d])
AC_SUBST(fishfile,[/fish])
AC_SUBST(fishinputfile,[/fish_inputrc])
AC_ARG_VAR( [docdir], [Documentation direcotry] )
@ -65,6 +61,7 @@ if test -z $docdir; then
fi
AC_DEFINE_UNQUOTED( DOCDIR, [L"$(eval echo $docdir)"], [Documentation directory] )
AC_DEFINE_UNQUOTED( SYSCONFDIR, [L"$(eval echo $sysconfdir)"], [System configuration directory] )
# See if Linux procfs is present
AC_CHECK_FILES([/proc/self/stat])

View file

@ -651,16 +651,15 @@ Here are some of the commands available in the editor:
- Alt-l lists the contents of the current directory, unless the cursor is over a directory argument, in which case the contents of that directory will be listed
- Alt-k prints a list of all key bindings
You can change these key bindings making an inputrc file. To do this,
copy the file /etc/fish_inputrc to your home directory and rename it
to '.fish_inputrc'. You can do this by running the command <tt>mv
/etc/fish_inputrc ~/.fish_inputrc</tt>. Now you can edit the file
.fish_inputrc, to change your key bindings. The fileformat of this file
is described in the manual page for readline. Use the command <tt>man
readline</tt> to read up on this syntax. Please note thet the
key binding support in \c fish is still limited. You can not use the
set command or the keyname-syntax, and the list functions is
incomplete. Currently, the following functions are available:
You can change these key bindings by making an inputrc file. To do
this, copy the file /etc/fish_inputrc to your home directory and
rename it to '.fish_inputrc'. Now you can edit the file .fish_inputrc,
to change your key bindings. The fileformat of this file is described
in the manual page for readline. Use the command <tt>man readline</tt>
to read up on this syntax. Please note thet the key binding support in
\c fish is still limited. You can not use the set command or the
keyname-syntax, and the list functions is incomplete. Currently, the
following functions are available:
- \c backward-char, moves one character to the left
@ -833,6 +832,16 @@ has occured. These functions are:
- \c fish_on_exec, which is called before interactively executing a command
- \c fish_on_return, which is called when control returns to the shell after interactively executing a command
\section issues Common issues with fish
If you install fish in your home directory, fish will not work
correctly for any other user than yourself. This is because fish needs
it's initalization files to function properly. To solve this
problem, either copy the initialization files to each fish users home
directory, or install them in /etc.
\section todo Missing features and bugs
\subsection todo-features Missing features

View file

@ -53,25 +53,6 @@ if count $LANG >/dev/null
end
#
# Load additional initialization files
#
if test -d fish.d
# If this file is installed in /etc, the subdirectory is called fish.d
for i in fish.d/*.fish
. $i
end
else
if test -d .fish.d
# If this file is installed in ~, the subdirectory is called .fish.d
for i in .fish.d/*.fish
. $i
end
end
end
#
# There are variables that contain colons that are not arrays. This
# reverts them back to regular strings.
@ -82,3 +63,11 @@ for i in DISPLAY
set -- $i (printf ":%s" $$i|cut -c 2-)
end
end
#
# Load additional initialization files
#
for i in fish.d/*.fish
. $i
end

View file

@ -41,7 +41,7 @@ end
# by including them when found.
#
for i in ~/.fish_inputrc /etc/fish_inputrc ~/.inputrc /etc/inputrc
for i in ~/.fish_inputrc ~/etc/fish_inputrc /etc/fish_inputrc ~/.inputrc /etc/inputrc
if test -f $i
set -xg INPUTRC $i
break

38
input.c
View file

@ -465,8 +465,6 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
}
wchar_t *ggg = in;
for( i=0; i<chars; i++ )
{
int d = convert_digit( *in++, base);
@ -498,6 +496,7 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
if( *in != L'-' )
{
error=1;
debug( 1, L"Invalid sequence - no dash after control\n" );
break;
}
in++;
@ -515,7 +514,7 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
*(out++)=*in-L'A'+1;
break;
}
// fwprintf( stderr, L"No char after\n" );
debug( 1, L"Invalid sequence - Control-nothing?\n" );
error = 1;
break;
@ -530,28 +529,16 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
if( *in != L'-' )
{
error=1;
// fwprintf( stderr, L"no dash\n" );
debug( 1, L"Invalid sequence - no dash after meta\n" );
break;
}
in++;
if( (*in >= L'a') &&
(*in <= L'z') )
if( !*(in+1) )
{
*(out++)=L'\e';
*(out++)=*in;
debug( 1, L"Invalid sequence - Meta-nothing?" );
error=1;
break;
}
if( (*in >= L'A') &&
(*in <= L'Z') )
{
*(out++)=L'\e';
*(out++)=*in;
break;
}
// fwprintf( stderr, L"No char after\n" );
error = 1;
*(out++)=L'\e';
break;
}
@ -579,7 +566,6 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
if( error )
{
// fwprintf( stderr, L"%ls had errors\n", in_orig );
free( res);
res=0;
}
@ -589,10 +575,14 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
*out = L'\0';
}
if( wcslen( res ) == 0 )
if( !error )
{
debug( 1, L"Sequence '%ls' expanded to zero characters, skipped", in_orig );
error =1;
if( wcslen( res ) == 0 )
{
debug( 1, L"Invalid sequence - '%ls' expanded to zero characters", in_orig );
error =1;
res = 0;
}
}
return res;

2
main.c
View file

@ -71,7 +71,7 @@ static int read_init()
env_set( L"__fish_help_dir", DOCDIR, 0);
eval( L"builtin cd /etc 2>/dev/null; . fish 2>/dev/null", 0, TOP );
eval( L"builtin cd " SYSCONFDIR L" 2>/dev/null; . fish 2>/dev/null", 0, TOP );
eval( L"builtin cd 2>/dev/null;. .fish 2>/dev/null", 0, TOP );
if( chdir( cwd ) == -1 )