Skip to contentSkip to conversation

menuconfig: Search from everywhere

PATCH In review Alexander Kuleshov 2 participants 2 messages Feb 9, 2015 – Feb 11, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 menuconfig: Search from everywhere

If we want to see search window again, for example after typo or for another search, we need to press on '< Exit >' and than execute new search. Let's make '/' active everywhere.

---
 scripts/kconfig/lxdialog/textbox.c | 4 ++++
 scripts/kconfig/mconf.c            | 8 ++++++++
 2 files changed, 12 insertions(+)
scripts/kconfig/lxdialog/textbox.c +4 -0
index 1773319..958770d 100644
@@ -141,6 +141,10 @@ do_resize:
 	while (!done) {
 		key = wgetch(dialog);
 		switch (key) {
+		case '/':
+			key = 9;
+			done = true;
+			break;
 		case 'E':	/* Exit */
 		case 'e':
 		case 'X':
scripts/kconfig/mconf.c +9 -0
index 4dd3755..d49fa45 100644
@@ -446,7 +446,15 @@ again:
 					str_get(&res), 0, 0, keys, &vscroll,
 					&hscroll, &update_text, (void *)
 					&data);
+		if (dres == 9) {
+			free(sym_arr);
+			str_free(&title);
+			list_del(trail.prev);
+			str_free(&sttext);
+			search_conf();
+			return;
+		}
+
 		again = false;
 		for (i = 0; i < JUMP_NB && keys[i]; i++)
 			if (dres == keys[i]) {
Signature · 1 line
2.3.0
#1 lore raw

[Removed Yann. Web searches should explain why.]

Quoted 2 lines · Alexander Kuleshov

If we want to see search window again, for example after typo or for another search, we need to press on '< Exit >' and than

then

Quoted 1 line

execute new search. Let's make '/' active everywhere.

Everywhere or just in the "Search Results" screen itself?

A drawback of menuconfig is its stacked interface. Each search and jump pushes two screens to its stack of screens. I'm often surprised at the number of screens I generated by searching around a bit. Does searching from withing search results again push another screen onto the stack?

Anyhow, if hitting enter and "/" bothers you a redesign of the search functionality would be a better idea. Eg, make it have a input area on top (to type in the query) and an text area below it (to display results). Which is probably not worth the, presumably rather big, effort.

Quoted 31 lines
---
 scripts/kconfig/lxdialog/textbox.c | 4 ++++
 scripts/kconfig/mconf.c            | 8 ++++++++
 2 files changed, 12 insertions(+)
scripts/kconfig/lxdialog/textbox.c +4 -0
index 1773319..958770d 100644
@@ -141,6 +141,10 @@ do_resize:
 	while (!done) {
 		key = wgetch(dialog);
 		switch (key) {
+		case '/':
+			key = 9;
+			done = true;
+			break;
 		case 'E':	/* Exit */
 		case 'e':
 		case 'X':
scripts/kconfig/mconf.c +2 -0
index 4dd3755..d49fa45 100644
@@ -446,7 +446,15 @@ again:
 					str_get(&res), 0, 0, keys, &vscroll,
 					&hscroll, &update_text, (void *)
 					&data);
+		if (dres == 9) {
+			free(sym_arr);

scripts/kconfig/mconf.c again: · line 460

Quoted 10 lines
scripts/kconfig/mconf.c +7 -0
+			str_free(&title);
+			list_del(trail.prev);
+			str_free(&sttext);
+			search_conf();
+			return;
+		}
+
 		again = false;
 		for (i = 0; i < JUMP_NB && keys[i]; i++)
 			if (dres == keys[i]) {

Thanks,

Paul Bolle