From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#25461: [Patch]: Missing doc strings for "," and ",@". Date: Thu, 19 Jan 2017 17:58:01 +0000 Message-ID: <20170119175801.GB3397@acm.fritz.box> References: <20170116212257.GA4747@acm.fritz.box> <20170118194320.GB4108@acm.fritz.box> <87lgu7dbyz.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1484849296 30971 195.159.176.226 (19 Jan 2017 18:08:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 19 Jan 2017 18:08:16 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: 25461@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 19 19:08:11 2017 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 1cUH7q-0006P4-JV for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Jan 2017 19:07:54 +0100 Original-Received: from localhost ([::1]:50181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUH7v-0003FK-C4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Jan 2017 13:07:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUGzK-0004jn-0x for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 12:59:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUGzG-0001EQ-P7 for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 12:59:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cUGzG-0001EL-Kn for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 12:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cUGzG-0000mn-BX for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 12:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jan 2017 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25461 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25461-submit@debbugs.gnu.org id=B25461.14848487002962 (code B ref 25461); Thu, 19 Jan 2017 17:59:02 +0000 Original-Received: (at 25461) by debbugs.gnu.org; 19 Jan 2017 17:58:20 +0000 Original-Received: from localhost ([127.0.0.1]:35738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUGya-0000li-FA for submit@debbugs.gnu.org; Thu, 19 Jan 2017 12:58:20 -0500 Original-Received: from ocolin.muc.de ([193.149.48.4]:21307 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1cUGyY-0000lY-1g for 25461@debbugs.gnu.org; Thu, 19 Jan 2017 12:58:18 -0500 Original-Received: (qmail 24627 invoked by uid 3782); 19 Jan 2017 17:58:17 -0000 Original-Received: from acm.muc.de (p548C6E05.dip0.t-ipconnect.de [84.140.110.5]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 19 Jan 2017 18:58:16 +0100 Original-Received: (qmail 3488 invoked by uid 1000); 19 Jan 2017 17:58:01 -0000 Content-Disposition: inline In-Reply-To: <87lgu7dbyz.fsf@web.de> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:128246 Archived-At: Hello, Michael. On Thu, Jan 19, 2017 at 03:23:32AM +0100, Michael Heerdegen wrote: > Hi Alan, > > diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el > > index 94c561c..86ca010 100644 > > --- a/lisp/emacs-lisp/backquote.el > > +++ b/lisp/emacs-lisp/backquote.el > > @@ -247,4 +247,33 @@ backquote-listify > > tail)) > > (t (cons 'list heads))))) > > + > > +;; Give `,' and `,@' documentation strings which can be examined by C-h f. > > +(put '\, 'function-documentation > > + "`,' signals that the next form should be evaluated and inserted. > > +It can occur only in `\\=`' constructs. > > + > > +For example: > > + > > +b => (ba bb bc) ; assume b has this value > > +\\=`(a ,b c) => (a (ba bb bc) c) ; insert the value of b > > + > > +See also `\\=`' and `,@'. > I don't think this makes it easier for people to understand things. > This suggests that "," has some kind of meaning per se, that it is a > macro-like thing, etc, and that pcase somehow redefines it. Yes. All these things are true, aren't they? > Of course there is a logic behind pcase's usage of ` and ,. The > usage of these suggests a mental model for their "meaning". But we > should not describe our mental models in docstrings. That's only useful > for people sharing the same model. I'm not sure I'm following you here. A high level description of a function necessarily involves a mental model. > The bindings of variables depend on context. The semantics of functions > are fluent (advice, local functions). And also the "meaning" of the > sexps created by ` and , depend on the context - in Lisp, the "meaning" > of all sexps depends on context. (foo bar) can be a function call or a > part of a let variable binding or a list or a pcase pattern. It's not > different for sexps involving `. ` has a specific meaning, and has had a high quality doc string for ever. , likewise has a specific meaning, but doesn't yet have a doc string. In Emacs Lisp, functions generally have well defined context-free semantics, though there are exceptions. > So I think we maximally should describe what the reader does with ` > etc., so that people know what to search for in the manual or remember > what they already had learned. We don't do that for other functions. A function's doc string should be a crisp summary of what a function _does_. A doc string which directs people to a manual, or is so confusing or unspecific that the reader is forced to open a manual, is a failed doc string. , has a definite precise function (disregarding its use in pcase for now). Have you any specific suggestions on how to improve my wording of its doc string? > + ((get function 'reader-macro) > + "a reader macro") > We don't have reader macros in Emacs. The reader performs macro-like actions. What is the correct alternative term for what the reader does with ', `, ,, #', etc.? > If we had them, we could implement ', ` etc. as reader macros. But > using this term in H-f is confusing, because it is not used in the > manual. What would be a less confusing alternative? > Regards, > Michael -- Alan Mackenzie (Nuremberg, Germany).