Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/sh Only add the function when we initialize. Restore the...
details: https://anonhg.NetBSD.org/src/rev/f6408145dc07
branches: trunk
changeset: 580804:f6408145dc07
user: christos <christos%NetBSD.org@localhost>
date: Mon May 09 11:35:19 2005 +0000
description:
Only add the function when we initialize. Restore the binding of tab to
ed-insert if tabcomplete is cleared.
diffstat:
bin/sh/histedit.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diffs (43 lines):
diff -r 9f688cc2bc81 -r f6408145dc07 bin/sh/histedit.c
--- a/bin/sh/histedit.c Mon May 09 11:10:07 2005 +0000
+++ b/bin/sh/histedit.c Mon May 09 11:35:19 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: histedit.c,v 1.35 2005/05/07 19:52:17 dsl Exp $ */
+/* $NetBSD: histedit.c,v 1.36 2005/05/09 11:35:19 christos Exp $ */
/*-
* Copyright (c) 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: histedit.c,v 1.35 2005/05/07 19:52:17 dsl Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.36 2005/05/09 11:35:19 christos Exp $");
#endif
#endif /* not lint */
@@ -134,6 +134,9 @@
el_set(el, EL_HIST, history, hist);
el_set(el, EL_PROMPT, getprompt);
el_set(el, EL_SIGNAL, 1);
+ el_set(el, EL_ADDFN, "rl-complete",
+ "ReadLine compatible completion function",
+ _el_fn_complete);
} else {
bad:
out2str("sh: can't initialize editing\n");
@@ -150,12 +153,8 @@
el_set(el, EL_EDITOR, "vi");
else if (Eflag)
el_set(el, EL_EDITOR, "emacs");
- if (tabcomplete) {
- el_set(el, EL_ADDFN, "rl_complete",
- "ReadLine compatible completion function",
- _el_fn_complete);
- el_set(el, EL_BIND, "^I", "rl_complete", NULL);
- }
+ el_set(el, EL_BIND, "^I",
+ tabcomplete ? "rl-complete" : "ed-insert", NULL);
el_source(el, NULL);
}
} else {
Home |
Main Index |
Thread Index |
Old Index