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#66267: Document cl-print.el in the CL manual. Date: Tue, 10 Oct 2023 14:26:09 +0300 Message-ID: <83v8bevhv2.fsf@gnu.org> References: <83fs2wyl5p.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19401"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66267@debbugs.gnu.org, monnier@iro.umontreal.ca To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 10 13:28:22 2023 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 1qqAuR-0004mu-Kk for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Oct 2023 13:28:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqAt6-0002X1-KY; Tue, 10 Oct 2023 07:26:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqAss-0002Pg-O4 for bug-gnu-emacs@gnu.org; Tue, 10 Oct 2023 07:26:43 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqAsr-0007xl-Vr for bug-gnu-emacs@gnu.org; Tue, 10 Oct 2023 07:26:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qqAtC-000318-II for bug-gnu-emacs@gnu.org; Tue, 10 Oct 2023 07:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Oct 2023 11:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66267 X-GNU-PR-Package: emacs Original-Received: via spool by 66267-submit@debbugs.gnu.org id=B66267.169693721811588 (code B ref 66267); Tue, 10 Oct 2023 11:27:02 +0000 Original-Received: (at 66267) by debbugs.gnu.org; 10 Oct 2023 11:26:58 +0000 Original-Received: from localhost ([127.0.0.1]:34119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqAt7-00030q-OJ for submit@debbugs.gnu.org; Tue, 10 Oct 2023 07:26:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqAt2-00030a-VA for 66267@debbugs.gnu.org; Tue, 10 Oct 2023 07:26:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqAsa-0007wC-DM; Tue, 10 Oct 2023 07:26:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WNs6EKG2+pw0Dwb7yCEnuAyKz6GyX1AXr7WYkP/hgvY=; b=dHDA0WmZXbgM ZEGf+itVw3FHbPdd/W6EP2KnHw1xBd7Cv4sJWrvcgXUP0OJBhGHmWSqGoryPsyJAT6HC89cLRGLzA LES2r0jTOe58TNFIaWOHeTAt1EJ2ZR8uyvEXGUWzGk6TEbyZqDuDpzveDumDIJYycy5DTDBhqcynB ZoaTi3xup2nyC2E3N0Tr8mhEZ3nQgj3oXKFZoNQg4JMqolfVTcofRMAez0eQuSDDc/g5UVnQxcoIn JN6Z7BJ4e84IpXMAljFCCMEGl078oS8XBqOEywko16VgYe7uBDI2MKQ0deQ/oxlhP04ICfnXtZMJT EyXiwZc/wLODZ4HJuBHiyA==; In-Reply-To: (message from Alan Mackenzie on Mon, 9 Oct 2023 17:41:04 +0000) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272194 Archived-At: > Date: Mon, 9 Oct 2023 17:41:04 +0000 > Cc: Stefan Monnier , 66267@debbugs.gnu.org > From: Alan Mackenzie > > +Several of these functions have a parameter @var{stream}; this > +specifies what to do with the characters printing produces. For > +example, it might be a buffer, a marker, @code{nil} (meaning use > +standard output), or @code{t} (use the echo area). @xref{Output > +Streams,,,elisp,GNU Emacs Lisp Reference Manual} for a full > +description. ^ Comma missing there. Old Texinfo versions insist on that. > +@defvar cl-print-compiled > +This variable controls how to print byte-compiled functions. Valid > +values are: > +@itemize @bullet > +@item This kind of stuff is better formatted with "@table @code", not with @itemize. > +@defvar cl-print-string-length > +The maximum length of a string to print before abbreviating it. A > +value of @code{nil} means no limit. And the default is...? > +When the CL printing functions abbreviate a string, they print the > +first @code{cl-print-string-length} characters of the string, followed > +by @samp{...}. When the printing is to a buffer, you can click with ^^^^^^^^^^ Why not @enddots{} ? > +This variable has effect only in the `cl-prin*' functions, not in > +primitives such as `prin1'. ^^^^^^^^^^ ^^^^^^^ These should be quoted with @code, not with literals quotes. > +@end defvar > + > +@defun cl-prin1 object &option stream > +Print @var{object} on @var{stream} (see above) according to its type > +and the settings described above. The variables @code{print-length} > +and @code{print-level} and the other standard Emacs settings also > +affect the printing (@pxref{Output Variables,,,elisp,GNU Emacs Lisp > +Reference Manual}). > +@end defun > + > +@defun cl-prin1-to-string object > +This function is like @code{cl-prin1}, except the output characters > +are returned as a string from this function rather than being passed > +to a stream. > +@end defun > + > +@defun cl-print-to-string-with-limit print-function value limit > +Return a string containing a printed representation of @var{value}. > +Attempt to get the length of the returned string under @var{limit} > +characters with successively more restrictive settings of > +@code{print-level}, @code{print-length}, and > +@code{cl-print-string-length}. Use @var{print-function} to print, > +which should take the arguments @var{value} and @var{stream} and which ^^^^^^^^^^^^ What is STREAM? > +should respect @code{print-length}, @code{print-level}, and > +@code{cl-print-string-length}. @var{limit} may be @code{nil} or zero > +in which case @var{print-function} will be called with these settings > +bound to @code{nil}, and it can also be @code{t} in which case > +@var{print-function} will be called with their current values. > + > +Use this function with @code{cl-prin1} to print an object, > +abbreviating it with ellipses to fit within a size limit. ^^^^^^^^ "ellipsis" The description of this function follows our style for doc string, not our style for manuals. In a manual, we don't say "print", "use", etc.; we say "the function prints", "it uses", etc. instead. > +@defun cl-print-object object stream > +Print OBJECT on STREAM (see above). This function is actually a ^^^^^^^^^^^^^^^^ @var{object} and @var{stream} > +@code{cl-defgeneric} which is defined for several types of Please add here a cross-reference to where cl-defgeneric is described. > +You can write @code{cl-print-object} @code{cl-defmethod}s for other > +types of @var{object}, thus extending @code{cl-prin1}. If you write > +such a method which uses ellipses, you should also write a ^^^^^^^^ "ellipsis" > +@defun cl-print-insert-ellipsis object start stream > +Print an ellipsis (@samp{...}) to @var{stream} (see above). When ^^^^^^^^^^ @dots{} is better > +@var{stream} is a buffer, the ellipsis will be given the > +@code{cl-print-ellipsis} text property. The value of the text > +property will contain state (including @var{start}) in order to print > +the elided part of OBJECT later. START should be nil if the whole > +OBJECT is being elided, otherwise it should be an index or other > +pointer into the internals of OBJECT which can be passed to > +`cl-print-object-contents' at a later time. Use @var here for arguments, instead of capitalizing. > +@defun cl-print-expand-ellipsis &optional button > +This command expands the ellipsis at point. Non-interactively, if If it's a command, it should be documented with "@deffn Command" instead of "@defun". Thanks.