Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libedit Add rl_completion_word_break_hook from:
details: https://anonhg.NetBSD.org/src/rev/f277275f79a4
branches: trunk
changeset: 779278:f277275f79a4
user: christos <christos%NetBSD.org@localhost>
date: Tue May 15 17:30:04 2012 +0000
description:
Add rl_completion_word_break_hook from:
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/\
5ec6a45fa762b8cbd0305ca06acb8780335a486a
diffstat:
lib/libedit/readline.c | 12 +++++++++---
lib/libedit/readline/readline.h | 3 ++-
2 files changed, 11 insertions(+), 4 deletions(-)
diffs (62 lines):
diff -r cbd4e8acc12d -r f277275f79a4 lib/libedit/readline.c
--- a/lib/libedit/readline.c Tue May 15 15:59:01 2012 +0000
+++ b/lib/libedit/readline.c Tue May 15 17:30:04 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.c,v 1.101 2012/03/21 05:33:26 matt Exp $ */
+/* $NetBSD: readline.c,v 1.102 2012/05/15 17:30:04 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.101 2012/03/21 05:33:26 matt Exp $");
+__RCSID("$NetBSD: readline.c,v 1.102 2012/05/15 17:30:04 christos Exp $");
#endif /* not lint && not SCCSID */
#include <sys/types.h>
@@ -1756,6 +1756,7 @@
#ifdef WIDECHAR
static ct_buffer_t wbreak_conv, sprefix_conv;
#endif
+ char *breakchars;
if (h == NULL || e == NULL)
rl_initialize();
@@ -1768,12 +1769,17 @@
return CC_REFRESH;
}
+ if (rl_completion_word_break_hook != NULL)
+ breakchars = (*rl_completion_word_break_hook)();
+ else
+ breakchars = rl_basic_word_break_characters;
+
/* Just look at how many global variables modify this operation! */
return fn_complete(e,
(CPFunction *)rl_completion_entry_function,
rl_attempted_completion_function,
ct_decode_string(rl_basic_word_break_characters, &wbreak_conv),
- ct_decode_string(rl_special_prefixes, &sprefix_conv),
+ ct_decode_string(breakchars, &sprefix_conv),
_rl_completion_append_character_function,
(size_t)rl_completion_query_items,
&rl_completion_type, &rl_attempted_completion_over,
diff -r cbd4e8acc12d -r f277275f79a4 lib/libedit/readline/readline.h
--- a/lib/libedit/readline/readline.h Tue May 15 15:59:01 2012 +0000
+++ b/lib/libedit/readline/readline.h Tue May 15 17:30:04 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: readline.h,v 1.32 2010/09/16 20:08:52 christos Exp $ */
+/* $NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -109,6 +109,7 @@
extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters;
extern Function *rl_completion_entry_function;
+extern char *(*rl_completion_word_break_hook)(void);
extern CPPFunction *rl_attempted_completion_function;
extern int rl_attempted_completion_over;
extern int rl_completion_type;
Home |
Main Index |
Thread Index |
Old Index