From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Escaping a string for substitute-command-keys Date: Sat, 5 Oct 2019 04:04:34 -0400 Message-ID: References: <14423aa7-36c3-9ab7-6483-d43624f99e17@gmail.com> <83pnjd7pud.fsf@gnu.org> <83h84p7nih.fsf@gnu.org> <837e5l7j8n.fsf@gnu.org> <83imp461do.fsf@gnu.org> <835zl364yx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="155801"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 05 10:04:47 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iGf3X-000eRf-D0 for ged-emacs-devel@m.gmane.org; Sat, 05 Oct 2019 10:04:47 +0200 Original-Received: from localhost ([::1]:54726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGf3V-0005ZZ-QD for ged-emacs-devel@m.gmane.org; Sat, 05 Oct 2019 04:04:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57105) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGf3O-0005ZS-DV for emacs-devel@gnu.org; Sat, 05 Oct 2019 04:04:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGf3N-0001Ms-Dw for emacs-devel@gnu.org; Sat, 05 Oct 2019 04:04:38 -0400 Original-Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:40651) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iGf3N-0001Mf-8b; Sat, 05 Oct 2019 04:04:37 -0400 Original-Received: by mail-qt1-x830.google.com with SMTP id m61so920697qte.7; Sat, 05 Oct 2019 01:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=He1IjpCKZRpw1vQl0tqLpo6285w8ZWcL3PKXkUv58RQ=; b=VOVyKUCvuu6KQYEfFaxMJXdAY6kdzFFFTA8eezKJziNzmqElVkp8Sga5Y9u5dU/52k 28b98TSx/lt/z4vVzauUOQLLgnsW/rmr6jv/b3zvrsaGSydOCg1FnMypsgWa8CLRG1m2 O4ovMVJ7JGBsK6t2InxG03ZAbb7f3Yh5vriUamZqjw/obTKpR1rez5i07L/I6/sNqRkL IbrG5mrAhra/s4Bi8ZsjrRhoj+840KnM61EpVMS2mxaVX4Ark3jnjITVZ8CO0OfsxvzN qgD2qqrecGhgwXgiVplcFIi8EUps8rJbGVAxh01lWd6TNCKcsv1RGTzcQP3FMqNpP8Kg GZrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=He1IjpCKZRpw1vQl0tqLpo6285w8ZWcL3PKXkUv58RQ=; b=esFBSXkfFC6rg3wvItLTMLM+qEYyZvg0uiixQCpUingDitelGy3qsj0ZgyMylppn9E akLlH11jWVYa6l4q59gmrm96nybYf5h28zr5KkBquPkBFz9Pt4EZuRjvd4gcNwSLhW32 KrrDVyBds7HlXNxUDlhz9x/E0YSUiZpIXSqtBINYVNcacG6RFpkJjsknoxq9emFCfxtl bsOJq+pLDt/DIsn++On2iYmqaTtkzZrIKayJAwXiH15gz0qZVoy6syNrOxRzffoqr5/c lvLkrw+pIAqrKtZ1arbC4s1Fj8gXNzg+0kijyK/RGEXW1GGXbQdSP1CiKe6IG+mSmryE etGw== X-Gm-Message-State: APjAAAVkXEjxbM/PuqUXSshccSEMWNr6uJEwrZDJTFFjTBhCsGsadoCr QkNKVZMcZR0EVJIQa7PfmJ3MVkPt X-Google-Smtp-Source: APXvYqypOE0Y17iNJ5rv2Mn2eS+/VQIHNAppb4UkYlcYBQuglMUz4wS+EYMlEPyKUJ5pvGzekh3YJA== X-Received: by 2002:ac8:3470:: with SMTP id v45mr19980688qtb.30.1570262676034; Sat, 05 Oct 2019 01:04:36 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:656c:d996:de5:9bda? ([2601:184:4180:66e7:656c:d996:de5:9bda]) by smtp.googlemail.com with ESMTPSA id 200sm4569203qkf.65.2019.10.05.01.04.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Oct 2019 01:04:35 -0700 (PDT) In-Reply-To: <835zl364yx.fsf@gnu.org> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::830 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240599 Archived-At: On 2019-10-05 03:12, Eli Zaretskii wrote: >> Btw, it was surprising to me to see that very little code in Emacs actually takes advantage of this command-substitution facility in help-echo; most help-echo strings that mention commands actually hardcode the default binding. > > Most probably because the call to substitute-command-keys there is a > relatively recent addition. Makes sense. > I guess we need to add some feature to control whether help-echo gets > run through substitute-command-keys, or add an alternative to > help-echo that works exactly like it, but without substitutions. > Patches welcome. Sounds good, and I can work on the patch. I think I like the first solution better, if we can come up with something elegant: the second case will force us to define priorities, and besides we already have kbd-help in addition to help-echo. What about the following: before performing a conversion, substitute-command-keys could check a property of the string that it receives, say help-echo-conversion, and if that property is nil it would not perform the conversion. Alternatively, there's the option of performing conversion only on those 'help-echo' properties that are string, and leaving (the output of) the ones that are functions untouched. What do you think? Clément.