2018-06-06 22:16:16

by Dirk Gouders

[permalink] [raw]
Subject: [RFC 0/1] mconf: Emacs-like isearch

Hello,

being an Emacs user, I frequently find myself pressing CTRL-s in mconf
to search for some menu entry, especially in large menus.

I decided to implement a basic isearch in mconf and would like to hear
if others find this functionality useful, as well.

The new functionality is started with pressing CTRL-s followed by
characters that form the search string. To search for further
occurences of an entered string, press CTRL-s instead of further
characters.

For example: to navigate to the USB device drivers, press CTRL-s de ENTER ENTER usb ENTER ENTER

Pressing just CTRL-s subsequently results in line-by-line navigation
through the menu (search for empty strings).

The isearch is terminated by pressing either ESC ESC or ENTER.

Because I expect that errors are found in the code and changes are requested, I
completely left out the documentation part and will add it to V2
should anyone find this functionality useful.

Thanks,

Dirk

Dirk Gouders (1):
Emacs-like isearch for mconf.

scripts/kconfig/lxdialog/dialog.h | 5 ++
scripts/kconfig/lxdialog/menubox.c | 140 ++++++++++++++++++++++++++++++++++++-
scripts/kconfig/lxdialog/util.c | 1 +
3 files changed, 145 insertions(+), 1 deletion(-)

--
2.16.4



2018-06-06 22:53:07

by Dirk Gouders

[permalink] [raw]
Subject: Re: [RFC 0/1] mconf: Emacs-like isearch

Randy Dunlap <[email protected]> writes:

> On 06/06/2018 02:56 PM, Dirk Gouders wrote:
>> Hello,
>>
>> being an Emacs user, I frequently find myself pressing CTRL-s in mconf
>> to search for some menu entry, especially in large menus.
>>
>> I decided to implement a basic isearch in mconf and would like to hear
>> if others find this functionality useful, as well.
>>
>> The new functionality is started with pressing CTRL-s followed by
>> characters that form the search string. To search for further
>> occurences of an entered string, press CTRL-s instead of further
>> characters.
>>
>> For example: to navigate to the USB device drivers, press CTRL-s de ENTER ENTER usb ENTER ENTER
>
> Not being an emacs user, what is the "de" for above?

"de" (with my .config) causes a match for "Device Drivers" --
no other menu entry matching the string "de" is befor that entry.

>
>> Pressing just CTRL-s subsequently results in line-by-line navigation
>> through the menu (search for empty strings).
>>
>> The isearch is terminated by pressing either ESC ESC or ENTER.
>>
>> Because I expect that errors are found in the code and changes are requested, I
>> completely left out the documentation part and will add it to V2
>> should anyone find this functionality useful.
>
> Hm, it seems to take 2 entries of Ctrl-s to begin the search??
> No, it takes 2 entries of Ctrl-s to display the "isearch:" prompt,
> but entering one Ctrl-s + a string will display it also.
>
> Anyway, I am having trouble getting the USB drivers example to work.

Yes, I should have stated that this example explains what _I_ have to do to
navigate to the USB device drivers. Probably, "de" in your case matches
some other menu entry and the navigation requires more or other input.

I'm sorry for causing confusion.

Dirk

>> Thanks,
>>
>> Dirk
>>
>> Dirk Gouders (1):
>> Emacs-like isearch for mconf.
>>
>> scripts/kconfig/lxdialog/dialog.h | 5 ++
>> scripts/kconfig/lxdialog/menubox.c | 140 ++++++++++++++++++++++++++++++++++++-
>> scripts/kconfig/lxdialog/util.c | 1 +
>> 3 files changed, 145 insertions(+), 1 deletion(-)
>>
>
> thanks,

2018-06-06 22:59:29

by Randy Dunlap

[permalink] [raw]
Subject: Re: [RFC 0/1] mconf: Emacs-like isearch

On 06/06/2018 02:56 PM, Dirk Gouders wrote:
> Hello,
>
> being an Emacs user, I frequently find myself pressing CTRL-s in mconf
> to search for some menu entry, especially in large menus.
>
> I decided to implement a basic isearch in mconf and would like to hear
> if others find this functionality useful, as well.
>
> The new functionality is started with pressing CTRL-s followed by
> characters that form the search string. To search for further
> occurences of an entered string, press CTRL-s instead of further
> characters.
>
> For example: to navigate to the USB device drivers, press CTRL-s de ENTER ENTER usb ENTER ENTER

Not being an emacs user, what is the "de" for above?

> Pressing just CTRL-s subsequently results in line-by-line navigation
> through the menu (search for empty strings).
>
> The isearch is terminated by pressing either ESC ESC or ENTER.
>
> Because I expect that errors are found in the code and changes are requested, I
> completely left out the documentation part and will add it to V2
> should anyone find this functionality useful.

Hm, it seems to take 2 entries of Ctrl-s to begin the search??
No, it takes 2 entries of Ctrl-s to display the "isearch:" prompt,
but entering one Ctrl-s + a string will display it also.

Anyway, I am having trouble getting the USB drivers example to work.

> Thanks,
>
> Dirk
>
> Dirk Gouders (1):
> Emacs-like isearch for mconf.
>
> scripts/kconfig/lxdialog/dialog.h | 5 ++
> scripts/kconfig/lxdialog/menubox.c | 140 ++++++++++++++++++++++++++++++++++++-
> scripts/kconfig/lxdialog/util.c | 1 +
> 3 files changed, 145 insertions(+), 1 deletion(-)
>

thanks,
--
~Randy

2018-06-06 23:36:32

by Randy Dunlap

[permalink] [raw]
Subject: Re: [RFC 0/1] mconf: Emacs-like isearch

On 06/06/2018 03:32 PM, Dirk Gouders wrote:
> Randy Dunlap <[email protected]> writes:
>
>> On 06/06/2018 02:56 PM, Dirk Gouders wrote:
>>> Hello,
>>>
>>> being an Emacs user, I frequently find myself pressing CTRL-s in mconf
>>> to search for some menu entry, especially in large menus.
>>>
>>> I decided to implement a basic isearch in mconf and would like to hear
>>> if others find this functionality useful, as well.
>>>
>>> The new functionality is started with pressing CTRL-s followed by
>>> characters that form the search string. To search for further
>>> occurences of an entered string, press CTRL-s instead of further
>>> characters.
>>>
>>> For example: to navigate to the USB device drivers, press CTRL-s de ENTER ENTER usb ENTER ENTER
>>
>> Not being an emacs user, what is the "de" for above?
>
> "de" (with my .config) causes a match for "Device Drivers" --
> no other menu entry matching the string "de" is befor that entry.
>

Device Drivers is the first match for me also.

To get to the USB drivers, I have to enter:
CTRL-s de ENTER ENTER CTRL-s usb ENTER ENTER

>>
>>> Pressing just CTRL-s subsequently results in line-by-line navigation
>>> through the menu (search for empty strings).
>>>
>>> The isearch is terminated by pressing either ESC ESC or ENTER.
>>>
>>> Because I expect that errors are found in the code and changes are requested, I
>>> completely left out the documentation part and will add it to V2
>>> should anyone find this functionality useful.
>>
>> Hm, it seems to take 2 entries of Ctrl-s to begin the search??
>> No, it takes 2 entries of Ctrl-s to display the "isearch:" prompt,
>> but entering one Ctrl-s + a string will display it also.
>>
>> Anyway, I am having trouble getting the USB drivers example to work.
>
> Yes, I should have stated that this example explains what _I_ have to do to
> navigate to the USB device drivers. Probably, "de" in your case matches
> some other menu entry and the navigation requires more or other input.
>
> I'm sorry for causing confusion.

No problem.

Thanks.

> Dirk
>
>>> Thanks,
>>>
>>> Dirk
>>>
>>> Dirk Gouders (1):
>>> Emacs-like isearch for mconf.
>>>
>>> scripts/kconfig/lxdialog/dialog.h | 5 ++
>>> scripts/kconfig/lxdialog/menubox.c | 140 ++++++++++++++++++++++++++++++++++++-
>>> scripts/kconfig/lxdialog/util.c | 1 +
>>> 3 files changed, 145 insertions(+), 1 deletion(-)
>>>
>>
>> thanks,


--
~Randy

2018-06-06 23:59:46

by Dirk Gouders

[permalink] [raw]
Subject: Re: [RFC 0/1] mconf: Emacs-like isearch

Randy Dunlap <[email protected]> writes:

> On 06/06/2018 03:32 PM, Dirk Gouders wrote:
>> Randy Dunlap <[email protected]> writes:
>>
>>> On 06/06/2018 02:56 PM, Dirk Gouders wrote:
>>>> Hello,
>>>>
>>>> being an Emacs user, I frequently find myself pressing CTRL-s in mconf
>>>> to search for some menu entry, especially in large menus.
>>>>
>>>> I decided to implement a basic isearch in mconf and would like to hear
>>>> if others find this functionality useful, as well.
>>>>
>>>> The new functionality is started with pressing CTRL-s followed by
>>>> characters that form the search string. To search for further
>>>> occurences of an entered string, press CTRL-s instead of further
>>>> characters.
>>>>
>>>> For example: to navigate to the USB device drivers, press CTRL-s de ENTER ENTER usb ENTER ENTER
>>>
>>> Not being an emacs user, what is the "de" for above?
>>
>> "de" (with my .config) causes a match for "Device Drivers" --
>> no other menu entry matching the string "de" is befor that entry.
>>
>
> Device Drivers is the first match for me also.
>
> To get to the USB drivers, I have to enter:
> CTRL-s de ENTER ENTER CTRL-s usb ENTER ENTER

Yes, I left out the second CTRL-s, thank you!

Oh well, I shouldn't have sent this late at night, then I would probably
have explained the needed input as:

1) CTRL-s // start isearch
2) de // substring that matches "Device Drivers"
3) ENTER // quit isearch
4) ENTER // enter Device Drivers menu
5) CTRL-s // start isearch
6) usb // navigate to USB support
7) ENTER // quit isearch
8) ENTER // enter USB support menu

Again, I'm really sorry for the confusion.

Dirk

2018-06-07 02:05:18

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [RFC 0/1] mconf: Emacs-like isearch

2018-06-07 8:54 GMT+09:00 Dirk Gouders <[email protected]>:
> Randy Dunlap <[email protected]> writes:
>
>> On 06/06/2018 03:32 PM, Dirk Gouders wrote:
>>> Randy Dunlap <[email protected]> writes:
>>>
>>>> On 06/06/2018 02:56 PM, Dirk Gouders wrote:
>>>>> Hello,
>>>>>
>>>>> being an Emacs user, I frequently find myself pressing CTRL-s in mconf
>>>>> to search for some menu entry, especially in large menus.


I use Emacs, but I have never typed Ctrl-s in menuconfig.

Is it important to use the same key pattern as in Emacs?

You intercepted Ctrl-*

Currently, Ctrl-C terminates the program,
but this patch makes it no-op.



>>>>> I decided to implement a basic isearch in mconf and would like to hear
>>>>> if others find this functionality useful, as well.
>>>>>
>>>>> The new functionality is started with pressing CTRL-s followed by
>>>>> characters that form the search string. To search for further
>>>>> occurences of an entered string, press CTRL-s instead of further
>>>>> characters.
>>>>>
>>>>> For example: to navigate to the USB device drivers, press CTRL-s de ENTER ENTER usb ENTER ENTER
>>>>
>>>> Not being an emacs user, what is the "de" for above?
>>>
>>> "de" (with my .config) causes a match for "Device Drivers" --
>>> no other menu entry matching the string "de" is befor that entry.
>>>
>>
>> Device Drivers is the first match for me also.
>>
>> To get to the USB drivers, I have to enter:
>> CTRL-s de ENTER ENTER CTRL-s usb ENTER ENTER
>
> Yes, I left out the second CTRL-s, thank you!
>
> Oh well, I shouldn't have sent this late at night, then I would probably
> have explained the needed input as:
>
> 1) CTRL-s // start isearch
> 2) de // substring that matches "Device Drivers"
> 3) ENTER // quit isearch
> 4) ENTER // enter Device Drivers menu
> 5) CTRL-s // start isearch
> 6) usb // navigate to USB support
> 7) ENTER // quit isearch
> 8) ENTER // enter USB support menu


Hmm.

I tried this, but I was a bit annoyed.


I wonder if this could be more user-friendly.

For example, I want KEY_UP/DOWN/LEFT/RIGHT
to quit the search mode without pressing ENTER.




> Again, I'm really sorry for the confusion.
>
> Dirk
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html




You in



--
Best Regards
Masahiro Yamada

2018-06-07 06:18:15

by Dirk Gouders

[permalink] [raw]
Subject: Re: [RFC 0/1] mconf: Emacs-like isearch

Masahiro Yamada <[email protected]> writes:

> 2018-06-07 8:54 GMT+09:00 Dirk Gouders <[email protected]>:
>> Randy Dunlap <[email protected]> writes:
>>
>>> On 06/06/2018 03:32 PM, Dirk Gouders wrote:
>>>> Randy Dunlap <[email protected]> writes:
>>>>
>>>>> On 06/06/2018 02:56 PM, Dirk Gouders wrote:
>>>>>> Hello,
>>>>>>
>>>>>> being an Emacs user, I frequently find myself pressing CTRL-s in mconf
>>>>>> to search for some menu entry, especially in large menus.
>
>
> I use Emacs, but I have never typed Ctrl-s in menuconfig.
>
> Is it important to use the same key pattern as in Emacs?
>
> You intercepted Ctrl-*
>
> Currently, Ctrl-C terminates the program,
> but this patch makes it no-op.

Yes, Segher also pointed out that I at least should have mentioned this
in the cover letter. I simply forgot that, but I was aware that
forced raw-mode probably is not acceptable.

I'd say it's not important to start isearch with CTRL-s, I am just so
used to it. So, I am open for suggestions. Meanwhile, in a V2 I will
try to stay with CTRL-s (and probably another unused simpler key) but
also create a possibility to toggle raw-mode with default off.

>>>>>> I decided to implement a basic isearch in mconf and would like to hear
>>>>>> if others find this functionality useful, as well.
>>>>>>
>>>>>> The new functionality is started with pressing CTRL-s followed by
>>>>>> characters that form the search string. To search for further
>>>>>> occurences of an entered string, press CTRL-s instead of further
>>>>>> characters.
>>>>>>
>>>>>> For example: to navigate to the USB device drivers, press CTRL-s de ENTER ENTER usb ENTER ENTER
>>>>>
>>>>> Not being an emacs user, what is the "de" for above?
>>>>
>>>> "de" (with my .config) causes a match for "Device Drivers" --
>>>> no other menu entry matching the string "de" is befor that entry.
>>>>
>>>
>>> Device Drivers is the first match for me also.
>>>
>>> To get to the USB drivers, I have to enter:
>>> CTRL-s de ENTER ENTER CTRL-s usb ENTER ENTER
>>
>> Yes, I left out the second CTRL-s, thank you!
>>
>> Oh well, I shouldn't have sent this late at night, then I would probably
>> have explained the needed input as:
>>
>> 1) CTRL-s // start isearch
>> 2) de // substring that matches "Device Drivers"
>> 3) ENTER // quit isearch
>> 4) ENTER // enter Device Drivers menu
>> 5) CTRL-s // start isearch
>> 6) usb // navigate to USB support
>> 7) ENTER // quit isearch
>> 8) ENTER // enter USB support menu
>
>
> Hmm.
>
> I tried this, but I was a bit annoyed.
>
>
> I wonder if this could be more user-friendly.
>
> For example, I want KEY_UP/DOWN/LEFT/RIGHT
> to quit the search mode without pressing ENTER.

Thank you for testing it. Concerning annoyance, did you mean the isearch
functionality itself or the incomplete implementation, i.e. the missing
possibility to use above keys?

I will handle the above keys in V2, additionally to fixing a problem
with mismatches.

Dirk

2018-06-07 21:09:50

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [RFC 0/1] mconf: Emacs-like isearch

>
> I'd say it's not important to start isearch with CTRL-s, I am just so
> used to it. So, I am open for suggestions.

Today we have first or one of the first letters as shortcut to menus.
How about considering everything typed as search inputs.
Search is then stopped by ESC, arrow keys and maybe more.

Search is only possible when a menu is selected, not with focus on the buttons.

This will break the habits of people used to the shortcut variant,
but then we have the more flexible i-search variant.

Idea?

Sam

2018-06-08 08:14:04

by Dirk Gouders

[permalink] [raw]
Subject: Re: [RFC 0/1] mconf: Emacs-like isearch

Sam Ravnborg <[email protected]> writes:

>>
>> I'd say it's not important to start isearch with CTRL-s, I am just so
>> used to it. So, I am open for suggestions.
>
> Today we have first or one of the first letters as shortcut to menus.
> How about considering everything typed as search inputs.
> Search is then stopped by ESC, arrow keys and maybe more.
>
> Search is only possible when a menu is selected, not with focus on the buttons.
>
> This will break the habits of people used to the shortcut variant,
> but then we have the more flexible i-search variant.
>
> Idea?

Sounds very interesting, I will see if I can prepare a prototype so that
users can test it an see if they feel that would be an improvement for
them. In mconf, a focus on the buttons would be conceptually new
and I am anticipating I am not yet realizing all of the consequences.

One situation, I am still thinking about how to handle it (without a
dedicated search key):

* The user types a string and then doesn't want to enter further string
characters but find further occurences of the already entered string.

(In my imagination, TAB is reserved to change focus to the buttons,
ENTER is reserved to stop searching -- and enter a submenu, depending
on the item.)

Dirk