From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#8951: 24.0.50; [PATCH] enhancement request: buttonize key names Date: Mon, 4 Jul 2011 14:08:19 -0700 Message-ID: <375C29E7AB4048148D18B461FC1E02F1@us.oracle.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1309813800 24350 80.91.229.12 (4 Jul 2011 21:10:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2011 21:10:00 +0000 (UTC) Cc: 8951@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 04 23:09:54 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QdqOw-00062z-CW for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Jul 2011 23:09:54 +0200 Original-Received: from localhost ([::1]:37576 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdqOu-0001ZG-O8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Jul 2011 17:09:53 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdqO8-0001SU-QG for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 17:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdqO7-00056s-0U for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 17:09:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdqO6-00056n-Pz for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 17:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QdqO5-00013o-To; Mon, 04 Jul 2011 17:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Jul 2011 21:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8951 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 8951-submit@debbugs.gnu.org id=B8951.13098137314059 (code B ref 8951); Mon, 04 Jul 2011 21:09:01 +0000 Original-Received: (at 8951) by debbugs.gnu.org; 4 Jul 2011 21:08:51 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QdqNu-00013P-TJ for submit@debbugs.gnu.org; Mon, 04 Jul 2011 17:08:51 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QdqNs-00013D-AR for 8951@debbugs.gnu.org; Mon, 04 Jul 2011 17:08:49 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p64L8e6b028209 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Jul 2011 21:08:42 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p64L8dvx021332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Jul 2011 21:08:39 GMT Original-Received: from abhmt107.oracle.com (abhmt107.oracle.com [141.146.116.59]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p64L8XF7009441; Mon, 4 Jul 2011 16:08:33 -0500 Original-Received: from dradamslap1 (/10.159.32.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 04 Jul 2011 14:08:33 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acw6iPlVPbl5t/bWRAWsH3U22GwQbAAAy+UQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4E122BDA.008F:SCFMA922111,ss=1,re=-4.000,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 04 Jul 2011 17:09:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47995 Archived-At: > > Let users click a key description (i.e., a key name, such as > > `C-f') in a buffer such as *Help* to see the associated help. > > This applies to key descriptions derived from \[...] doc > > patterns (only). > > That looks like a good idea. Have you tried to plug it directly into > substitute-command-keys instead? Are there places where such buttons > become annoying? > > Basically, the thing I don't like about your patch is the resulting > redundancy between help-substitute-command-keys and > substitute-command-keys, which could be removed by getting rid of the > C version and only using the new Elisp version. See the emacs-devel thread, where I addressed both of these things. http://lists.gnu.org/archive/html/emacs-devel/2011-06/msg01081.html I wrote Lisp, but if someone wants to instead patch the C code for `substitute-command-keys' then go for it. The Lisp version I wrote still invokes the original C code for the \\{...} case. I did not try to rewrite that in Lisp. IMO, the best solution would be to: 1. Keep the Lisp code I wrote (or similar), renaming it to `substitute-command-keys'. 2. Simplify the original C code to handle just the \\{...} case, rename that function, and use it in #1 to handle the \\{...} parts (just as now, but under its new, {}-specific name). Alternatively, you can write #2 in Lisp, if you like. Wrt your question of whether "there are places where such buttons become annoying": I would say that it does not matter whether there are currently any such places. There is no reason not to treat the buttonizing as optional. `substitute-command-keys' produces a string from a string - typically doc. But the use of the output string need not be for a *Help* buffer (or similar context where buttons are appropriate). There is no reason to always buttonize these parts of the output string. Making buttonizing optional provides flexibility, at no cost. Nothing would be gained by making it mandatory.