From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#65790: 29.1; "docstring wider than 80 characters" when there is no docstring Date: Sun, 10 Sep 2023 02:55:59 -0700 Message-ID: References: <87edjbp1aq.fsf@cassou.me> <87fs3qwcoi.fsf@cassou.me> <87o7iaikxd.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25607"; mail-complaints-to="usenet@ciao.gmane.io" To: Damien Cassou , 65790@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 10 11:57:13 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 1qfHBp-0006RI-FC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Sep 2023 11:57:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfHBb-0004Xv-R4; Sun, 10 Sep 2023 05:56:59 -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 1qfHBa-0004Xh-Iz for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 05:56:58 -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 1qfHBa-0002al-BO for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 05:56:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfHBd-0007I3-Mh for bug-gnu-emacs@gnu.org; Sun, 10 Sep 2023 05:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Sep 2023 09:57:01 +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.169433977427965 (code B ref 65790); Sun, 10 Sep 2023 09:57:01 +0000 Original-Received: (at 65790) by debbugs.gnu.org; 10 Sep 2023 09:56:14 +0000 Original-Received: from localhost ([127.0.0.1]:49104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfHAs-0007Gz-76 for submit@debbugs.gnu.org; Sun, 10 Sep 2023 05:56:14 -0400 Original-Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:49229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfHAo-0007Gl-Gz for 65790@debbugs.gnu.org; Sun, 10 Sep 2023 05:56:12 -0400 Original-Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2bcfd3220d3so56365801fa.2 for <65790@debbugs.gnu.org>; Sun, 10 Sep 2023 02:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694339761; x=1694944561; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=qRT+v7ooEnenUNWODtT/I9SB82gAmwww7DuLFj7o3R8=; b=kxRP6gzgNx9T7jazJQ3Y0bRzhl2r04FMUebqWXkgVF4sX7Oxcbp2afgRnyDzFXAfee rmVSI59ZM2iKssR9mLBhDvTP9DTB8PEv4iKpYs81g4pE0rWz27ySxdNtUjZxvDnEd4ax QZvw5xR441fhOHvwdjzHwzwFT8tQccuCbqMCelhCs44223wZBxQrvGUZb7oWsf/4V/KO iEJQI8kLBrO7zFHnHhGZ+kzqp75PZjyAEzyt7AV18KUC67Msxckh/rYJMsaKsqnaFCdv hbL0noB5f0iMsR7gdJhaI+qYSnmBVzdcAQYaY1ukqjLo0iQPnQiEsemllFAAYBHoDKAS /fzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694339761; x=1694944561; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qRT+v7ooEnenUNWODtT/I9SB82gAmwww7DuLFj7o3R8=; b=H+B2kIdtxV9AtUAx/rb+kUmlV38pmamXalQVNulVysFsUmHNrLd43/IbMz9h0RtxDT Yl1reiOi02VIM6pcCRUhS6H1hs4mzWgXWKWlteKLQfZp4KvfREqJPWrUslFsxGGVxEua 23Ne+furT3YtdSwxb40O1XP+JALtw1g3KnHPxdnUq+KsM/7mIORDthwa0bsTjKLuCBZK dzAGjoAs5onvfCaErWr6TkUgXLRGgT6RpdnuXO/HOLyuEx57BqdAnBhJXInJ/nAhXJYv Qaqr/MOFgh2wavb+HEONA38rny46f7MnVEDXPsc0lmV7JC5Np+lVMJnXcilUIHHoYi3S VI5A== X-Gm-Message-State: AOJu0Yw6Xm1I/xpN3aZXFl8+K719cjUe1nc9hOfFQwkwvt91kW9CM5y8 RJyPR5RvmY2j7QEbG6lv2ougdUBGFVdbl+BS1nI= X-Google-Smtp-Source: AGHT+IEk+cUVhzduBBsVtrb2YiWG02UN0Jdt7545Nj3cX7MalNVp7B5ojn179nNShlAfu02fYnqqaGHnl01UQTBkzgY= X-Received: by 2002:a2e:9093:0:b0:2bc:e470:1412 with SMTP id l19-20020a2e9093000000b002bce4701412mr5852050ljg.43.1694339760379; Sun, 10 Sep 2023 02:56:00 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 10 Sep 2023 02:55:59 -0700 In-Reply-To: <87o7iaikxd.fsf@cassou.me> 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:269943 Archived-At: Damien Cassou writes: > 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. Thanks, some comments below. I think this also could use some tests, see bytecomp-tests.el:964 and onwards. > 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. Please remember to include the bug number when it is known. > --- > 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) Why drop the word "inlining"? (This comment might need reflowing.) > (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) Could we keep the old format when possible, and use the new one only when needed? > (if doc (concat "\n" doc) "")) > (declare (side-effect-free t)) > ,access-body) > -- > 2.41.0