From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0LOUKHSBEGD1JQAA0tVLHw (envelope-from ) for ; Tue, 26 Jan 2021 20:54:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SBpvJHSBEGD8CQAAB5/wlQ (envelope-from ) for ; Tue, 26 Jan 2021 20:54:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CF9F39403E8 for ; Tue, 26 Jan 2021 20:54:10 +0000 (UTC) Received: from localhost ([::1]:54228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4VLl-0006Ug-Rg for larch@yhetil.org; Tue, 26 Jan 2021 15:54:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4VLe-0006U6-AC for guix-patches@gnu.org; Tue, 26 Jan 2021 15:54:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59448) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4VLe-0006Wx-2T for guix-patches@gnu.org; Tue, 26 Jan 2021 15:54:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l4VLe-0004k0-0q for guix-patches@gnu.org; Tue, 26 Jan 2021 15:54:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45893] [PATCH 0/2] DRAFT: Hint for options. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Jan 2021 20:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45893 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Received: via spool by 45893-submit@debbugs.gnu.org id=B45893.161169442718202 (code B ref 45893); Tue, 26 Jan 2021 20:54:01 +0000 Received: (at 45893) by debbugs.gnu.org; 26 Jan 2021 20:53:47 +0000 Received: from localhost ([127.0.0.1]:42761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4VLP-0004jW-65 for submit@debbugs.gnu.org; Tue, 26 Jan 2021 15:53:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4VLN-0004jJ-Sf for 45893@debbugs.gnu.org; Tue, 26 Jan 2021 15:53:46 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60156) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4VLI-0006Pa-Km; Tue, 26 Jan 2021 15:53:40 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42762 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l4VLI-0002AX-5Q; Tue, 26 Jan 2021 15:53:40 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <865z3xlp2y.fsf@gmail.com> <20210116002634.10401-1-zimon.toutoune@gmail.com> <20210116002634.10401-3-zimon.toutoune@gmail.com> <87a6t4hlom.fsf_-_@gnu.org> Date: Tue, 26 Jan 2021 21:53:38 +0100 In-Reply-To: (zimoun's message of "Tue, 19 Jan 2021 19:01:24 +0100") Message-ID: <871re7zagd.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 45893@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.85 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: CF9F39403E8 X-Spam-Score: -2.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: u4zrooIJ0Afr Hi, zimoun skribis: > On Tue, 19 Jan 2021 at 18:38, Ludovic Court=C3=A8s wrote: >> >> zimoun skribis: >> >> > * guix/ui.scm (run-guix-command): Add command hint. >> >> [...] >> >> > + (fold (lambda (name res) >> > + (if (string-null? res) >> > + (string-append "@code{" name "}") >> > + (string-append "@code{" name "}, " res))) >> > + "" >> > + (string-closest (symbol->string guess) command-names))) >> >> Hmm I thought =E2=80=98string-closest=E2=80=99 would return a single str= ing, but >> actually it returns a list of strings? >> >> You cannot append strings together like this as this can break i18n. > > Hum? But it is not (G_ "")... Yes, but here you=E2=80=99re building an enumeration like: =E2=80=98foo=E2=80=99, =E2=80=98bar=E2=80=99, =E2=80=98baz=E2=80=99 This should be i18n=E2=80=99d, and so it should all be in a single format string. > Hehe! I have tried... But it is not "doable" in practise... well, I > find it too slow. The natural improvement is to cut down the > levenhstein-distance by stopping if the score is greater than > threshold. Well, I have not tried yet. :-) Oh I see. Perhaps instead of (or in addition to) =E2=80=98string-distance= =E2=80=99, you need something like (string-distance