* [PATCH 1/3] menuconfig: factor out reserved letters
2013-07-10 15:15 [PATCH v2 0/3] Modernize menuconfig a bit Ramkumar Ramachandra
@ 2013-07-10 15:15 ` Ramkumar Ramachandra
2013-07-10 15:15 ` [PATCH 2/3] menuconfig: remove redundant info from RESERVED_LETTERS Ramkumar Ramachandra
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Ramkumar Ramachandra @ 2013-07-10 15:15 UTC (permalink / raw)
To: LKML; +Cc: Michal Marek
These letters that should not be used in menu selection.
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
| 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index 38cd69c..5923f2c 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -57,6 +57,7 @@
*/
#include "dialog.h"
+#define RESERVED_LETTERS "YyNnMmHh"
static int menu_width, item_x;
@@ -71,7 +72,7 @@ static void do_print_item(WINDOW * win, const char *item, int line_y,
strncpy(menu_item, item, menu_width - item_x);
menu_item[menu_width - item_x] = '\0';
- j = first_alpha(menu_item, "YyNnMmHh");
+ j = first_alpha(menu_item, RESERVED_LETTERS);
/* Clear 'residue' of last item */
wattrset(win, dlg.menubox.atr);
@@ -290,14 +291,14 @@ do_resize:
else {
for (i = choice + 1; i < max_choice; i++) {
item_set(scroll + i);
- j = first_alpha(item_str(), "YyNnMmHh");
+ j = first_alpha(item_str(), RESERVED_LETTERS);
if (key == tolower(item_str()[j]))
break;
}
if (i == max_choice)
for (i = 0; i < max_choice; i++) {
item_set(scroll + i);
- j = first_alpha(item_str(), "YyNnMmHh");
+ j = first_alpha(item_str(), RESERVED_LETTERS);
if (key == tolower(item_str()[j]))
break;
}
--
1.8.3.2.736.g869de25
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/3] menuconfig: remove redundant info from RESERVED_LETTERS
2013-07-10 15:15 [PATCH v2 0/3] Modernize menuconfig a bit Ramkumar Ramachandra
2013-07-10 15:15 ` [PATCH 1/3] menuconfig: factor out reserved letters Ramkumar Ramachandra
@ 2013-07-10 15:15 ` Ramkumar Ramachandra
2013-07-10 15:15 ` [PATCH 3/3] menuconfig: allow j/k to move down/up the menu Ramkumar Ramachandra
2013-07-14 6:08 ` [PATCH v2 0/3] Modernize menuconfig a bit Rob Landley
3 siblings, 0 replies; 5+ messages in thread
From: Ramkumar Ramachandra @ 2013-07-10 15:15 UTC (permalink / raw)
To: LKML; +Cc: Michal Marek
first_alpha() checks only against lowercase characters anyway.
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index 5923f2c..698d7c3 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -57,7 +57,7 @@
*/
#include "dialog.h"
-#define RESERVED_LETTERS "YyNnMmHh"
+#define RESERVED_LETTERS "ynmh"
static int menu_width, item_x;
--
1.8.3.2.736.g869de25
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] menuconfig: allow j/k to move down/up the menu
2013-07-10 15:15 [PATCH v2 0/3] Modernize menuconfig a bit Ramkumar Ramachandra
2013-07-10 15:15 ` [PATCH 1/3] menuconfig: factor out reserved letters Ramkumar Ramachandra
2013-07-10 15:15 ` [PATCH 2/3] menuconfig: remove redundant info from RESERVED_LETTERS Ramkumar Ramachandra
@ 2013-07-10 15:15 ` Ramkumar Ramachandra
2013-07-14 6:08 ` [PATCH v2 0/3] Modernize menuconfig a bit Rob Landley
3 siblings, 0 replies; 5+ messages in thread
From: Ramkumar Ramachandra @ 2013-07-10 15:15 UTC (permalink / raw)
To: LKML; +Cc: Michal Marek
Like in Vim.
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
| 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index 698d7c3..151394a 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -57,7 +57,7 @@
*/
#include "dialog.h"
-#define RESERVED_LETTERS "ynmh"
+#define RESERVED_LETTERS "ynmhjk"
static int menu_width, item_x;
@@ -308,11 +308,12 @@ do_resize:
(i < max_choice ||
key == KEY_UP || key == KEY_DOWN ||
key == '-' || key == '+' ||
+ key == 'j' || key == 'k' ||
key == KEY_PPAGE || key == KEY_NPAGE)) {
/* Remove highligt of current item */
print_item(scroll + choice, choice, FALSE);
- if (key == KEY_UP || key == '-') {
+ if (key == KEY_UP || key == '-' || key == 'k') {
if (choice < 2 && scroll) {
/* Scroll menu down */
do_scroll(menu, &scroll, -1);
@@ -321,7 +322,7 @@ do_resize:
} else
choice = MAX(choice - 1, 0);
- } else if (key == KEY_DOWN || key == '+') {
+ } else if (key == KEY_DOWN || key == '+' || key == 'j') {
print_item(scroll+choice, choice, FALSE);
if ((choice > max_choice - 3) &&
--
1.8.3.2.736.g869de25
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2 0/3] Modernize menuconfig a bit
2013-07-10 15:15 [PATCH v2 0/3] Modernize menuconfig a bit Ramkumar Ramachandra
` (2 preceding siblings ...)
2013-07-10 15:15 ` [PATCH 3/3] menuconfig: allow j/k to move down/up the menu Ramkumar Ramachandra
@ 2013-07-14 6:08 ` Rob Landley
3 siblings, 0 replies; 5+ messages in thread
From: Rob Landley @ 2013-07-14 6:08 UTC (permalink / raw)
To: Ramkumar Ramachandra; +Cc: LKML, Michal Marek
On 07/10/2013 10:15:15 AM, Ramkumar Ramachandra wrote:
> Hi,
>
> After Michal's (somewhat positive) response to the first iteration,
> here's the second iteration fixing the reserved-letters problem.
Someone saying they keep accidentally killing processes in "top" is a
positive response?
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread