From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46627: [PATCH] Add new help command 'describe-command' Date: Sat, 20 Feb 2021 10:18:31 +0200 Message-ID: <83eehb17ag.fsf@gnu.org> References: <835z2o4fes.fsf@gnu.org> <83pn0v257d.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31693"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 46627@debbugs.gnu.org To: Stefan Kangas , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 20 09:19:09 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDNTp-000883-0k for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Feb 2021 09:19:09 +0100 Original-Received: from localhost ([::1]:44630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDNTo-0003lK-3U for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Feb 2021 03:19:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDNTi-0003kz-Mi for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 03:19:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39374) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDNTi-0006RW-FN for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 03:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lDNTi-0005gP-8l for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 03:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Feb 2021 08:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46627 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46627-submit@debbugs.gnu.org id=B46627.161380913821835 (code B ref 46627); Sat, 20 Feb 2021 08:19:02 +0000 Original-Received: (at 46627) by debbugs.gnu.org; 20 Feb 2021 08:18:58 +0000 Original-Received: from localhost ([127.0.0.1]:50918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDNTe-0005g5-4x for submit@debbugs.gnu.org; Sat, 20 Feb 2021 03:18:58 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDNTa-0005fr-Mm for 46627@debbugs.gnu.org; Sat, 20 Feb 2021 03:18:56 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40505) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDNTT-0006Md-VI; Sat, 20 Feb 2021 03:18:48 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3234 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lDNTT-0004Ea-1r; Sat, 20 Feb 2021 03:18:47 -0500 In-Reply-To: (message from Stefan Kangas on Fri, 19 Feb 2021 22:10:58 -0600) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:200402 Archived-At: > From: Stefan Kangas > Date: Fri, 19 Feb 2021 22:10:58 -0600 > Cc: 46627@debbugs.gnu.org, larsi@gnus.org > > > When a long text in |@kbd (or any other Texinfo markup) is near a > > line's end, it is better to wrap it in @w{..}, so that it won't be > > broken in half by the end of line. > > I tried wrapping it in @w{..} but I wasn't able to get it to avoid line > breaks. Perhaps I'm doing something wrong, but I tried fixing these > cases manually for now. It's virtually impossible to fix that manually, as Info output and the printed output have different line metrics and different line-breaking algorithms. And even if you succeed to fix that manually, it will break again after any slight change in wording. The way to wrap it is like this: @w{@kbd{C-h f make-vector @key{RET}}} Is this what you tried? If so, how did it not work? > >> + (unless (and fn (symbolp fn)) > >> + (user-error "You didn't specify a function symbol")) > >> + (unless (or (fboundp fn) (get fn 'function-documentation)) > >> + (user-error "Symbol's function definition is void: %s" fn)) > > > > These messages say "function" regardless of whether the user typed > > "C-h x" or "C-h f". Is that optimal? > > Hmm, good point. I made an attempt at making this more user-friendly > and less technical in the attached patch by introducing two new > messages: > > 1. "You didn't specify a valid command name" > 2. "No such command: %s" > > WDYT? I'd prefer: 1. You didn't specify a command's symbol 2. Symbol is not a command: %s > Hmm, but now that I'm testing this, I'm not sure how to arrive at these > messages from `C-h x'. You can't. To trigger these you must do some wizardry with completion, to allow you to inject something that is not a function. maybe Stefan Monnier (CC'ed) can help with setting that up. > Should the more technical explanations therefore stay? If it's 110% impossible to trigger those messages, they can go, of course. The question is: can some completion trickery cause completing-read return with a value that is either not a symbol or a symbol whose function definition is void? > ->> Try typing C-h f previous-line . > +>> Try typing C-h x previous-line . > This displays all the information Emacs has about the > function which implements the C-p command. Perhaps the text here should be amended not to mention "function". Thanks.