From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Cassou Newsgroups: gmane.emacs.bugs Subject: bug#65790: 29.1; "docstring wider than 80 characters" when there is no docstring Date: Sun, 10 Sep 2023 08:47:42 +0200 Message-ID: <87o7iaikxd.fsf@cassou.me> References: <87edjbp1aq.fsf@cassou.me> <87fs3qwcoi.fsf@cassou.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18840"; mail-complaints-to="usenet@ciao.gmane.io" To: Stefan Kangas , 65790@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 10 08:48:28 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 1qfEF9-0004fF-6d for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Sep 2023 08:48:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfEEr-0008M5-90; Sun, 10 Sep 2023 02:48:11 -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 1qfEEi-0008Lf-4M for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 02:48:01 -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 1qfEEh-0007qE-QS for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 02:47:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfEEk-0002rb-If for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 02:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Damien Cassou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Sep 2023 06:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65790 X-GNU-PR-Package: emacs Original-Received: via spool by 65790-submit@debbugs.gnu.org id=B65790.169432848110993 (code B ref 65790); Sun, 10 Sep 2023 06:48:02 +0000 Original-Received: (at 65790) by debbugs.gnu.org; 10 Sep 2023 06:48:01 +0000 Original-Received: from localhost ([127.0.0.1]:48855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfEEi-0002rC-I1 for submit@debbugs.gnu.org; Sun, 10 Sep 2023 02:48:00 -0400 Original-Received: from mail.choca.pics ([2001:910:1410:500::1]:36154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfEEc-0002qK-UB for 65790@debbugs.gnu.org; Sun, 10 Sep 2023 02:47:59 -0400 Original-Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 41A2A18192DF4; Sun, 10 Sep 2023 08:47:48 +0200 (CEST) Original-Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id UCaUrIqgnt-s; Sun, 10 Sep 2023 08:47:47 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 85D5318192DF5; Sun, 10 Sep 2023 08:47:47 +0200 (CEST) X-Virus-Scanned: amavis at choca.pics Original-Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10026) with ESMTP id E5FYTUJrb81D; Sun, 10 Sep 2023 08:47:47 +0200 (CEST) Original-Received: from localhost (91.60.75.86.rev.sfr.net [86.75.60.91]) by mail.choca.pics (Postfix) with ESMTPSA id 70F8518192DF4; Sun, 10 Sep 2023 08:47:46 +0200 (CEST) In-Reply-To: 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:269917 Archived-At: --=-=-= Content-Type: text/plain Stefan Kangas writes: > That's basically the solution, yes, but we probably want to wrap the > lines only when it's necessary. See `internal--fill-string-single-line' > and where it is used for inspiration. What do you think about attached patch? The patch replaces one usage of `format' with `internal--format-docstring-line' and also slightly change 2 docstring texts. -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Shorten-docstrings-generated-in-cl-macs.el.patch >From 093c76caa8ac551868565d0e690b9979593cf94d Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sun, 10 Sep 2023 08:40:52 +0200 Subject: [PATCH] Shorten docstrings generated in cl-macs.el * lisp/emacs-lisp/cl-macs.el (cl-defsubst): Reduce likelihood of "docstring wider than 80 characters" errors in generated code. --- lisp/emacs-lisp/cl-macs.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index c8e2610c8b0..0f142b87e07 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2931,7 +2931,15 @@ cl-defsubst ,(if (memq '&key args) `(&whole cl-whole &cl-quote ,@args) (cons '&cl-quote args)) - ,(format "compiler-macro for inlining `%s'." name) + ;; NB. This will produce incorrect results + ;; in some cases, as our coding conventions + ;; says that the first line must be a full + ;; sentence. However, if we don't word wrap + ;; we will have byte-compiler warnings about + ;; overly long docstrings. So we can't have + ;; a perfect result here, and choose to avoid + ;; the byte-compiler warnings. + ,(internal--format-docstring-line "compiler-macro for `%s'." name) (cl--defsubst-expand ',argns '(cl-block ,name ,@(cdr (macroexp-parse-body body))) nil @@ -3190,7 +3198,10 @@ cl-defstruct ;; a perfect result here, and choose to avoid ;; the byte-compiler warnings. (internal--format-docstring-line - "Access slot \"%s\" of `%s' struct CL-X." slot name) + "Access slot \"%s\" of CL-X." slot) + "\n" + (internal--format-docstring-line + "Struct CL-X is a `%s'." name) (if doc (concat "\n" doc) "")) (declare (side-effect-free t)) ,access-body) -- 2.41.0 --=-=-=--