Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp505026imm; Wed, 20 Jun 2018 01:51:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ0j0fgHhDvPXe2AGxIX48z8bcGkdJc5BFTw4Ga1NqVOTIVZdnNwt9bjUEhjbVYg2Tl/iDt X-Received: by 2002:a17:902:42a3:: with SMTP id h32-v6mr22403198pld.72.1529484678226; Wed, 20 Jun 2018 01:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529484678; cv=none; d=google.com; s=arc-20160816; b=FkBB+5GIy4+IVBNCIMGiymW3C2uwidiT/LUX7jxx1I32GyW/7LCpqrtOpxDAu1fDV1 i+l2LfTlzuyeaLlUGQUgDIjKFG9BIXX7YYRsS62Xs3+2H4HP+96hoBa2c/3cBK5I3Gd5 JukOn54a298+wBc6dVBuKTUhymCI//5D3Jcw4eDrNThw2pOmAjcoRkwPELSggTwHXRo2 vwX2Gd63DkjepOHafQ7iUSOCyzXdSCzmjGdIa7DfurV9wzlmCSa4cFqGrqQ7lWnRyxqk mUk64a6JNhTLJLErw3dGmxYBu189lJ5VUMTSo0ghp1pGzLwnRWUjo5vnOVi5csiKzXAy YL4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=cDROzURulK/EPY62/TOssBYWvlVgy8rKW+2OZoXlAr0=; b=vSpvOMfQeJZxcjP/eoFLb0Xiu6JruKkE651ZZx3uJ47aglWhu5qHRGthlHdi7hSHXj 7b0kFS0zSWfzGiX6PF5t0GFi4QWJ9eqeOQZ+pE4qkw7KlgSRSuvmt8PnKXzqbjczytP0 lyZCmqwYj4GKQLA1sSFWBl6H6vDz26EZa8/RhqxgTzNdamXY7KMwA4FCMhCUvioB/A9q IzXFrA+y2L/fnb5clvjCBuODaKjxLcUsrT6LUKQO+LVZ4Rc6Wb4LJSucvQ6RyzgTdwmH lp9Zcl99AdkrlepLrOwGGiqEPJBPiqathlSoPI4tGP9HP7r64wYVY4DbeEuvI4+Ft0mF HPRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gouders.net header.s=gnet header.b=Ve0cuMbz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6-v6si1933499plp.60.2018.06.20.01.51.04; Wed, 20 Jun 2018 01:51:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gouders.net header.s=gnet header.b=Ve0cuMbz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932953AbeFTIuX (ORCPT + 99 others); Wed, 20 Jun 2018 04:50:23 -0400 Received: from services.gouders.net ([141.101.32.176]:55601 "EHLO services.gouders.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932891AbeFTIt1 (ORCPT ); Wed, 20 Jun 2018 04:49:27 -0400 Received: from lena.gouders.net ([193.175.198.193]) (authenticated bits=0) by services.gouders.net (8.14.8/8.14.8) with ESMTP id w5K8gRCc013731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 20 Jun 2018 10:42:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1529484158; bh=6NL1EFwGkIcT/x/3Mr1VNv19qKolHcJ28+B9DaBP5Mc=; h=From:To:Cc:Subject:Date; b=Ve0cuMbzVPgsxoJ8XoDdVBbYAUKpldejHO1tMMtBT/5cz/PfUjixrFtiXyV3h5g6q Su/irfo7gL4Q0m9s5PuWKZEIE/vLdOUfWrzeQoA5HXw8AdmP7+SQWODGTcEtnxAETt Q276iRCI8MjBMVFnNtKeiqhukLtx8rKdzExQhwBg= From: Dirk Gouders To: Masahiro Yamada , Randy Dunlap , Linux Kbuild mailing list , Linux Kernel Mailing List , Segher Boessenkool , Sam Ravnborg Cc: Dirk Gouders Subject: [RFC v8 0/1] mconf: global i-search in menu prompts Date: Wed, 20 Jun 2018 10:42:16 +0200 Message-Id: <20180620084217.8597-1-dirk@gouders.net> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Randy noticed segfaults with the last version and although that could be fixed, this version got rid of the additional data structure, because it is not needed to do the traversal. As everything is in place more or less now, it became rather forcibly clear that the tree traversal can be done with just a short helper function (see commit message). What I meanwhile noticed is that a search for 'retpoline' did not match any prompt, whereas the same search in config symbols gets a hit. That made me think if i-search should search the symbol names as well but in this case, it would not be immediately clear to users why menu items produced a hit... Anyway, this time, I provide a sample Kconfig file that can be used to easily watch the traversal as shown in the example in the commit message (just repeatedly search for 'a' from any position in the menu): config a bool "a" config b bool "b / a" depends on a config c bool "c / a" menu "d / a" config e bool "e / a" endmenu config f bool "f / a" Dirk Changes in v8: * Get rid of flat_array and use a short helper function menu_get_next() for tree traversal. * Correct typos reported by Randy Dunlap. Changes in v7: * make menu_isearch() return void * Suggested-by removed, ask for Sam's permission * Rework i-search instructions text * Remember exact starting position in menu * Stay on menu item if it matches pattern with a character added * Fix print_autowrap for short texts * Focus on buttons: use A_STANDOUT for current menu item * Fix compiler warnings * Don't exclude comments in searches * ESC also clears search string * Remove the last parameter of print_isearch and use focus_on_buttons instead * Document changes to print_autowrap and conf() in commit message * Rework comments in the code * Rework commit message, add a motivation part * Free serialized menu array on exit Changes in v6: * The modification of the function print_autowrap() was reworked and is no longer a separate function. * The i-search navigation was completely reworked and now works on the whole menu tree. * Hotkeys are back, because they do not interfere that much with this version of i-search navigation. Changes in v5: * More thoroughly tested code * Hotkey navigation concept completely dropped * Printable characters except special ones form the search string * Focus-sensitive help text above menu * DEL erases search string * Matching string is highlighted in selected menu item * README help text adjusted Changes in v4: * Prototype: consequent i-search navigation concept Changes in v3: * Use current git tree to make the patch apply. * Eliminate debugging output to stderr. Changes in v2: * Additionally to CTRL-s, \ can be used to start isearch. * Raw mode is off by default an can be enabled by an environment variable MENUCONFIG_RAW_MODE. * I also added a variable for toggling raw mode but did not implement anything else. * The isearch indicator is now displayed as soon as isearch is started. * Any key except \, CTRL-s, alphanumeric characters and space terminates isearch and -- except ESC ESC -- is further processed, e.g. ENTER terminates isearch and is then used to navigate into a submenu. * Problems with mismatches and matches above the current position were fixed. Dirk Gouders (1): mconf: global i-search in menu prompts scripts/kconfig/lkc.h | 1 + scripts/kconfig/lxdialog/checklist.c | 2 +- scripts/kconfig/lxdialog/dialog.h | 3 +- scripts/kconfig/lxdialog/inputbox.c | 2 +- scripts/kconfig/lxdialog/menubox.c | 181 ++++++++++++++++++++++++++++++----- scripts/kconfig/lxdialog/util.c | 45 ++++++++- scripts/kconfig/lxdialog/yesno.c | 2 +- scripts/kconfig/mconf.c | 173 +++++++++++++++++++++++++++++++-- scripts/kconfig/menu.c | 28 ++++++ 9 files changed, 398 insertions(+), 39 deletions(-) -- 2.13.6