From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#32212: 26; `subword-mode' doc string shows empty key-binding list Date: Sun, 22 Jul 2018 18:01:54 -0700 (PDT) Message-ID: <1fd3e236-7840-4115-bce8-a5d9201af2ce@default> References: <87effy7mer.fsf@gmail.com> <83tvou1jdb.fsf@gnu.org> <87r2jyjo92.fsf@gmx.net> <874lgr58bo.fsf@gmail.com> <709db299cf7a15791e4f342e2efa4993@webmail.orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1532307674 12936 195.159.176.226 (23 Jul 2018 01:01:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 23 Jul 2018 01:01:14 +0000 (UTC) Cc: Stephen Berman , 32212@debbugs.gnu.org, bug-gnu-emacs To: Phil Sainty , Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 23 03:01:10 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhPDp-0003C1-VA for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jul 2018 03:01:10 +0200 Original-Received: from localhost ([::1]:58999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhPFu-0007vF-KZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Jul 2018 21:03:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhPFm-0007uy-Sl for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2018 21:03:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhPFh-0002Jk-Vb for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2018 21:03:10 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47859) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhPFh-0002Je-R2 for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2018 21:03:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fhPFe-0007Eo-4g for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2018 21:03:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Jul 2018 01:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32212 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch confirmed Original-Received: via spool by 32212-submit@debbugs.gnu.org id=B32212.153230772727761 (code B ref 32212); Mon, 23 Jul 2018 01:03:02 +0000 Original-Received: (at 32212) by debbugs.gnu.org; 23 Jul 2018 01:02:07 +0000 Original-Received: from localhost ([127.0.0.1]:52877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhPEj-0007Df-UJ for submit@debbugs.gnu.org; Sun, 22 Jul 2018 21:02:07 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:34254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhPEh-0007D9-U3 for 32212@debbugs.gnu.org; Sun, 22 Jul 2018 21:02:04 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6N0xjKD046025; Mon, 23 Jul 2018 01:01:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=d381Xh4lqexkfMGiR80v7NB8JhBgwpoUug/QphUY6Sc=; b=T3tPCH0j5uc32x/x/szlAqquHWfOmKWkOfCtm3omEXuyrgaTSIzWrFuKUy+EJpNm5fUT 4ZRaQ6Z+JlQOC9AqwZPxQvs0RW1gt3AeW3ujgCXMQwGwvpIzGEs0AlIMA3ErOsuBzbbq 1PdrZ1WxWBTY0Zfo9twdhyPZwvRQ80MxnfI0S1ILzNDk/exGeThPh8QfMBohbm2uRPkW KSldzOkKaT6ZSS3fMbihFJhQDk70EEiII31x9IRuJv8htYMap06RxbWJIO9xpFIfCQx1 mtNdYDk8GTuxcMdDi02AgcHnfmLwzwqGWoW4dyo3EfzPoPBOd2qgEyI6PDz7unMjCaJX 4g== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2kbvsnjf5e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Jul 2018 01:01:57 +0000 Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w6N11uQD014841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Jul 2018 01:01:57 GMT Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w6N11tMr020880; Mon, 23 Jul 2018 01:01:56 GMT In-Reply-To: <709db299cf7a15791e4f342e2efa4993@webmail.orcon.net.nz> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4717.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8962 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=867 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807230009 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:148833 Archived-At: > > Aha, then we should just remove it from the docstring, right? >=20 > Would it be better if the \\{some-keymap} substitution handled the > case where there were no bindings, and printed nothing? No. A doc string can introduce the list of bindings any way its author wants. We cannot predict what text might precede or follow the text \\{some-keymap}. We already handle the case where the keymap is not defined at all, by substituting this particular text: Uses keymap 'foo-map', which is not currently defined. And that's not ideal either, because it, like your suggestion (but in a different way) assumes something about the surrounding context. (defvar foo-map (make-keymap) "...")=20 (defun foo () "The key bindings are: \\{foo-map} For more info..." 42) `C-h f foo' ,---- | foo is a Lisp function in `...'. |=20 | (foo) |=20 | The key bindings are: |=20 | key binding | --- ------- |=20 |=20 | For more info... `---- (makunbound 'foo-map) `C-h f foo' ,---- | foo is a Lisp function in `...'. |=20 | (foo) |=20 | The key bindings are: |=20 |=20 | Uses keymap 'foo-map', which is not currently defined. |=20 | For more info... `---- With your suggestion: ,---- | foo is a Lisp function in `...'. |=20 | (foo) |=20 | The key bindings are: |=20 |=20 | For more info... `---- > That would then account for edge-cases where users add custom > bindings to a previously-empty keymap, or clobber a populated keymap > entirely. I think what we have now is clearest for such cases. It indicates that (1) the keymap is defined and (2) it is empty - it has no defined bindings. Printing nothing is much less clear, I think. Arguably, the no-keymap case could be handled a bit better. It might not be clear to users just what "not currently defined" is supposed to mean. It might be more accurate to say that the function uses `foo-map', which is not a variable whose value is a keymap. (Although the "currently" in the message now presumably hints that it might become defined when a file is loaded or some other initialization is done. That's useful.)