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: Fri, 19 Feb 2021 22:05:58 +0200 Message-ID: <83pn0v257d.fsf@gnu.org> References: <835z2o4fes.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30184"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 46627@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 19 21:07:10 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 1lDC3R-0007jc-QQ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Feb 2021 21:07:09 +0100 Original-Received: from localhost ([::1]:46944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDC3Q-0005C2-S2 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Feb 2021 15:07:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDC3K-0005B5-9f for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2021 15:07:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDC3K-0005MF-1H for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2021 15:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lDC3J-00058X-Sd for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2021 15:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Feb 2021 20:07:01 +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.161376517219687 (code B ref 46627); Fri, 19 Feb 2021 20:07:01 +0000 Original-Received: (at 46627) by debbugs.gnu.org; 19 Feb 2021 20:06:12 +0000 Original-Received: from localhost ([127.0.0.1]:50461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDC2W-00057T-EC for submit@debbugs.gnu.org; Fri, 19 Feb 2021 15:06:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDC2U-00057F-2g for 46627@debbugs.gnu.org; Fri, 19 Feb 2021 15:06:11 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56885) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDC2O-0004so-Dv; Fri, 19 Feb 2021 15:06:04 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2155 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lDC25-0007Qy-53; Fri, 19 Feb 2021 15:05:53 -0500 In-Reply-To: (message from Stefan Kangas on Fri, 19 Feb 2021 11:42:50 -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:200382 Archived-At: > From: Stefan Kangas > Date: Fri, 19 Feb 2021 11:42:50 -0600 > Cc: 46627@debbugs.gnu.org, Lars Ingebrigtsen > > The way I add it in the documentation treats it as more basic than > `C-h f'. That is, the proposed text first describes how to find > documentation for commands, and only then describes how to find > documentation for any Lisp function. It is the most reasonable way to > do it here, I think; this is after all the "user" manual and not the > "Elisp" manual. Please remember this when we discuss use of functions in user-level features, such as values for user options. > +@item C-h x @var{command} @key{RET} > +Display documentation on the command named @var{command} It is better to avoid duplicating "command" here. Like this: Display documentation on the named @var{command}. It is advantageous to use this style whenever the thing in @var{..} is a term that explains itself clearly enough, like here. > + @kbd{C-h x @var{command} @key{RET}} (@code{describe-command}) > +displays the documentation of the command @var{command}, in a ^^^^^^^^^^^^^^^^^^^^^ Likewise. > +displays the documentation of @code{auto-fill-mode}. This is how you > +would get the documentation of a command that is not bound to any key > +(one which you would normally run using @kbd{M-x}). Since all > +commands are Lisp functions, you can also find its documentation using > +@code{describe-function}. The last sentence is better moved to the description of describe-function. > + @kbd{C-h f @var{function} @key{RET}} (@code{describe-function}) > +displays the documentation of Lisp function @var{function}. This ^^^^^^^^^^^^^^^^^^^^^^^ Duplication of "function" again. (Yes, I know it was that way in the original text.) > +@code{make-vector} properly, type @kbd{C-h f make-vector > +@key{RET}}. 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. > + (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? Thanks.