LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [ANNOUNCE] Kconfiglib menuconfig implementation
@ 2018-05-01  0:57 Ulf Magnusson
  2018-05-01 17:56 ` Randy Dunlap
  0 siblings, 1 reply; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-01  0:57 UTC (permalink / raw)
  To: Linux Kbuild mailing list, Linux Kernel Mailing List

Hello,

Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
terminal menuconfig implementation, implemented in plain curses
(which is in the Python standard library).

The interface should feel familiar to people used to mconf. It has
some features that mconf lacks:

  - Seamless resizing

  - Unicode support

  - Runs on Windows (via 'pip install windows-curses', which uses
    PDCurses)

  - Improved information displays:

    * All expressions are split into readable chunks

    * Menus and comments have information displays

  - Relatively easy-to-read and easy-to-tweak code.

    Kconfiglib automatically invalidates symbols as needed, and
    values can never get stale, which helps.

Some upcoming features are mouse support and a search feature that
can jump directly to the definition of a symbol. The jump-to feature
will use a "show-all" mode in case the symbol isn't visible.

See the Kconfiglib GitHub page for screenshots. The menuconfig
implementation is at
https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
The docstring at the top has some more information.

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01  0:57 [ANNOUNCE] Kconfiglib menuconfig implementation Ulf Magnusson
@ 2018-05-01 17:56 ` Randy Dunlap
  2018-05-01 18:13   ` Randy Dunlap
  2018-05-01 19:12   ` Ulf Magnusson
  0 siblings, 2 replies; 33+ messages in thread
From: Randy Dunlap @ 2018-05-01 17:56 UTC (permalink / raw)
  To: Ulf Magnusson, Linux Kbuild mailing list, Linux Kernel Mailing List

On 04/30/2018 05:57 PM, Ulf Magnusson wrote:
> Hello,
> 
> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
> terminal menuconfig implementation, implemented in plain curses
> (which is in the Python standard library).
> 
> The interface should feel familiar to people used to mconf. It has
> some features that mconf lacks:
> 
>   - Seamless resizing
> 
>   - Unicode support
> 
>   - Runs on Windows (via 'pip install windows-curses', which uses
>     PDCurses)
> 
>   - Improved information displays:
> 
>     * All expressions are split into readable chunks
> 
>     * Menus and comments have information displays
> 
>   - Relatively easy-to-read and easy-to-tweak code.
> 
>     Kconfiglib automatically invalidates symbols as needed, and
>     values can never get stale, which helps.
> 
> Some upcoming features are mouse support and a search feature that
> can jump directly to the definition of a symbol. The jump-to feature
> will use a "show-all" mode in case the symbol isn't visible.
> 
> See the Kconfiglib GitHub page for screenshots. The menuconfig
> implementation is at
> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
> The docstring at the top has some more information.

Hi,

I'm probably missing some python additive (I hope it's that easy), but
menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig:

config CAN_PEAK_PCIEFD
	depends on PCI
	tristate "PEAK-System PCAN-PCIe FD cards"
	---help---
	  This driver adds support for the PEAK-System PCI Express FD
	  CAN-FD cards family.
	  These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
	  CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
	  1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
	  up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
	  electronics of the card and the respective computer against
	  disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
	  operated with ambient temperatures in a range of -40 to +85 °C.


kconfiglib.KconfigSyntaxError: 
Malformed ascii in drivers/net/can/peak_canfd/Kconfig
Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
Problematic data: b'\xc2'
Reason: ordinal not in range(128)


thanks,
-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01 17:56 ` Randy Dunlap
@ 2018-05-01 18:13   ` Randy Dunlap
  2018-05-01 18:52     ` Randy Dunlap
  2018-05-01 19:12   ` Ulf Magnusson
  1 sibling, 1 reply; 33+ messages in thread
From: Randy Dunlap @ 2018-05-01 18:13 UTC (permalink / raw)
  To: Ulf Magnusson, Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/01/2018 10:56 AM, Randy Dunlap wrote:
> On 04/30/2018 05:57 PM, Ulf Magnusson wrote:
>> Hello,
>>
>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
>> terminal menuconfig implementation, implemented in plain curses
>> (which is in the Python standard library).
>>
>> The interface should feel familiar to people used to mconf. It has
>> some features that mconf lacks:
>>
>>   - Seamless resizing
>>
>>   - Unicode support
>>
>>   - Runs on Windows (via 'pip install windows-curses', which uses
>>     PDCurses)
>>
>>   - Improved information displays:
>>
>>     * All expressions are split into readable chunks
>>
>>     * Menus and comments have information displays
>>
>>   - Relatively easy-to-read and easy-to-tweak code.
>>
>>     Kconfiglib automatically invalidates symbols as needed, and
>>     values can never get stale, which helps.
>>
>> Some upcoming features are mouse support and a search feature that
>> can jump directly to the definition of a symbol. The jump-to feature
>> will use a "show-all" mode in case the symbol isn't visible.
>>
>> See the Kconfiglib GitHub page for screenshots. The menuconfig
>> implementation is at
>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
>> The docstring at the top has some more information.
> 
> Hi,
> 
> I'm probably missing some python additive (I hope it's that easy), but
> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig:
> 
> config CAN_PEAK_PCIEFD
> 	depends on PCI
> 	tristate "PEAK-System PCAN-PCIe FD cards"
> 	---help---
> 	  This driver adds support for the PEAK-System PCI Express FD
> 	  CAN-FD cards family.
> 	  These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
> 	  CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
> 	  1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
> 	  up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
> 	  electronics of the card and the respective computer against
> 	  disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
> 	  operated with ambient temperatures in a range of -40 to +85 °C.
> 
> 
> kconfiglib.KconfigSyntaxError: 
> Malformed ascii in drivers/net/can/peak_canfd/Kconfig
> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
> Problematic data: b'\xc2'
> Reason: ordinal not in range(128)

BTW, after modifying 4 other instances of this "error," I have it running.
Now looking/testing. :)

-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01 18:13   ` Randy Dunlap
@ 2018-05-01 18:52     ` Randy Dunlap
  2018-05-01 19:33       ` Ulf Magnusson
  2018-05-03  2:47       ` Ulf Magnusson
  0 siblings, 2 replies; 33+ messages in thread
From: Randy Dunlap @ 2018-05-01 18:52 UTC (permalink / raw)
  To: Ulf Magnusson, Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/01/2018 11:13 AM, Randy Dunlap wrote:
> On 05/01/2018 10:56 AM, Randy Dunlap wrote:
>> On 04/30/2018 05:57 PM, Ulf Magnusson wrote:
>>> Hello,
>>>
>>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
>>> terminal menuconfig implementation, implemented in plain curses
>>> (which is in the Python standard library).
>>>
>>> The interface should feel familiar to people used to mconf. It has
>>> some features that mconf lacks:
>>>
>>>   - Seamless resizing
>>>
>>>   - Unicode support
>>>
>>>   - Runs on Windows (via 'pip install windows-curses', which uses
>>>     PDCurses)
>>>
>>>   - Improved information displays:
>>>
>>>     * All expressions are split into readable chunks
>>>
>>>     * Menus and comments have information displays
>>>
>>>   - Relatively easy-to-read and easy-to-tweak code.
>>>
>>>     Kconfiglib automatically invalidates symbols as needed, and
>>>     values can never get stale, which helps.
>>>
>>> Some upcoming features are mouse support and a search feature that
>>> can jump directly to the definition of a symbol. The jump-to feature
>>> will use a "show-all" mode in case the symbol isn't visible.
>>>
>>> See the Kconfiglib GitHub page for screenshots. The menuconfig
>>> implementation is at
>>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
>>> The docstring at the top has some more information.
>>
>> Hi,
>>
>> I'm probably missing some python additive (I hope it's that easy), but
>> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig:
>>
>> config CAN_PEAK_PCIEFD
>> 	depends on PCI
>> 	tristate "PEAK-System PCAN-PCIe FD cards"
>> 	---help---
>> 	  This driver adds support for the PEAK-System PCI Express FD
>> 	  CAN-FD cards family.
>> 	  These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
>> 	  CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
>> 	  1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
>> 	  up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
>> 	  electronics of the card and the respective computer against
>> 	  disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
>> 	  operated with ambient temperatures in a range of -40 to +85 °C.
>>
>>
>> kconfiglib.KconfigSyntaxError: 
>> Malformed ascii in drivers/net/can/peak_canfd/Kconfig
>> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
>> Problematic data: b'\xc2'
>> Reason: ordinal not in range(128)
> 
> BTW, after modifying 4 other instances of this "error," I have it running.
> Now looking/testing. :)

Hi Ulf,

Here are a few comments for you FWIW.

menuconfig.py uses the terminal window space better than menuconfig:
fewer margins, less Help text so more usable lines.

ESC/q is nicer than in ESC+ESC in menuconfig.

What is the lower colored line for? I don't see it being used.

On Quit, don't need to prompt for Save when the file is already saved
or has not been modified.

When menuconfig displays the Kconfig menu tree and it is over term-width
characters, it truncates on the left so that the user can see all of
the current menu name. menuconfig.py truncates on the right so that
the current menu name may be partially lost or totally lost.

To enable=y a tristate symbol, cannot enter Y, must do Space Space to cycle
from N to M to Y.

No / symbol search. I use that a lot, but I don't claim to be a
typical user.


Thanks.
-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01 17:56 ` Randy Dunlap
  2018-05-01 18:13   ` Randy Dunlap
@ 2018-05-01 19:12   ` Ulf Magnusson
  2018-05-01 19:47     ` Ulf Magnusson
  2018-05-14 16:58     ` Pavel Machek
  1 sibling, 2 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-01 19:12 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Tue, May 1, 2018 at 7:56 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 04/30/2018 05:57 PM, Ulf Magnusson wrote:
>> Hello,
>>
>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
>> terminal menuconfig implementation, implemented in plain curses
>> (which is in the Python standard library).
>>
>> The interface should feel familiar to people used to mconf. It has
>> some features that mconf lacks:
>>
>>   - Seamless resizing
>>
>>   - Unicode support
>>
>>   - Runs on Windows (via 'pip install windows-curses', which uses
>>     PDCurses)
>>
>>   - Improved information displays:
>>
>>     * All expressions are split into readable chunks
>>
>>     * Menus and comments have information displays
>>
>>   - Relatively easy-to-read and easy-to-tweak code.
>>
>>     Kconfiglib automatically invalidates symbols as needed, and
>>     values can never get stale, which helps.
>>
>> Some upcoming features are mouse support and a search feature that
>> can jump directly to the definition of a symbol. The jump-to feature
>> will use a "show-all" mode in case the symbol isn't visible.
>>
>> See the Kconfiglib GitHub page for screenshots. The menuconfig
>> implementation is at
>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
>> The docstring at the top has some more information.
>
> Hi,
>
> I'm probably missing some python additive (I hope it's that easy), but
> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig:
>
> config CAN_PEAK_PCIEFD
>         depends on PCI
>         tristate "PEAK-System PCAN-PCIe FD cards"
>         ---help---
>           This driver adds support for the PEAK-System PCI Express FD
>           CAN-FD cards family.
>           These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
>           CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
>           1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
>           up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
>           electronics of the card and the respective computer against
>           disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
>           operated with ambient temperatures in a range of -40 to +85 °C.
>
>
> kconfiglib.KconfigSyntaxError:
> Malformed ascii in drivers/net/can/peak_canfd/Kconfig
> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
> Problematic data: b'\xc2'
> Reason: ordinal not in range(128)
>
>
> thanks,
> --
> ~Randy

Thanks for trying it out!

You're probably running in the C locale, which implies an ASCII
encoding. That has caused enough trouble that the Python devs decided
to automatically convert it to UTF-8 in Python 3.7:
https://www.python.org/dev/peps/pep-0538/. LC_CTYPE=C.UTF-8 should fix
it.

It's a bit silly to have it crash for something like that though. I
could force UTF-8 instead of respecting the locale (though it feels
neater to respect settings), or tell Python to ignore decoding errors.
Should probably do something at least...

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01 18:52     ` Randy Dunlap
@ 2018-05-01 19:33       ` Ulf Magnusson
  2018-05-03  2:47       ` Ulf Magnusson
  1 sibling, 0 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-01 19:33 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Tue, May 1, 2018 at 8:52 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 05/01/2018 11:13 AM, Randy Dunlap wrote:
>> On 05/01/2018 10:56 AM, Randy Dunlap wrote:
>>> On 04/30/2018 05:57 PM, Ulf Magnusson wrote:
>>>> Hello,
>>>>
>>>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
>>>> terminal menuconfig implementation, implemented in plain curses
>>>> (which is in the Python standard library).
>>>>
>>>> The interface should feel familiar to people used to mconf. It has
>>>> some features that mconf lacks:
>>>>
>>>>   - Seamless resizing
>>>>
>>>>   - Unicode support
>>>>
>>>>   - Runs on Windows (via 'pip install windows-curses', which uses
>>>>     PDCurses)
>>>>
>>>>   - Improved information displays:
>>>>
>>>>     * All expressions are split into readable chunks
>>>>
>>>>     * Menus and comments have information displays
>>>>
>>>>   - Relatively easy-to-read and easy-to-tweak code.
>>>>
>>>>     Kconfiglib automatically invalidates symbols as needed, and
>>>>     values can never get stale, which helps.
>>>>
>>>> Some upcoming features are mouse support and a search feature that
>>>> can jump directly to the definition of a symbol. The jump-to feature
>>>> will use a "show-all" mode in case the symbol isn't visible.
>>>>
>>>> See the Kconfiglib GitHub page for screenshots. The menuconfig
>>>> implementation is at
>>>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
>>>> The docstring at the top has some more information.
>>>
>>> Hi,
>>>
>>> I'm probably missing some python additive (I hope it's that easy), but
>>> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig:
>>>
>>> config CAN_PEAK_PCIEFD
>>>      depends on PCI
>>>      tristate "PEAK-System PCAN-PCIe FD cards"
>>>      ---help---
>>>        This driver adds support for the PEAK-System PCI Express FD
>>>        CAN-FD cards family.
>>>        These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
>>>        CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
>>>        1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
>>>        up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
>>>        electronics of the card and the respective computer against
>>>        disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
>>>        operated with ambient temperatures in a range of -40 to +85 °C.
>>>
>>>
>>> kconfiglib.KconfigSyntaxError:
>>> Malformed ascii in drivers/net/can/peak_canfd/Kconfig
>>> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
>>> Problematic data: b'\xc2'
>>> Reason: ordinal not in range(128)
>>
>> BTW, after modifying 4 other instances of this "error," I have it running.
>> Now looking/testing. :)
>
> Hi Ulf,
>
> Here are a few comments for you FWIW.
>
> menuconfig.py uses the terminal window space better than menuconfig:
> fewer margins, less Help text so more usable lines.
>
> ESC/q is nicer than in ESC+ESC in menuconfig.
>
> What is the lower colored line for? I don't see it being used.

It's just a separator above the help text with the keys. Also has
arrows pointing down when the window is scrolled up.

Maybe the help text could appear directly at the bottom with a
different background color instead. Not sure if it'd get uglier.

>
> On Quit, don't need to prompt for Save when the file is already saved
> or has not been modified.

Will fix. I had gotten the idea that mconf always prompted, so I got
lazy for the initial version. :)

>
> When menuconfig displays the Kconfig menu tree and it is over term-width
> characters, it truncates on the left so that the user can see all of
> the current menu name. menuconfig.py truncates on the right so that
> the current menu name may be partially lost or totally lost.

You mean the menu path at the top? Will fix that.

>
> To enable=y a tristate symbol, cannot enter Y, must do Space Space to cycle
> from N to M to Y.

Had never noticed that feature in mconf. I'll add it.

>
> No / symbol search. I use that a lot, but I don't claim to be a
> typical user.

It's planned. It will also support jumping directly to a symbol in the
menu tree, which is a feature I've always missed in mconf.

A "show all" mode will be added at the same time, that shows invisible
symbols. Jumping to an invisible symbol can then turn it in
automatically.

>
>
> Thanks.
> --
> ~Randy

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01 19:12   ` Ulf Magnusson
@ 2018-05-01 19:47     ` Ulf Magnusson
  2018-05-01 21:07       ` Ulf Magnusson
  2018-05-14 16:58     ` Pavel Machek
  1 sibling, 1 reply; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-01 19:47 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Tue, May 1, 2018 at 9:12 PM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
> On Tue, May 1, 2018 at 7:56 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 04/30/2018 05:57 PM, Ulf Magnusson wrote:
>>> Hello,
>>>
>>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
>>> terminal menuconfig implementation, implemented in plain curses
>>> (which is in the Python standard library).
>>>
>>> The interface should feel familiar to people used to mconf. It has
>>> some features that mconf lacks:
>>>
>>>   - Seamless resizing
>>>
>>>   - Unicode support
>>>
>>>   - Runs on Windows (via 'pip install windows-curses', which uses
>>>     PDCurses)
>>>
>>>   - Improved information displays:
>>>
>>>     * All expressions are split into readable chunks
>>>
>>>     * Menus and comments have information displays
>>>
>>>   - Relatively easy-to-read and easy-to-tweak code.
>>>
>>>     Kconfiglib automatically invalidates symbols as needed, and
>>>     values can never get stale, which helps.
>>>
>>> Some upcoming features are mouse support and a search feature that
>>> can jump directly to the definition of a symbol. The jump-to feature
>>> will use a "show-all" mode in case the symbol isn't visible.
>>>
>>> See the Kconfiglib GitHub page for screenshots. The menuconfig
>>> implementation is at
>>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
>>> The docstring at the top has some more information.
>>
>> Hi,
>>
>> I'm probably missing some python additive (I hope it's that easy), but
>> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig:
>>
>> config CAN_PEAK_PCIEFD
>>         depends on PCI
>>         tristate "PEAK-System PCAN-PCIe FD cards"
>>         ---help---
>>           This driver adds support for the PEAK-System PCI Express FD
>>           CAN-FD cards family.
>>           These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
>>           CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
>>           1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
>>           up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
>>           electronics of the card and the respective computer against
>>           disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
>>           operated with ambient temperatures in a range of -40 to +85 °C.
>>
>>
>> kconfiglib.KconfigSyntaxError:
>> Malformed ascii in drivers/net/can/peak_canfd/Kconfig
>> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
>> Problematic data: b'\xc2'
>> Reason: ordinal not in range(128)
>>
>>
>> thanks,
>> --
>> ~Randy
>
> Thanks for trying it out!
>
> You're probably running in the C locale, which implies an ASCII
> encoding. That has caused enough trouble that the Python devs decided
> to automatically convert it to UTF-8 in Python 3.7:
> https://www.python.org/dev/peps/pep-0538/. LC_CTYPE=C.UTF-8 should fix
> it.
>
> It's a bit silly to have it crash for something like that though. I
> could force UTF-8 instead of respecting the locale (though it feels
> neater to respect settings), or tell Python to ignore decoding errors.
> Should probably do something at least...
>
> Cheers,
> Ulf

Leaning towards just forcing UTF-8. It's what you want in 99% of
cases, and ignoring decoding errors would be unsafe for Unicode string
values.

Could make the forcing optional, and default to on...

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01 19:47     ` Ulf Magnusson
@ 2018-05-01 21:07       ` Ulf Magnusson
  2018-05-03 20:28         ` Randy Dunlap
  0 siblings, 1 reply; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-01 21:07 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Tue, May 1, 2018 at 9:47 PM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
> On Tue, May 1, 2018 at 9:12 PM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
>> On Tue, May 1, 2018 at 7:56 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>> On 04/30/2018 05:57 PM, Ulf Magnusson wrote:
>>>> Hello,
>>>>
>>>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
>>>> terminal menuconfig implementation, implemented in plain curses
>>>> (which is in the Python standard library).
>>>>
>>>> The interface should feel familiar to people used to mconf. It has
>>>> some features that mconf lacks:
>>>>
>>>>   - Seamless resizing
>>>>
>>>>   - Unicode support
>>>>
>>>>   - Runs on Windows (via 'pip install windows-curses', which uses
>>>>     PDCurses)
>>>>
>>>>   - Improved information displays:
>>>>
>>>>     * All expressions are split into readable chunks
>>>>
>>>>     * Menus and comments have information displays
>>>>
>>>>   - Relatively easy-to-read and easy-to-tweak code.
>>>>
>>>>     Kconfiglib automatically invalidates symbols as needed, and
>>>>     values can never get stale, which helps.
>>>>
>>>> Some upcoming features are mouse support and a search feature that
>>>> can jump directly to the definition of a symbol. The jump-to feature
>>>> will use a "show-all" mode in case the symbol isn't visible.
>>>>
>>>> See the Kconfiglib GitHub page for screenshots. The menuconfig
>>>> implementation is at
>>>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
>>>> The docstring at the top has some more information.
>>>
>>> Hi,
>>>
>>> I'm probably missing some python additive (I hope it's that easy), but
>>> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig:
>>>
>>> config CAN_PEAK_PCIEFD
>>>         depends on PCI
>>>         tristate "PEAK-System PCAN-PCIe FD cards"
>>>         ---help---
>>>           This driver adds support for the PEAK-System PCI Express FD
>>>           CAN-FD cards family.
>>>           These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
>>>           CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
>>>           1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
>>>           up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
>>>           electronics of the card and the respective computer against
>>>           disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
>>>           operated with ambient temperatures in a range of -40 to +85 °C.
>>>
>>>
>>> kconfiglib.KconfigSyntaxError:
>>> Malformed ascii in drivers/net/can/peak_canfd/Kconfig
>>> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
>>> Problematic data: b'\xc2'
>>> Reason: ordinal not in range(128)
>>>
>>>
>>> thanks,
>>> --
>>> ~Randy
>>
>> Thanks for trying it out!
>>
>> You're probably running in the C locale, which implies an ASCII
>> encoding. That has caused enough trouble that the Python devs decided
>> to automatically convert it to UTF-8 in Python 3.7:
>> https://www.python.org/dev/peps/pep-0538/. LC_CTYPE=C.UTF-8 should fix
>> it.
>>
>> It's a bit silly to have it crash for something like that though. I
>> could force UTF-8 instead of respecting the locale (though it feels
>> neater to respect settings), or tell Python to ignore decoding errors.
>> Should probably do something at least...
>>
>> Cheers,
>> Ulf
>
> Leaning towards just forcing UTF-8. It's what you want in 99% of
> cases, and ignoring decoding errors would be unsafe for Unicode string
> values.
>
> Could make the forcing optional, and default to on...
>
> Cheers,
> Ulf

Went with a more general solution:
https://github.com/ulfalizer/Kconfiglib/commit/da40c014398f329b324a2eb9de062344e773dc74

You can now specify any encoding (or None, to use the encoding
specified in the environment), with "utf-8" as the default. That
default probably saves a bunch of pain in practice.

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01 18:52     ` Randy Dunlap
  2018-05-01 19:33       ` Ulf Magnusson
@ 2018-05-03  2:47       ` Ulf Magnusson
  2018-05-03 20:31         ` Randy Dunlap
  1 sibling, 1 reply; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-03  2:47 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Tue, May 1, 2018 at 8:52 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 05/01/2018 11:13 AM, Randy Dunlap wrote:
>> On 05/01/2018 10:56 AM, Randy Dunlap wrote:
>>> On 04/30/2018 05:57 PM, Ulf Magnusson wrote:
>>>> Hello,
>>>>
>>>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
>>>> terminal menuconfig implementation, implemented in plain curses
>>>> (which is in the Python standard library).
>>>>
>>>> The interface should feel familiar to people used to mconf. It has
>>>> some features that mconf lacks:
>>>>
>>>>   - Seamless resizing
>>>>
>>>>   - Unicode support
>>>>
>>>>   - Runs on Windows (via 'pip install windows-curses', which uses
>>>>     PDCurses)
>>>>
>>>>   - Improved information displays:
>>>>
>>>>     * All expressions are split into readable chunks
>>>>
>>>>     * Menus and comments have information displays
>>>>
>>>>   - Relatively easy-to-read and easy-to-tweak code.
>>>>
>>>>     Kconfiglib automatically invalidates symbols as needed, and
>>>>     values can never get stale, which helps.
>>>>
>>>> Some upcoming features are mouse support and a search feature that
>>>> can jump directly to the definition of a symbol. The jump-to feature
>>>> will use a "show-all" mode in case the symbol isn't visible.
>>>>
>>>> See the Kconfiglib GitHub page for screenshots. The menuconfig
>>>> implementation is at
>>>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
>>>> The docstring at the top has some more information.
>>>
>>> Hi,
>>>
>>> I'm probably missing some python additive (I hope it's that easy), but
>>> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig:
>>>
>>> config CAN_PEAK_PCIEFD
>>>      depends on PCI
>>>      tristate "PEAK-System PCAN-PCIe FD cards"
>>>      ---help---
>>>        This driver adds support for the PEAK-System PCI Express FD
>>>        CAN-FD cards family.
>>>        These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
>>>        CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
>>>        1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
>>>        up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
>>>        electronics of the card and the respective computer against
>>>        disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
>>>        operated with ambient temperatures in a range of -40 to +85 °C.
>>>
>>>
>>> kconfiglib.KconfigSyntaxError:
>>> Malformed ascii in drivers/net/can/peak_canfd/Kconfig
>>> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
>>> Problematic data: b'\xc2'
>>> Reason: ordinal not in range(128)
>>
>> BTW, after modifying 4 other instances of this "error," I have it running.
>> Now looking/testing. :)
>
> Hi Ulf,
>
> Here are a few comments for you FWIW.
>
> menuconfig.py uses the terminal window space better than menuconfig:
> fewer margins, less Help text so more usable lines.
>
> ESC/q is nicer than in ESC+ESC in menuconfig.
>
> What is the lower colored line for? I don't see it being used.

It might show "Show-all mode enabled" now too. ;)

>
> On Quit, don't need to prompt for Save when the file is already saved
> or has not been modified.

Fixed.

>
> When menuconfig displays the Kconfig menu tree and it is over term-width
> characters, it truncates on the left so that the user can see all of
> the current menu name. menuconfig.py truncates on the right so that
> the current menu name may be partially lost or totally lost.

Fixed. The menu path now scrolls to the right as needed. Maybe "..."
could be displayed as well, though I'm not sure if it's helpful in
practice.

>
> To enable=y a tristate symbol, cannot enter Y, must do Space Space to cycle
> from N to M to Y.

Fixed.

>
> No / symbol search. I use that a lot, but I don't claim to be a
> typical user.

Coming soon. I have added a "show-all" mode in preparation for it, as
you might want to jump to invisible symbols.

Screenshot: https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss9.png

>
>
> Thanks.
> --
> ~Randy

Thanks for the feedback! Tell me if you spot anything else.

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01 21:07       ` Ulf Magnusson
@ 2018-05-03 20:28         ` Randy Dunlap
  2018-05-03 22:48           ` Ulf Magnusson
  2018-05-08 16:59           ` Ulf Magnusson
  0 siblings, 2 replies; 33+ messages in thread
From: Randy Dunlap @ 2018-05-03 20:28 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/01/2018 02:07 PM, Ulf Magnusson wrote:
> On Tue, May 1, 2018 at 9:47 PM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
>> On Tue, May 1, 2018 at 9:12 PM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
>>> On Tue, May 1, 2018 at 7:56 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>>> On 04/30/2018 05:57 PM, Ulf Magnusson wrote:
>>>>> Hello,
>>>>>
>>>>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a
>>>>> terminal menuconfig implementation, implemented in plain curses
>>>>> (which is in the Python standard library).
>>>>>
>>>>> The interface should feel familiar to people used to mconf. It has
>>>>> some features that mconf lacks:
>>>>>
>>>>>   - Seamless resizing
>>>>>
>>>>>   - Unicode support
>>>>>
>>>>>   - Runs on Windows (via 'pip install windows-curses', which uses
>>>>>     PDCurses)
>>>>>
>>>>>   - Improved information displays:
>>>>>
>>>>>     * All expressions are split into readable chunks
>>>>>
>>>>>     * Menus and comments have information displays
>>>>>
>>>>>   - Relatively easy-to-read and easy-to-tweak code.
>>>>>
>>>>>     Kconfiglib automatically invalidates symbols as needed, and
>>>>>     values can never get stale, which helps.
>>>>>
>>>>> Some upcoming features are mouse support and a search feature that
>>>>> can jump directly to the definition of a symbol. The jump-to feature
>>>>> will use a "show-all" mode in case the symbol isn't visible.
>>>>>
>>>>> See the Kconfiglib GitHub page for screenshots. The menuconfig
>>>>> implementation is at
>>>>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py.
>>>>> The docstring at the top has some more information.
>>>>
>>>> Hi,
>>>>
>>>> I'm probably missing some python additive (I hope it's that easy), but
>>>> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig:
>>>>
>>>> config CAN_PEAK_PCIEFD
>>>>         depends on PCI
>>>>         tristate "PEAK-System PCAN-PCIe FD cards"
>>>>         ---help---
>>>>           This driver adds support for the PEAK-System PCI Express FD
>>>>           CAN-FD cards family.
>>>>           These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
>>>>           CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
>>>>           1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
>>>>           up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
>>>>           electronics of the card and the respective computer against
>>>>           disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
>>>>           operated with ambient temperatures in a range of -40 to +85 °C.
>>>>
>>>>
>>>> kconfiglib.KconfigSyntaxError:
>>>> Malformed ascii in drivers/net/can/peak_canfd/Kconfig
>>>> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
>>>> Problematic data: b'\xc2'
>>>> Reason: ordinal not in range(128)
>>>>
>>>>
>>>> thanks,
>>>> --
>>>> ~Randy
>>>
>>> Thanks for trying it out!
>>>
>>> You're probably running in the C locale, which implies an ASCII
>>> encoding. That has caused enough trouble that the Python devs decided
>>> to automatically convert it to UTF-8 in Python 3.7:
>>> https://www.python.org/dev/peps/pep-0538/. LC_CTYPE=C.UTF-8 should fix
>>> it.
>>>
>>> It's a bit silly to have it crash for something like that though. I
>>> could force UTF-8 instead of respecting the locale (though it feels
>>> neater to respect settings), or tell Python to ignore decoding errors.
>>> Should probably do something at least...
>>>
>>> Cheers,
>>> Ulf
>>
>> Leaning towards just forcing UTF-8. It's what you want in 99% of
>> cases, and ignoring decoding errors would be unsafe for Unicode string
>> values.
>>
>> Could make the forcing optional, and default to on...
>>
>> Cheers,
>> Ulf
> 
> Went with a more general solution:
> https://github.com/ulfalizer/Kconfiglib/commit/da40c014398f329b324a2eb9de062344e773dc74
> 
> You can now specify any encoding (or None, to use the encoding
> specified in the environment), with "utf-8" as the default. That
> default probably saves a bunch of pain in practice.

Hi,

(with new kconfiglib.py and menuconfig.py)

Thanks for the fixes.

If I use "LC_CTYPE=C.UTF-8" then I get the down arrows in the bottom colored
bar.  Without that, I get an upside-down T (that is 193, 0xc1, line drawing
character in the IBM extended character set).

Hm. With LC_CTYPE=C.UTF-8, the upper colored bar prints up arrows.
Without that, it prints ^^^^^^^^^^^^^^.
That's nice that it can do either.

Being a vim user, I do like the optional navigation keys.

-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-03  2:47       ` Ulf Magnusson
@ 2018-05-03 20:31         ` Randy Dunlap
  2018-05-03 21:26           ` Ulf Magnusson
  0 siblings, 1 reply; 33+ messages in thread
From: Randy Dunlap @ 2018-05-03 20:31 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/02/2018 07:47 PM, Ulf Magnusson wrote:
> On Tue, May 1, 2018 at 8:52 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 05/01/2018 11:13 AM, Randy Dunlap wrote:
>>
>> Hi Ulf,
>>
>> When menuconfig displays the Kconfig menu tree and it is over term-width
>> characters, it truncates on the left so that the user can see all of
>> the current menu name. menuconfig.py truncates on the right so that
>> the current menu name may be partially lost or totally lost.
> 
> Fixed. The menu path now scrolls to the right as needed. Maybe "..."
> could be displayed as well, though I'm not sure if it's helpful in
> practice.

Not needed.

>>
>> To enable=y a tristate symbol, cannot enter Y, must do Space Space to cycle
>> from N to M to Y.
> 
> Fixed.
> 
>>
>> No / symbol search. I use that a lot, but I don't claim to be a
>> typical user.
> 
> Coming soon. I have added a "show-all" mode in preparation for it, as
> you might want to jump to invisible symbols.

Sounds good.

> Screenshot: https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss9.png


One minor nit (bikeshed?):  I'm not crazy about "make scriptconfig".  :)

thanks,
-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-03 20:31         ` Randy Dunlap
@ 2018-05-03 21:26           ` Ulf Magnusson
  0 siblings, 0 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-03 21:26 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Thu, May 3, 2018 at 10:31 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> One minor nit (bikeshed?):  I'm not crazy about "make scriptconfig".  :)
>
> thanks,
> --
> ~Randy

To be honest, I just do

    ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
        Kconfiglib/menuconfig.py

Should probably add a target to the makefile patch. Need to pick up
environment variables somehow.

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-03 20:28         ` Randy Dunlap
@ 2018-05-03 22:48           ` Ulf Magnusson
  2018-05-04  0:05             ` Randy Dunlap
  2018-05-08 16:59           ` Ulf Magnusson
  1 sibling, 1 reply; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-03 22:48 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Thu, May 3, 2018 at 10:28 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> Hi,
>
> (with new kconfiglib.py and menuconfig.py)
>
> Thanks for the fixes.
>
> If I use "LC_CTYPE=C.UTF-8" then I get the down arrows in the bottom colored
> bar.  Without that, I get an upside-down T (that is 193, 0xc1, line drawing
> character in the IBM extended character set).
>
> Hm. With LC_CTYPE=C.UTF-8, the upper colored bar prints up arrows.
> Without that, it prints ^^^^^^^^^^^^^^.
> That's nice that it can do either.

The arrows use ACS_U/DARROW from the alternate character set. You get
nice Unicode arrows for those with ncurses/PDCurses, plus "fallbacks"
(strictly speaking the Unicode arrows are fallbacks too).

Unicode text entry is still broken with LC_CTYPE=C, because ncurses
respects it. Having the menuconfig just force C.UTF-8 if it's
available might fix a bunch of problems in practice, even if it feels
a bit iffy to force settings.

Python 3.7 will improve things at least. It converts LC_CTYPE=C into
LC_CTYPE=<some available UTF-8 locale>.

Cleanest would be if all environments sanely defaulted to UTF-8, but
that's not how it is in practice, unfortunately. :)

>
> Being a vim user, I do like the optional navigation keys.
>
> --
> ~Randy

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-03 22:48           ` Ulf Magnusson
@ 2018-05-04  0:05             ` Randy Dunlap
  0 siblings, 0 replies; 33+ messages in thread
From: Randy Dunlap @ 2018-05-04  0:05 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/03/2018 03:48 PM, Ulf Magnusson wrote:
> On Thu, May 3, 2018 at 10:28 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> Hi,
>>
>> (with new kconfiglib.py and menuconfig.py)
>>
>> Thanks for the fixes.
>>
>> If I use "LC_CTYPE=C.UTF-8" then I get the down arrows in the bottom colored
>> bar.  Without that, I get an upside-down T (that is 193, 0xc1, line drawing
>> character in the IBM extended character set).
>>
>> Hm. With LC_CTYPE=C.UTF-8, the upper colored bar prints up arrows.
>> Without that, it prints ^^^^^^^^^^^^^^.
>> That's nice that it can do either.
> 
> The arrows use ACS_U/DARROW from the alternate character set. You get
> nice Unicode arrows for those with ncurses/PDCurses, plus "fallbacks"
> (strictly speaking the Unicode arrows are fallbacks too).

Too bad it doesn't use "vvvvvvvvvvvvvv" for the down-arrow fallbacks.
Instead of that funky IBM PC line drawing stub.

> Unicode text entry is still broken with LC_CTYPE=C, because ncurses
> respects it. Having the menuconfig just force C.UTF-8 if it's
> available might fix a bunch of problems in practice, even if it feels
> a bit iffy to force settings.
> 
> Python 3.7 will improve things at least. It converts LC_CTYPE=C into
> LC_CTYPE=<some available UTF-8 locale>.
> 
> Cleanest would be if all environments sanely defaulted to UTF-8, but
> that's not how it is in practice, unfortunately. :)

thanks,
-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-03 20:28         ` Randy Dunlap
  2018-05-03 22:48           ` Ulf Magnusson
@ 2018-05-08 16:59           ` Ulf Magnusson
  2018-05-11  1:22             ` Ulf Magnusson
  2018-05-20  3:45             ` Randy Dunlap
  1 sibling, 2 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-08 16:59 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

Hello,

I've added incremental search for jumping directly to a symbol now.
Regular expressions are supported as well.

Some screenshots below:

https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png

The last screenshot shows how things might look after you jump to a
symbol. The jumped-to symbol wasn't visible in this case, so show-all
mode was turned on automatically.

On Thu, May 3, 2018 at 10:28 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> Hi,
>
> (with new kconfiglib.py and menuconfig.py)
>
> Thanks for the fixes.
>
> If I use "LC_CTYPE=C.UTF-8" then I get the down arrows in the bottom colored
> bar.  Without that, I get an upside-down T (that is 193, 0xc1, line drawing
> character in the IBM extended character set).

It now automatically tries to convert LC_CTYPE to a UTF-8 locale if it
is set to the C locale, similar to what PEP 538 does. I took the list
of locales to try from the CPython implementation.

That will save a bunch of pain in practice.

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-08 16:59           ` Ulf Magnusson
@ 2018-05-11  1:22             ` Ulf Magnusson
  2018-05-20  3:45             ` Randy Dunlap
  1 sibling, 0 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-11  1:22 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Tue, May 8, 2018 at 6:59 PM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
> Hello,
>
> I've added incremental search for jumping directly to a symbol now.
> Regular expressions are supported as well.
>
> Some screenshots below:
>
> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>
> The last screenshot shows how things might look after you jump to a
> symbol. The jumped-to symbol wasn't visible in this case, so show-all
> mode was turned on automatically.
>

Some new search-related features:

  - The jump-to dialog now searches and lists prompt texts.

  - A kind of poor man's fuzzy search has been added. 'foo bar baz'
    matches all entries that match all of 'foo', 'bar', and 'baz', as
    regexes.

Demo: https://asciinema.org/a/Q4UNFVPF5zd62KqjrG95mowkG

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-01 19:12   ` Ulf Magnusson
  2018-05-01 19:47     ` Ulf Magnusson
@ 2018-05-14 16:58     ` Pavel Machek
  2018-05-14 18:12       ` Ulf Magnusson
  1 sibling, 1 reply; 33+ messages in thread
From: Pavel Machek @ 2018-05-14 16:58 UTC (permalink / raw)
  To: Ulf Magnusson
  Cc: Randy Dunlap, Linux Kbuild mailing list, Linux Kernel Mailing List

Hi!

> > config CAN_PEAK_PCIEFD
> >         depends on PCI
> >         tristate "PEAK-System PCAN-PCIe FD cards"
> >         ---help---
> >           This driver adds support for the PEAK-System PCI Express FD
> >           CAN-FD cards family.
> >           These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
> >           CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
> >           1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
> >           up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
> >           electronics of the card and the respective computer against
> >           disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
> >           operated with ambient temperatures in a range of -40 to +85 °C.
> >
> >
> > kconfiglib.KconfigSyntaxError:
> > Malformed ascii in drivers/net/can/peak_canfd/Kconfig
> > Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
> > Problematic data: b'\xc2'
> > Reason: ordinal not in range(128)
> >
> >
> > thanks,
> > --
> > ~Randy
> 
> Thanks for trying it out!
> 
> You're probably running in the C locale, which implies an ASCII
> encoding. That has caused enough trouble that the Python devs decided
> to automatically convert it to UTF-8 in Python 3.7:
> https://www.python.org/dev/peps/pep-0538/. LC_CTYPE=C.UTF-8 should fix
> it.
> 
> It's a bit silly to have it crash for something like that though. I
> could force UTF-8 instead of respecting the locale (though it feels
> neater to respect settings), or tell Python to ignore decoding errors.
> Should probably do something at least...

Well, Kconfig files are utf-8, as is the rest of kernel.

So yes, you should respect $LC_CTYPE for display etc, but you should always
assume Kconfig files are utf-8... and that does not need to be optional.

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-14 16:58     ` Pavel Machek
@ 2018-05-14 18:12       ` Ulf Magnusson
  0 siblings, 0 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-14 18:12 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Randy Dunlap, Linux Kbuild mailing list, Linux Kernel Mailing List

On Mon, May 14, 2018 at 6:58 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> > config CAN_PEAK_PCIEFD
>> >         depends on PCI
>> >         tristate "PEAK-System PCAN-PCIe FD cards"
>> >         ---help---
>> >           This driver adds support for the PEAK-System PCI Express FD
>> >           CAN-FD cards family.
>> >           These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
>> >           CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
>> >           1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
>> >           up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
>> >           electronics of the card and the respective computer against
>> >           disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
>> >           operated with ambient temperatures in a range of -40 to +85 °C.
>> >
>> >
>> > kconfiglib.KconfigSyntaxError:
>> > Malformed ascii in drivers/net/can/peak_canfd/Kconfig
>> > Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
>> > Problematic data: b'\xc2'
>> > Reason: ordinal not in range(128)
>> >
>> >
>> > thanks,
>> > --
>> > ~Randy
>>
>> Thanks for trying it out!
>>
>> You're probably running in the C locale, which implies an ASCII
>> encoding. That has caused enough trouble that the Python devs decided
>> to automatically convert it to UTF-8 in Python 3.7:
>> https://www.python.org/dev/peps/pep-0538/. LC_CTYPE=C.UTF-8 should fix
>> it.
>>
>> It's a bit silly to have it crash for something like that though. I
>> could force UTF-8 instead of respecting the locale (though it feels
>> neater to respect settings), or tell Python to ignore decoding errors.
>> Should probably do something at least...
>
> Well, Kconfig files are utf-8, as is the rest of kernel.

Yeah, it's the only sane assumption anyway.

>
> So yes, you should respect $LC_CTYPE for display etc, but you should always
> assume Kconfig files are utf-8... and that does not need to be optional.

Already made it optional, with UTF-8 as the default (via
Kconfig.__init__(..., encoding="utf-8")).

I did a similar thing to what PEP 538 does for the menuconfig:
https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py#L2271.
The C locale is converted to a UTF-8 locale for LC_CTYPE if possible.
Other locales are respected. That'll be the default behavior in Python
3.7, and prevents issues with get_wch().

>
>                                                                         Pavel

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-08 16:59           ` Ulf Magnusson
  2018-05-11  1:22             ` Ulf Magnusson
@ 2018-05-20  3:45             ` Randy Dunlap
  2018-05-20  3:51               ` Randy Dunlap
                                 ` (2 more replies)
  1 sibling, 3 replies; 33+ messages in thread
From: Randy Dunlap @ 2018-05-20  3:45 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
> Hello,
> 
> I've added incremental search for jumping directly to a symbol now.
> Regular expressions are supported as well.
> 
> Some screenshots below:
> 
> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
> 
> The last screenshot shows how things might look after you jump to a
> symbol. The jumped-to symbol wasn't visible in this case, so show-all
> mode was turned on automatically.

Hi Ulf,

Do I need to save kconfiglib.py in a special location?

With (new) kconfiglib.py and menuconfig.py, I am getting this:

$ make ARCH=x86_64 O=xx64 iscriptconfig
make[1]: Entering directory '/home/rdunlap/lnx/lnx-417-rc3/xx64'
  GEN     ./Makefile
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'kconfiglib'
>>> 

and then if I (being a Python novice) copy kconfiglib.py to
/usr/lib/python3.4/site-packages/ and try again, I get 16 warning messages (below)
and then this:

A Kconfig instance 'kconf' for the architecture x86_64 has been created.
>>> 

What am I supposed to do now?

Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.

    ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
        Kconfiglib/menuconfig.py

so yes, a real Makefile target would be nice. :)


thanks,
-- 
~Randy

the 16 warning messages:

warning: SCSI_DPT_I2O (defined at drivers/scsi/Kconfig:482) has leading or trailing whitespace in its prompt
warning: ATM_FIRESTREAM (defined at drivers/atm/Kconfig:149) has leading or trailing whitespace in its prompt
warning: IWLWIFI (defined at drivers/net/wireless/intel/iwlwifi/Kconfig:1) has leading or trailing whitespace in its prompt
warning: REGULATOR_MAX8973 (defined at drivers/regulator/Kconfig:479) has leading or trailing whitespace in its prompt
warning: MEMSTICK_TIFM_MS (defined at drivers/memstick/host/Kconfig:7) has leading or trailing whitespace in its prompt
warning: MV_XOR_V2 (defined at drivers/dma/Kconfig:374) has leading or trailing whitespace in its prompt
warning: PANEL_LCD_PIN_E (defined at drivers/auxdisplay/Kconfig:335) has leading or trailing whitespace in its prompt
warning: PANEL_LCD_PIN_RS (defined at drivers/auxdisplay/Kconfig:350) has leading or trailing whitespace in its prompt
warning: PANEL_LCD_PIN_RW (defined at drivers/auxdisplay/Kconfig:365) has leading or trailing whitespace in its prompt
warning: PANEL_LCD_PIN_SCL (defined at drivers/auxdisplay/Kconfig:380) has leading or trailing whitespace in its prompt
warning: PANEL_LCD_PIN_SDA (defined at drivers/auxdisplay/Kconfig:395) has leading or trailing whitespace in its prompt
warning: PANEL_LCD_PIN_BL (defined at drivers/auxdisplay/Kconfig:410) has leading or trailing whitespace in its prompt
warning: INTEGRITY_AUDIT (defined at security/integrity/Kconfig:54) has leading or trailing whitespace in its prompt
warning: the choice symbol VIRT_CPU_ACCOUNTING_GEN (defined at init/Kconfig:359) is selected by the following symbols, which has no effect: 
 - NO_HZ_FULL (defined at kernel/time/Kconfig:85)
warning: the choice symbol M486 (defined at arch/x86/Kconfig.cpu:53) is selected by the following symbols, which has no effect: 
 - X86_RDC321X (defined at arch/x86/Kconfig:653)
warning: the choice symbol FB_LITTLE_ENDIAN (defined at drivers/video/fbdev/Kconfig:168) is selected by the following symbols, which has no effect: 
 - FB_MB862XX_LIME (defined at drivers/video/fbdev/Kconfig:2190)

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  3:45             ` Randy Dunlap
@ 2018-05-20  3:51               ` Randy Dunlap
  2018-05-20  4:24                 ` Ulf Magnusson
  2018-05-20  4:03               ` Randy Dunlap
  2018-05-20  6:03               ` Ulf Magnusson
  2 siblings, 1 reply; 33+ messages in thread
From: Randy Dunlap @ 2018-05-20  3:51 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/19/2018 08:45 PM, Randy Dunlap wrote:
> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>> Hello,
>>
>> I've added incremental search for jumping directly to a symbol now.
>> Regular expressions are supported as well.
>>
>> Some screenshots below:
>>
>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>
>> The last screenshot shows how things might look after you jump to a
>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>> mode was turned on automatically.
> 
> Hi Ulf,
> 
> 
> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
> 
>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>         Kconfiglib/menuconfig.py
> 
> so yes, a real Makefile target would be nice. :)


Enter: / (search)
then:  * (Bang) [this was just an unlucky typo on my part]

Traceback (most recent call last):
  File "/home/rdunlap/scripts/menuconfig.py", line 1447, in _jump_to_dialog
    for regex in s.split()]
  File "/home/rdunlap/scripts/menuconfig.py", line 1447, in <listcomp>
    for regex in s.split()]
  File "/usr/lib64/python3.4/re.py", line 223, in compile
    return _compile(pattern, flags)
  File "/usr/lib64/python3.4/re.py", line 294, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib64/python3.4/sre_compile.py", line 568, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib64/python3.4/sre_parse.py", line 780, in parse
    p = _parse_sub(source, pattern, 0)
  File "/usr/lib64/python3.4/sre_parse.py", line 377, in _parse_sub
    itemsappend(_parse(source, state))
  File "/usr/lib64/python3.4/sre_parse.py", line 586, in _parse
    raise error("nothing to repeat")
sre_constants.error: nothing to repeat

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rdunlap/scripts/menuconfig.py", line 2389, in <module>
    menuconfig(Kconfig("Kconfig" if len(sys.argv) < 2 else sys.argv[1]))
  File "/home/rdunlap/scripts/menuconfig.py", line 340, in menuconfig
    print(curses.wrapper(_menuconfig))
  File "/usr/lib64/python3.4/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/rdunlap/scripts/menuconfig.py", line 483, in _menuconfig
    _jump_to_dialog()
  File "/home/rdunlap/scripts/menuconfig.py", line 1466, in _jump_to_dialog
    bad_re = e.msg
AttributeError: 'error' object has no attribute 'msg'



-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  3:45             ` Randy Dunlap
  2018-05-20  3:51               ` Randy Dunlap
@ 2018-05-20  4:03               ` Randy Dunlap
  2018-05-20  4:47                 ` Ulf Magnusson
  2018-05-20  7:51                 ` Ulf Magnusson
  2018-05-20  6:03               ` Ulf Magnusson
  2 siblings, 2 replies; 33+ messages in thread
From: Randy Dunlap @ 2018-05-20  4:03 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/19/2018 08:45 PM, Randy Dunlap wrote:
> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>> Hello,
>>
>> I've added incremental search for jumping directly to a symbol now.
>> Regular expressions are supported as well.
>>
>> Some screenshots below:
>>
>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>
>> The last screenshot shows how things might look after you jump to a
>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>> mode was turned on automatically.
> 
> Hi Ulf,
> 
> 
> 
> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
> 
>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>         Kconfiglib/menuconfig.py
> 
> so yes, a real Makefile target would be nice. :)

I want to see all kconfig symbols that end with "_DEBUG" (so excluding
_DEBUGFS).  Using:

/.*_DEBUG$

shows me 6 symbols:
ATH9K_COMMON_DEBUG
DVB_B2C2_FLEXCOP_DEBUG
HAVE_DMA_API_DEBUG
IP_DCCP_TFRC_DEBUG
NFS_DEBUG
PM_SLEEP_DEBUG

so where are the other (approx.) 176?
see:
$ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
    182     364    9179


Anyway, something for you to look at. :)

-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  3:51               ` Randy Dunlap
@ 2018-05-20  4:24                 ` Ulf Magnusson
  2018-05-20  5:50                   ` Ulf Magnusson
  0 siblings, 1 reply; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-20  4:24 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Sun, May 20, 2018 at 5:51 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>> Hello,
>>>
>>> I've added incremental search for jumping directly to a symbol now.
>>> Regular expressions are supported as well.
>>>
>>> Some screenshots below:
>>>
>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>
>>> The last screenshot shows how things might look after you jump to a
>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>> mode was turned on automatically.
>>
>> Hi Ulf,
>>
>>
>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>
>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>         Kconfiglib/menuconfig.py
>>
>> so yes, a real Makefile target would be nice. :)
>
>
> Enter: / (search)
> then:  * (Bang) [this was just an unlucky typo on my part]
>
> Traceback (most recent call last):
>   File "/home/rdunlap/scripts/menuconfig.py", line 1447, in _jump_to_dialog
>     for regex in s.split()]
>   File "/home/rdunlap/scripts/menuconfig.py", line 1447, in <listcomp>
>     for regex in s.split()]
>   File "/usr/lib64/python3.4/re.py", line 223, in compile
>     return _compile(pattern, flags)
>   File "/usr/lib64/python3.4/re.py", line 294, in _compile
>     p = sre_compile.compile(pattern, flags)
>   File "/usr/lib64/python3.4/sre_compile.py", line 568, in compile
>     p = sre_parse.parse(p, flags)
>   File "/usr/lib64/python3.4/sre_parse.py", line 780, in parse
>     p = _parse_sub(source, pattern, 0)
>   File "/usr/lib64/python3.4/sre_parse.py", line 377, in _parse_sub
>     itemsappend(_parse(source, state))
>   File "/usr/lib64/python3.4/sre_parse.py", line 586, in _parse
>     raise error("nothing to repeat")
> sre_constants.error: nothing to repeat
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/home/rdunlap/scripts/menuconfig.py", line 2389, in <module>
>     menuconfig(Kconfig("Kconfig" if len(sys.argv) < 2 else sys.argv[1]))
>   File "/home/rdunlap/scripts/menuconfig.py", line 340, in menuconfig
>     print(curses.wrapper(_menuconfig))
>   File "/usr/lib64/python3.4/curses/__init__.py", line 94, in wrapper
>     return func(stdscr, *args, **kwds)
>   File "/home/rdunlap/scripts/menuconfig.py", line 483, in _menuconfig
>     _jump_to_dialog()
>   File "/home/rdunlap/scripts/menuconfig.py", line 1466, in _jump_to_dialog
>     bad_re = e.msg
> AttributeError: 'error' object has no attribute 'msg'
>
>
>
> --
> ~Randy

Thanks for the report!

Invalid regular expressions are detected, but it looks like the 'msg'
field of re.error was added in Python 3.5 (you have 3.4).

I'll check if the 'msg' field exists and fall back to just printing
"Invalid regular expression" otherwise. The 'msg' field just gives a
more informative error
("Bad regular expression: nothing to repeat" in this case).

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  4:03               ` Randy Dunlap
@ 2018-05-20  4:47                 ` Ulf Magnusson
  2018-05-20  5:13                   ` Ulf Magnusson
  2018-05-21  2:45                   ` Randy Dunlap
  2018-05-20  7:51                 ` Ulf Magnusson
  1 sibling, 2 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-20  4:47 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Sun, May 20, 2018 at 6:03 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>> Hello,
>>>
>>> I've added incremental search for jumping directly to a symbol now.
>>> Regular expressions are supported as well.
>>>
>>> Some screenshots below:
>>>
>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>
>>> The last screenshot shows how things might look after you jump to a
>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>> mode was turned on automatically.
>>
>> Hi Ulf,
>>
>>
>>
>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>
>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>         Kconfiglib/menuconfig.py
>>
>> so yes, a real Makefile target would be nice. :)
>
> I want to see all kconfig symbols that end with "_DEBUG" (so excluding
> _DEBUGFS).  Using:
>
> /.*_DEBUG$
>
> shows me 6 symbols:
> ATH9K_COMMON_DEBUG
> DVB_B2C2_FLEXCOP_DEBUG
> HAVE_DMA_API_DEBUG
> IP_DCCP_TFRC_DEBUG
> NFS_DEBUG
> PM_SLEEP_DEBUG
>
> so where are the other (approx.) 176?
> see:
> $ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
>     182     364    9179
>
>
> Anyway, something for you to look at. :)
>
> --
> ~Randy

It's related to how the search is done. Searching for "DEBUG\b" (word
boundary) instead will find all of them.

A string is generated for each symbol. For symbols with prompts, this
string includes the prompt as well, so you get e.g.

    AB8500_DEBUG "Enable debug info via debugfs"

Those strings are then searched/displayed.

What you got with your search was all symbols whose names end in
"_DEBUG" that don't have a prompt.

The nice thing about searching both the name and the prompt is that
e.g. "debugfs ab8500" will find the symbol above. I'm also planning to
add menus to the search, by generating 'menu: "menu title"' strings
for them.

It's a bit awkward/unintuitive that what you tried doesn't work
though. Maybe the symbol name could be searched separately from the
prompt, though I'd be a bit sad to abandon the super simple
single-string-per-entry implementation approach. :)

Thanks,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  4:47                 ` Ulf Magnusson
@ 2018-05-20  5:13                   ` Ulf Magnusson
  2018-05-21  2:45                   ` Randy Dunlap
  1 sibling, 0 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-20  5:13 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Sun, May 20, 2018 at 6:47 AM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
> On Sun, May 20, 2018 at 6:03 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>>> Hello,
>>>>
>>>> I've added incremental search for jumping directly to a symbol now.
>>>> Regular expressions are supported as well.
>>>>
>>>> Some screenshots below:
>>>>
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>>
>>>> The last screenshot shows how things might look after you jump to a
>>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>>> mode was turned on automatically.
>>>
>>> Hi Ulf,
>>>
>>>
>>>
>>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>>
>>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>>         Kconfiglib/menuconfig.py
>>>
>>> so yes, a real Makefile target would be nice. :)
>>
>> I want to see all kconfig symbols that end with "_DEBUG" (so excluding
>> _DEBUGFS).  Using:
>>
>> /.*_DEBUG$
>>
>> shows me 6 symbols:
>> ATH9K_COMMON_DEBUG
>> DVB_B2C2_FLEXCOP_DEBUG
>> HAVE_DMA_API_DEBUG
>> IP_DCCP_TFRC_DEBUG
>> NFS_DEBUG
>> PM_SLEEP_DEBUG
>>
>> so where are the other (approx.) 176?
>> see:
>> $ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
>>     182     364    9179
>>
>>
>> Anyway, something for you to look at. :)
>>
>> --
>> ~Randy
>
> It's related to how the search is done. Searching for "DEBUG\b" (word
> boundary) instead will find all of them.
>
> A string is generated for each symbol. For symbols with prompts, this
> string includes the prompt as well, so you get e.g.
>
>     AB8500_DEBUG "Enable debug info via debugfs"
>
> Those strings are then searched/displayed.
>
> What you got with your search was all symbols whose names end in
> "_DEBUG" that don't have a prompt.
>
> The nice thing about searching both the name and the prompt is that
> e.g. "debugfs ab8500" will find the symbol above. I'm also planning to
> add menus to the search, by generating 'menu: "menu title"' strings
> for them.
>
> It's a bit awkward/unintuitive that what you tried doesn't work
> though. Maybe the symbol name could be searched separately from the
> prompt, though I'd be a bit sad to abandon the super simple
> single-string-per-entry implementation approach. :)
>
> Thanks,
> Ulf

Need to make that "_DEBUG\b" to avoid getting a bunch of hits in prompts though.

Searching the name separately from the prompt might give nicer
behavior when regexes are involved. People might not expect e.g.
'debug.*info' to match for AB8500_DEBUG either, but it would, because
the prompt has "info" in it. OTOH, for searches like that, you'd
usually just type "debug info", and then narrow it down with more
words.

Any opinions?

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  4:24                 ` Ulf Magnusson
@ 2018-05-20  5:50                   ` Ulf Magnusson
  0 siblings, 0 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-20  5:50 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Sun, May 20, 2018 at 6:24 AM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
> On Sun, May 20, 2018 at 5:51 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>>> Hello,
>>>>
>>>> I've added incremental search for jumping directly to a symbol now.
>>>> Regular expressions are supported as well.
>>>>
>>>> Some screenshots below:
>>>>
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>>
>>>> The last screenshot shows how things might look after you jump to a
>>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>>> mode was turned on automatically.
>>>
>>> Hi Ulf,
>>>
>>>
>>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>>
>>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>>         Kconfiglib/menuconfig.py
>>>
>>> so yes, a real Makefile target would be nice. :)
>>
>>
>> Enter: / (search)
>> then:  * (Bang) [this was just an unlucky typo on my part]
>>
>> Traceback (most recent call last):
>>   File "/home/rdunlap/scripts/menuconfig.py", line 1447, in _jump_to_dialog
>>     for regex in s.split()]
>>   File "/home/rdunlap/scripts/menuconfig.py", line 1447, in <listcomp>
>>     for regex in s.split()]
>>   File "/usr/lib64/python3.4/re.py", line 223, in compile
>>     return _compile(pattern, flags)
>>   File "/usr/lib64/python3.4/re.py", line 294, in _compile
>>     p = sre_compile.compile(pattern, flags)
>>   File "/usr/lib64/python3.4/sre_compile.py", line 568, in compile
>>     p = sre_parse.parse(p, flags)
>>   File "/usr/lib64/python3.4/sre_parse.py", line 780, in parse
>>     p = _parse_sub(source, pattern, 0)
>>   File "/usr/lib64/python3.4/sre_parse.py", line 377, in _parse_sub
>>     itemsappend(_parse(source, state))
>>   File "/usr/lib64/python3.4/sre_parse.py", line 586, in _parse
>>     raise error("nothing to repeat")
>> sre_constants.error: nothing to repeat
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "/home/rdunlap/scripts/menuconfig.py", line 2389, in <module>
>>     menuconfig(Kconfig("Kconfig" if len(sys.argv) < 2 else sys.argv[1]))
>>   File "/home/rdunlap/scripts/menuconfig.py", line 340, in menuconfig
>>     print(curses.wrapper(_menuconfig))
>>   File "/usr/lib64/python3.4/curses/__init__.py", line 94, in wrapper
>>     return func(stdscr, *args, **kwds)
>>   File "/home/rdunlap/scripts/menuconfig.py", line 483, in _menuconfig
>>     _jump_to_dialog()
>>   File "/home/rdunlap/scripts/menuconfig.py", line 1466, in _jump_to_dialog
>>     bad_re = e.msg
>> AttributeError: 'error' object has no attribute 'msg'
>>
>>
>>
>> --
>> ~Randy
>
> Thanks for the report!
>
> Invalid regular expressions are detected, but it looks like the 'msg'
> field of re.error was added in Python 3.5 (you have 3.4).
>
> I'll check if the 'msg' field exists and fall back to just printing
> "Invalid regular expression" otherwise. The 'msg' field just gives a
> more informative error
> ("Bad regular expression: nothing to repeat" in this case).
>
> Cheers,
> Ulf

Fixed: https://github.com/ulfalizer/Kconfiglib/commit/3072e7338cfc63f2f81f34d02edc34dab3d9f365

Your environment seems to have a knack for finding stuff like that.

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  3:45             ` Randy Dunlap
  2018-05-20  3:51               ` Randy Dunlap
  2018-05-20  4:03               ` Randy Dunlap
@ 2018-05-20  6:03               ` Ulf Magnusson
  2 siblings, 0 replies; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-20  6:03 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Sun, May 20, 2018 at 5:45 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>> Hello,
>>
>> I've added incremental search for jumping directly to a symbol now.
>> Regular expressions are supported as well.
>>
>> Some screenshots below:
>>
>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>
>> The last screenshot shows how things might look after you jump to a
>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>> mode was turned on automatically.
>
> Hi Ulf,
>
> Do I need to save kconfiglib.py in a special location?
>
> With (new) kconfiglib.py and menuconfig.py, I am getting this:
>
> $ make ARCH=x86_64 O=xx64 iscriptconfig
> make[1]: Entering directory '/home/rdunlap/lnx/lnx-417-rc3/xx64'
>   GEN     ./Makefile
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> ImportError: No module named 'kconfiglib'
>>>>
>
> and then if I (being a Python novice) copy kconfiglib.py to
> /usr/lib/python3.4/site-packages/ and try again, I get 16 warning messages (below)
> and then this:
>
> A Kconfig instance 'kconf' for the architecture x86_64 has been created.
>>>>
>
> What am I supposed to do now?
>
> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>
>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>         Kconfiglib/menuconfig.py
>
> so yes, a real Makefile target would be nice. :)

Gonna get around to it soon. It's a bit silly that you don't get the
menuconfig through the 'pip' install either. :)

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  4:03               ` Randy Dunlap
  2018-05-20  4:47                 ` Ulf Magnusson
@ 2018-05-20  7:51                 ` Ulf Magnusson
  2018-05-21  2:22                   ` Randy Dunlap
  1 sibling, 1 reply; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-20  7:51 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Sun, May 20, 2018 at 6:03 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>> Hello,
>>>
>>> I've added incremental search for jumping directly to a symbol now.
>>> Regular expressions are supported as well.
>>>
>>> Some screenshots below:
>>>
>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>
>>> The last screenshot shows how things might look after you jump to a
>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>> mode was turned on automatically.
>>
>> Hi Ulf,
>>
>>
>>
>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>
>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>         Kconfiglib/menuconfig.py
>>
>> so yes, a real Makefile target would be nice. :)
>
> I want to see all kconfig symbols that end with "_DEBUG" (so excluding
> _DEBUGFS).  Using:
>
> /.*_DEBUG$
>
> shows me 6 symbols:
> ATH9K_COMMON_DEBUG
> DVB_B2C2_FLEXCOP_DEBUG
> HAVE_DMA_API_DEBUG
> IP_DCCP_TFRC_DEBUG
> NFS_DEBUG
> PM_SLEEP_DEBUG
>
> so where are the other (approx.) 176?
> see:
> $ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
>     182     364    9179
>
>
> Anyway, something for you to look at. :)
>
> --
> ~Randy

I changed it to search the symbol name and the prompt separately:
https://github.com/ulfalizer/Kconfiglib/commit/e0905818ef376c977d0a4540ea72d61b8f554bb5

Should work the way you expected now. It's more intuitive for the prompt too. :)

Can just do 'debug$' by the way. No '.*' required.

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  7:51                 ` Ulf Magnusson
@ 2018-05-21  2:22                   ` Randy Dunlap
  0 siblings, 0 replies; 33+ messages in thread
From: Randy Dunlap @ 2018-05-21  2:22 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/20/2018 12:51 AM, Ulf Magnusson wrote:
> On Sun, May 20, 2018 at 6:03 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>>> Hello,
>>>>
>>>> I've added incremental search for jumping directly to a symbol now.
>>>> Regular expressions are supported as well.
>>>>
>>>> Some screenshots below:
>>>>
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>>
>>>> The last screenshot shows how things might look after you jump to a
>>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>>> mode was turned on automatically.
>>>
>>> Hi Ulf,
>>>
>>>
>>>
>>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>>
>>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>>         Kconfiglib/menuconfig.py
>>>
>>> so yes, a real Makefile target would be nice. :)
>>
>> I want to see all kconfig symbols that end with "_DEBUG" (so excluding
>> _DEBUGFS).  Using:
>>
>> /.*_DEBUG$
>>
>> shows me 6 symbols:
>> ATH9K_COMMON_DEBUG
>> DVB_B2C2_FLEXCOP_DEBUG
>> HAVE_DMA_API_DEBUG
>> IP_DCCP_TFRC_DEBUG
>> NFS_DEBUG
>> PM_SLEEP_DEBUG
>>
>> so where are the other (approx.) 176?
>> see:
>> $ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
>>     182     364    9179
>>
>>
>> Anyway, something for you to look at. :)
>>
>> --
>> ~Randy
> 
> I changed it to search the symbol name and the prompt separately:
> https://github.com/ulfalizer/Kconfiglib/commit/e0905818ef376c977d0a4540ea72d61b8f554bb5
> 
> Should work the way you expected now. It's more intuitive for the prompt too. :)

Yes, and a user shouldn't need to know about the implementation details.

> Can just do 'debug$' by the way. No '.*' required.

Yep, I had already figured that out.

thanks,
-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-20  4:47                 ` Ulf Magnusson
  2018-05-20  5:13                   ` Ulf Magnusson
@ 2018-05-21  2:45                   ` Randy Dunlap
  2018-05-21  3:33                     ` Ulf Magnusson
  1 sibling, 1 reply; 33+ messages in thread
From: Randy Dunlap @ 2018-05-21  2:45 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/19/2018 09:47 PM, Ulf Magnusson wrote:
> On Sun, May 20, 2018 at 6:03 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>>> Hello,
>>>>
>>>> I've added incremental search for jumping directly to a symbol now.
>>>> Regular expressions are supported as well.
>>>>
>>>> Some screenshots below:
>>>>
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>>
>>>> The last screenshot shows how things might look after you jump to a
>>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>>> mode was turned on automatically.
>>>
>>> Hi Ulf,
>>>
>>>
>>>
>>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>>
>>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>>         Kconfiglib/menuconfig.py
>>>
>>> so yes, a real Makefile target would be nice. :)
>>
>> I want to see all kconfig symbols that end with "_DEBUG" (so excluding
>> _DEBUGFS).  Using:
>>
>> /.*_DEBUG$
>>
>> shows me 6 symbols:
>> ATH9K_COMMON_DEBUG
>> DVB_B2C2_FLEXCOP_DEBUG
>> HAVE_DMA_API_DEBUG
>> IP_DCCP_TFRC_DEBUG
>> NFS_DEBUG
>> PM_SLEEP_DEBUG
>>
>> so where are the other (approx.) 176?
>> see:
>> $ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
>>     182     364    9179
>>
>>
>> Anyway, something for you to look at. :)
>>
>> --
>> ~Randy
> 
> It's related to how the search is done. Searching for "DEBUG\b" (word
> boundary) instead will find all of them.
> 
> A string is generated for each symbol. For symbols with prompts, this
> string includes the prompt as well, so you get e.g.
> 
>     AB8500_DEBUG "Enable debug info via debugfs"
> 
> Those strings are then searched/displayed.
> 
> What you got with your search was all symbols whose names end in
> "_DEBUG" that don't have a prompt.
> 
> The nice thing about searching both the name and the prompt is that
> e.g. "debugfs ab8500" will find the symbol above. I'm also planning to
> add menus to the search, by generating 'menu: "menu title"' strings
> for them.
> 
> It's a bit awkward/unintuitive that what you tried doesn't work
> though. Maybe the symbol name could be searched separately from the
> prompt, though I'd be a bit sad to abandon the super simple
> single-string-per-entry implementation approach. :)

Hi Ulf,

What else are you planning to do with /(search)?


/syscall lists 20 or so symbols. It would be nice if each one of those
showed its current setting [y,n,maybe^Wm].


I like Toggle show-all mode.  When I use xconfig, I usually turn on most
of its options, including one like that.

-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-21  2:45                   ` Randy Dunlap
@ 2018-05-21  3:33                     ` Ulf Magnusson
  2018-05-21  3:47                       ` Randy Dunlap
  0 siblings, 1 reply; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-21  3:33 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Mon, May 21, 2018 at 4:45 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 05/19/2018 09:47 PM, Ulf Magnusson wrote:
>> On Sun, May 20, 2018 at 6:03 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>>>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>>>> Hello,
>>>>>
>>>>> I've added incremental search for jumping directly to a symbol now.
>>>>> Regular expressions are supported as well.
>>>>>
>>>>> Some screenshots below:
>>>>>
>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>>>
>>>>> The last screenshot shows how things might look after you jump to a
>>>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>>>> mode was turned on automatically.
>>>>
>>>> Hi Ulf,
>>>>
>>>>
>>>>
>>>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>>>
>>>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>>>         Kconfiglib/menuconfig.py
>>>>
>>>> so yes, a real Makefile target would be nice. :)
>>>
>>> I want to see all kconfig symbols that end with "_DEBUG" (so excluding
>>> _DEBUGFS).  Using:
>>>
>>> /.*_DEBUG$
>>>
>>> shows me 6 symbols:
>>> ATH9K_COMMON_DEBUG
>>> DVB_B2C2_FLEXCOP_DEBUG
>>> HAVE_DMA_API_DEBUG
>>> IP_DCCP_TFRC_DEBUG
>>> NFS_DEBUG
>>> PM_SLEEP_DEBUG
>>>
>>> so where are the other (approx.) 176?
>>> see:
>>> $ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
>>>     182     364    9179
>>>
>>>
>>> Anyway, something for you to look at. :)
>>>
>>> --
>>> ~Randy
>>
>> It's related to how the search is done. Searching for "DEBUG\b" (word
>> boundary) instead will find all of them.
>>
>> A string is generated for each symbol. For symbols with prompts, this
>> string includes the prompt as well, so you get e.g.
>>
>>     AB8500_DEBUG "Enable debug info via debugfs"
>>
>> Those strings are then searched/displayed.
>>
>> What you got with your search was all symbols whose names end in
>> "_DEBUG" that don't have a prompt.
>>
>> The nice thing about searching both the name and the prompt is that
>> e.g. "debugfs ab8500" will find the symbol above. I'm also planning to
>> add menus to the search, by generating 'menu: "menu title"' strings
>> for them.
>>
>> It's a bit awkward/unintuitive that what you tried doesn't work
>> though. Maybe the symbol name could be searched separately from the
>> prompt, though I'd be a bit sad to abandon the super simple
>> single-string-per-entry implementation approach. :)
>
> Hi Ulf,
>
> What else are you planning to do with /(search)?

Here's the stuff I've thought of so far:

  - Display invisible symbols in red (to match show-all mode)

  - Search prompts of menus and comments as well

  - Have [F1] show the help display without canceling the search,
    so you can quickly scan through a bunch of symbols

Maybe you could get fancy with stuff like finding symbols that are
related to other symbols in particular ways too...

> /syscall lists 20 or so symbols. It would be nice if each one of those
> showed its current setting [y,n,maybe^Wm].

Nice idea. I added it:
https://github.com/ulfalizer/Kconfiglib/commit/3161affaa5bb8350a39bfd305c56171a25b02151

Works for strings/int/hex too.

> I like Toggle show-all mode.  When I use xconfig, I usually turn on most
> of its options, including one like that.

IIRC, xconfig doesn't make it very clear which symbols are invisible
in show-all mode. That's why I made them red.

>
> --
> ~Randy

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-21  3:33                     ` Ulf Magnusson
@ 2018-05-21  3:47                       ` Randy Dunlap
  2018-05-22 10:18                         ` Ulf Magnusson
  0 siblings, 1 reply; 33+ messages in thread
From: Randy Dunlap @ 2018-05-21  3:47 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/20/2018 08:33 PM, Ulf Magnusson wrote:
> On Mon, May 21, 2018 at 4:45 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 05/19/2018 09:47 PM, Ulf Magnusson wrote:
>>> On Sun, May 20, 2018 at 6:03 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>>> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>>>>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>>>>> Hello,
>>>>>>
>>>>>> I've added incremental search for jumping directly to a symbol now.
>>>>>> Regular expressions are supported as well.
>>>>>>
>>>>>> Some screenshots below:
>>>>>>
>>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>>>>
>>>>>> The last screenshot shows how things might look after you jump to a
>>>>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>>>>> mode was turned on automatically.
>>>>>
>>>>> Hi Ulf,
>>>>>
>>>>>
>>>>>
>>>>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>>>>
>>>>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>>>>         Kconfiglib/menuconfig.py
>>>>>
>>>>> so yes, a real Makefile target would be nice. :)
>>>>
>>>> I want to see all kconfig symbols that end with "_DEBUG" (so excluding
>>>> _DEBUGFS).  Using:
>>>>
>>>> /.*_DEBUG$
>>>>
>>>> shows me 6 symbols:
>>>> ATH9K_COMMON_DEBUG
>>>> DVB_B2C2_FLEXCOP_DEBUG
>>>> HAVE_DMA_API_DEBUG
>>>> IP_DCCP_TFRC_DEBUG
>>>> NFS_DEBUG
>>>> PM_SLEEP_DEBUG
>>>>
>>>> so where are the other (approx.) 176?
>>>> see:
>>>> $ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
>>>>     182     364    9179
>>>>
>>>>
>>>> Anyway, something for you to look at. :)
>>>>
>>>> --
>>>> ~Randy
>>>
>>> It's related to how the search is done. Searching for "DEBUG\b" (word
>>> boundary) instead will find all of them.
>>>
>>> A string is generated for each symbol. For symbols with prompts, this
>>> string includes the prompt as well, so you get e.g.
>>>
>>>     AB8500_DEBUG "Enable debug info via debugfs"
>>>
>>> Those strings are then searched/displayed.
>>>
>>> What you got with your search was all symbols whose names end in
>>> "_DEBUG" that don't have a prompt.
>>>
>>> The nice thing about searching both the name and the prompt is that
>>> e.g. "debugfs ab8500" will find the symbol above. I'm also planning to
>>> add menus to the search, by generating 'menu: "menu title"' strings
>>> for them.
>>>
>>> It's a bit awkward/unintuitive that what you tried doesn't work
>>> though. Maybe the symbol name could be searched separately from the
>>> prompt, though I'd be a bit sad to abandon the super simple
>>> single-string-per-entry implementation approach. :)
>>
>> Hi Ulf,
>>
>> What else are you planning to do with /(search)?
> 
> Here's the stuff I've thought of so far:
> 
>   - Display invisible symbols in red (to match show-all mode)
> 
>   - Search prompts of menus and comments as well
> 
>   - Have [F1] show the help display without canceling the search,
>     so you can quickly scan through a bunch of symbols
> 
> Maybe you could get fancy with stuff like finding symbols that are
> related to other symbols in particular ways too...
> 
>> /syscall lists 20 or so symbols. It would be nice if each one of those
>> showed its current setting [y,n,maybe^Wm].
> 
> Nice idea. I added it:
> https://github.com/ulfalizer/Kconfiglib/commit/3161affaa5bb8350a39bfd305c56171a25b02151
> 
> Works for strings/int/hex too.

Thanks.

>> I like Toggle show-all mode.  When I use xconfig, I usually turn on most
>> of its options, including one like that.
> 
> IIRC, xconfig doesn't make it very clear which symbols are invisible
> in show-all mode. That's why I made them red.

Yes, that's helpful.


-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-21  3:47                       ` Randy Dunlap
@ 2018-05-22 10:18                         ` Ulf Magnusson
  2018-05-25 22:06                           ` Randy Dunlap
  0 siblings, 1 reply; 33+ messages in thread
From: Ulf Magnusson @ 2018-05-22 10:18 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On Mon, May 21, 2018 at 5:47 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 05/20/2018 08:33 PM, Ulf Magnusson wrote:
>> On Mon, May 21, 2018 at 4:45 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>> On 05/19/2018 09:47 PM, Ulf Magnusson wrote:
>>>> On Sun, May 20, 2018 at 6:03 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>>>> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>>>>>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>>>>>> Hello,
>>>>>>>
>>>>>>> I've added incremental search for jumping directly to a symbol now.
>>>>>>> Regular expressions are supported as well.
>>>>>>>
>>>>>>> Some screenshots below:
>>>>>>>
>>>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>>>>>
>>>>>>> The last screenshot shows how things might look after you jump to a
>>>>>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>>>>>> mode was turned on automatically.
>>>>>>
>>>>>> Hi Ulf,
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>>>>>
>>>>>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>>>>>         Kconfiglib/menuconfig.py
>>>>>>
>>>>>> so yes, a real Makefile target would be nice. :)
>>>>>
>>>>> I want to see all kconfig symbols that end with "_DEBUG" (so excluding
>>>>> _DEBUGFS).  Using:
>>>>>
>>>>> /.*_DEBUG$
>>>>>
>>>>> shows me 6 symbols:
>>>>> ATH9K_COMMON_DEBUG
>>>>> DVB_B2C2_FLEXCOP_DEBUG
>>>>> HAVE_DMA_API_DEBUG
>>>>> IP_DCCP_TFRC_DEBUG
>>>>> NFS_DEBUG
>>>>> PM_SLEEP_DEBUG
>>>>>
>>>>> so where are the other (approx.) 176?
>>>>> see:
>>>>> $ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
>>>>>     182     364    9179
>>>>>
>>>>>
>>>>> Anyway, something for you to look at. :)
>>>>>
>>>>> --
>>>>> ~Randy
>>>>
>>>> It's related to how the search is done. Searching for "DEBUG\b" (word
>>>> boundary) instead will find all of them.
>>>>
>>>> A string is generated for each symbol. For symbols with prompts, this
>>>> string includes the prompt as well, so you get e.g.
>>>>
>>>>     AB8500_DEBUG "Enable debug info via debugfs"
>>>>
>>>> Those strings are then searched/displayed.
>>>>
>>>> What you got with your search was all symbols whose names end in
>>>> "_DEBUG" that don't have a prompt.
>>>>
>>>> The nice thing about searching both the name and the prompt is that
>>>> e.g. "debugfs ab8500" will find the symbol above. I'm also planning to
>>>> add menus to the search, by generating 'menu: "menu title"' strings
>>>> for them.
>>>>
>>>> It's a bit awkward/unintuitive that what you tried doesn't work
>>>> though. Maybe the symbol name could be searched separately from the
>>>> prompt, though I'd be a bit sad to abandon the super simple
>>>> single-string-per-entry implementation approach. :)
>>>
>>> Hi Ulf,
>>>
>>> What else are you planning to do with /(search)?
>>
>> Here's the stuff I've thought of so far:
>>
>>   - Display invisible symbols in red (to match show-all mode)
>>
>>   - Search prompts of menus and comments as well
>>
>>   - Have [F1] show the help display without canceling the search,
>>     so you can quickly scan through a bunch of symbols
>>
>> Maybe you could get fancy with stuff like finding symbols that are
>> related to other symbols in particular ways too...
>>
>>> /syscall lists 20 or so symbols. It would be nice if each one of those
>>> showed its current setting [y,n,maybe^Wm].
>>
>> Nice idea. I added it:
>> https://github.com/ulfalizer/Kconfiglib/commit/3161affaa5bb8350a39bfd305c56171a25b02151
>>
>> Works for strings/int/hex too.
>
> Thanks.
>
>>> I like Toggle show-all mode.  When I use xconfig, I usually turn on most
>>> of its options, including one like that.
>>
>> IIRC, xconfig doesn't make it very clear which symbols are invisible
>> in show-all mode. That's why I made them red.
>
> Yes, that's helpful.
>
>
> --
> ~Randy

Hello,

I've added a mode that lists the names of all symbols in the menu now
as well, toggled with 'c' ('n' was taken :).

Any other features you miss from xconfig? Other suggestions?

Cheers,
Ulf

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [ANNOUNCE] Kconfiglib menuconfig implementation
  2018-05-22 10:18                         ` Ulf Magnusson
@ 2018-05-25 22:06                           ` Randy Dunlap
  0 siblings, 0 replies; 33+ messages in thread
From: Randy Dunlap @ 2018-05-25 22:06 UTC (permalink / raw)
  To: Ulf Magnusson; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

On 05/22/2018 03:18 AM, Ulf Magnusson wrote:
> On Mon, May 21, 2018 at 5:47 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 05/20/2018 08:33 PM, Ulf Magnusson wrote:
>>> On Mon, May 21, 2018 at 4:45 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>>> On 05/19/2018 09:47 PM, Ulf Magnusson wrote:
>>>>> On Sun, May 20, 2018 at 6:03 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>>>>> On 05/19/2018 08:45 PM, Randy Dunlap wrote:
>>>>>>> On 05/08/2018 09:59 AM, Ulf Magnusson wrote:
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I've added incremental search for jumping directly to a symbol now.
>>>>>>>> Regular expressions are supported as well.
>>>>>>>>
>>>>>>>> Some screenshots below:
>>>>>>>>
>>>>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss10.png
>>>>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss11.png
>>>>>>>> https://raw.githubusercontent.com/ulfalizer/Kconfiglib/screenshots/screenshots/ss13.png
>>>>>>>>
>>>>>>>> The last screenshot shows how things might look after you jump to a
>>>>>>>> symbol. The jumped-to symbol wasn't visible in this case, so show-all
>>>>>>>> mode was turned on automatically.
>>>>>>>
>>>>>>> Hi Ulf,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hm, OK, I used the trick that you supplied a few weeks ago and I have the UI now.
>>>>>>>
>>>>>>>     ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
>>>>>>>         Kconfiglib/menuconfig.py
>>>>>>>
>>>>>>> so yes, a real Makefile target would be nice. :)
>>>>>>
>>>>>> I want to see all kconfig symbols that end with "_DEBUG" (so excluding
>>>>>> _DEBUGFS).  Using:
>>>>>>
>>>>>> /.*_DEBUG$
>>>>>>
>>>>>> shows me 6 symbols:
>>>>>> ATH9K_COMMON_DEBUG
>>>>>> DVB_B2C2_FLEXCOP_DEBUG
>>>>>> HAVE_DMA_API_DEBUG
>>>>>> IP_DCCP_TFRC_DEBUG
>>>>>> NFS_DEBUG
>>>>>> PM_SLEEP_DEBUG
>>>>>>
>>>>>> so where are the other (approx.) 176?
>>>>>> see:
>>>>>> $ find . -name Kconfig\* | xargs grep "config.*_DEBUG$" | grep -v \.orig | wc
>>>>>>     182     364    9179
>>>>>>
>>>>>>
>>>>>> Anyway, something for you to look at. :)
>>>>>>
>>>>>> --
>>>>>> ~Randy
>>>>>
>>>>> It's related to how the search is done. Searching for "DEBUG\b" (word
>>>>> boundary) instead will find all of them.
>>>>>
>>>>> A string is generated for each symbol. For symbols with prompts, this
>>>>> string includes the prompt as well, so you get e.g.
>>>>>
>>>>>     AB8500_DEBUG "Enable debug info via debugfs"
>>>>>
>>>>> Those strings are then searched/displayed.
>>>>>
>>>>> What you got with your search was all symbols whose names end in
>>>>> "_DEBUG" that don't have a prompt.
>>>>>
>>>>> The nice thing about searching both the name and the prompt is that
>>>>> e.g. "debugfs ab8500" will find the symbol above. I'm also planning to
>>>>> add menus to the search, by generating 'menu: "menu title"' strings
>>>>> for them.
>>>>>
>>>>> It's a bit awkward/unintuitive that what you tried doesn't work
>>>>> though. Maybe the symbol name could be searched separately from the
>>>>> prompt, though I'd be a bit sad to abandon the super simple
>>>>> single-string-per-entry implementation approach. :)
>>>>
>>>> Hi Ulf,
>>>>
>>>> What else are you planning to do with /(search)?
>>>
>>> Here's the stuff I've thought of so far:
>>>
>>>   - Display invisible symbols in red (to match show-all mode)
>>>
>>>   - Search prompts of menus and comments as well
>>>
>>>   - Have [F1] show the help display without canceling the search,
>>>     so you can quickly scan through a bunch of symbols
>>>
>>> Maybe you could get fancy with stuff like finding symbols that are
>>> related to other symbols in particular ways too...
>>>
>>>> /syscall lists 20 or so symbols. It would be nice if each one of those
>>>> showed its current setting [y,n,maybe^Wm].
>>>
>>> Nice idea. I added it:
>>> https://github.com/ulfalizer/Kconfiglib/commit/3161affaa5bb8350a39bfd305c56171a25b02151
>>>
>>> Works for strings/int/hex too.
>>
>> Thanks.
>>
>>>> I like Toggle show-all mode.  When I use xconfig, I usually turn on most
>>>> of its options, including one like that.
>>>
>>> IIRC, xconfig doesn't make it very clear which symbols are invisible
>>> in show-all mode. That's why I made them red.
>>
>> Yes, that's helpful.
>>
>>
>> --
>> ~Randy
> 
> Hello,
> 
> I've added a mode that lists the names of all symbols in the menu now
> as well, toggled with 'c' ('n' was taken :).
> 
> Any other features you miss from xconfig? Other suggestions?

Hi Ulf,

Nothing comes to mind just now.  I'll let you know if I think of anything else.

thanks,
-- 
~Randy

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2018-05-25 22:06 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-01  0:57 [ANNOUNCE] Kconfiglib menuconfig implementation Ulf Magnusson
2018-05-01 17:56 ` Randy Dunlap
2018-05-01 18:13   ` Randy Dunlap
2018-05-01 18:52     ` Randy Dunlap
2018-05-01 19:33       ` Ulf Magnusson
2018-05-03  2:47       ` Ulf Magnusson
2018-05-03 20:31         ` Randy Dunlap
2018-05-03 21:26           ` Ulf Magnusson
2018-05-01 19:12   ` Ulf Magnusson
2018-05-01 19:47     ` Ulf Magnusson
2018-05-01 21:07       ` Ulf Magnusson
2018-05-03 20:28         ` Randy Dunlap
2018-05-03 22:48           ` Ulf Magnusson
2018-05-04  0:05             ` Randy Dunlap
2018-05-08 16:59           ` Ulf Magnusson
2018-05-11  1:22             ` Ulf Magnusson
2018-05-20  3:45             ` Randy Dunlap
2018-05-20  3:51               ` Randy Dunlap
2018-05-20  4:24                 ` Ulf Magnusson
2018-05-20  5:50                   ` Ulf Magnusson
2018-05-20  4:03               ` Randy Dunlap
2018-05-20  4:47                 ` Ulf Magnusson
2018-05-20  5:13                   ` Ulf Magnusson
2018-05-21  2:45                   ` Randy Dunlap
2018-05-21  3:33                     ` Ulf Magnusson
2018-05-21  3:47                       ` Randy Dunlap
2018-05-22 10:18                         ` Ulf Magnusson
2018-05-25 22:06                           ` Randy Dunlap
2018-05-20  7:51                 ` Ulf Magnusson
2018-05-21  2:22                   ` Randy Dunlap
2018-05-20  6:03               ` Ulf Magnusson
2018-05-14 16:58     ` Pavel Machek
2018-05-14 18:12       ` Ulf Magnusson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).