From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: Filling the docstring generated by define-minor-mode Date: Tue, 1 Oct 2019 22:23:52 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000009a6e6e0593df2324" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="137061"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 01 23:01:36 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iFPH6-000Z7B-H2 for ged-emacs-devel@m.gmane.org; Tue, 01 Oct 2019 23:01:36 +0200 Original-Received: from localhost ([::1]:48110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFPH4-0007yH-7Z for ged-emacs-devel@m.gmane.org; Tue, 01 Oct 2019 17:01:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59497) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFOhG-0003fp-HI for emacs-devel@gnu.org; Tue, 01 Oct 2019 16:24:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFOhE-0000d4-Am for emacs-devel@gnu.org; Tue, 01 Oct 2019 16:24:34 -0400 Original-Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]:46779) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFOhC-0000bE-C1 for emacs-devel@gnu.org; Tue, 01 Oct 2019 16:24:30 -0400 Original-Received: by mail-qt1-x831.google.com with SMTP id u22so23315957qtq.13 for ; Tue, 01 Oct 2019 13:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=cs75QlFfjWmL97QxWXfNw4VahUEV8l9VL6aU5RQcgSg=; b=C01OQgcwJrJyREiB7c4dFwAlajxx8ePvupd9Skq9EYgqnhPmhBbQJ3z6s4vonL2bfs wrj66Z3wIVQEc82NpYyVTx4vkXCRdWRaVulgkOnrqds4BlUZOCGu3Dqu12736YI8PDIZ Q/G50Dc7YwbA0nYI24p/Hc676nOkjSJt3CxbHnhPnD+agsnQFSnH9XZ/l04yx9K9UF7o 68CZyr1PvQRSLPxS8qg1jU72qjO37v+3wN/A6yzSDn+3RJaVRBwTAi37y7bNOjT6+M1h +nY9meQfiZUXGXkhtJdkaSe0AKW7QymiqskLSHnNkqhBHVsLgRFHb1iCHxwnQjSQ+LCs GKYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=cs75QlFfjWmL97QxWXfNw4VahUEV8l9VL6aU5RQcgSg=; b=dbkEe+TNq3WF6/g9ib5NqNBujTDY3LcL01Zw2V5w4qJ7nP4DdNyFlxV1JhfkozLz5k sar6b7gHBJJXO1NEp2bzh1OjcpoamlmSNMovchJy2m2lJ8l+vs3cAp7TkMQPwzRJUZGj I8dWNUhp+gHTdzr9J+SrHbwvmcMTi4AAaBtQwXk1YEO+HUZoGA6rrSwhS5a4LeJnzTuc 37vf4jjF0+B7RG15UGCW1PoTkRtE22SWz/EsxFJCKCCEFMQ/LY0oE306y9kahP9gjq2A sb8DK7TrYgfCOIAaqqGt4UZ3M2X+yQBt+2/Zi7a1PH+eZSNQok5/PfR+/+K5LyH9LFl/ 4Awg== X-Gm-Message-State: APjAAAVB9KE51oZ4rCoTq9vLJoPj0O01h+7bjQCSO2qoRiQErELWlvkY GIPR2EyvTlnxUmDpFv7axywdBullrfH+yScJQRna2b83 X-Google-Smtp-Source: APXvYqyxfxWu/jbwYRXKOHbdB1S7jqziRUPIcNkAwxESgPYRn/lMEFAl017Y59yko/Pa4tupBOvRQ2jeJlZeEdkrmZ8= X-Received: by 2002:a05:6214:70c:: with SMTP id b12mr27072957qvz.87.1569961467864; Tue, 01 Oct 2019 13:24:27 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::831 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240445 Archived-At: --0000000000009a6e6e0593df2324 Content-Type: text/plain; charset="UTF-8" Revisiting this issue... I proposed to automatically refill the docstrings that are auto-generated by define-minor-mode. Hand-crafted docstrings, or other doc strings outside define-minor-mode's ones are not affected. Obviously, as the one who proposed it, I think this is a good change for that particular problem (and that particular problem *only*), regardless of whether we will want to add more formatting or refilling capabilities for docstrings in the future. So I'd like to get a definite "ok" or "not ok" to close this issue. diff --git i/lisp/emacs-lisp/easy-mmode.el w/lisp/emacs-lisp/easy-mmode.el index be531aab84..fe89ed1754 100644 --- i/lisp/emacs-lisp/easy-mmode.el +++ w/lisp/emacs-lisp/easy-mmode.el @@ -96,9 +96,15 @@ easy-mmode--mode-docstring (if (string-match-p "\\bARG\\b" doc) doc - (let ((argdoc (format easy-mmode--arg-docstring + (let ((fill-prefix nil) + (docstring-fc (bound-and-true-p emacs-lisp-docstring-fill-column)) + (fill-column (if (integerp docstring-fc) docstring-fc 65)) + (argdoc (format easy-mmode--arg-docstring mode-pretty-name))) - (replace-regexp-in-string "\\(\n\n\\|\\'\\)\\(.\\|\n\\)*\\'" - (concat argdoc "\\1") - doc nil nil 1))))) + (with-temp-buffer + (insert (replace-regexp-in-string "\\(\n\n\\|\\'\\)\\(.\\|\n\\)*\\'" + (concat argdoc "\\1") + doc nil nil 1)) + (fill-region (point-min) (point-max) 'left t) + (buffer-string)))))) ;;;###autoload --0000000000009a6e6e0593df2324 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Revisiting this issue...

I proposed to = automatically refill the docstrings that are auto-generated by define-minor= -mode. Hand-crafted docstrings, or other doc strings outside define-minor-m= ode's ones are not affected.

Obviously, as the= one who proposed it, I think this is a good change for that particular pro= blem (and that particular problem *only*), regardless of whether we will wa= nt to add more formatting or refilling capabilities for docstrings in the f= uture.=C2=A0

So I'd like to get a definite &qu= ot;ok" or "not ok" to close this issue.


diff --gi= t i/lisp/emacs-lisp/easy-mmode.el w/lisp/emacs-lisp/easy-mmode.el
index = be531aab84..fe89ed1754 100644
--- i/lisp/emacs-lisp/easy-mmode.el
+++= w/lisp/emacs-lisp/easy-mmode.el
@@ -96,9 +96,15 @@ easy-mmode--mode-doc= string
=C2=A0 =C2=A0 =C2=A0(if (string-match-p "\\bARG\\b" doc= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0doc
- =C2=A0 =C2=A0 =C2=A0(let ((= argdoc (format easy-mmode--arg-docstring
+ =C2=A0 =C2=A0 =C2=A0(let ((fi= ll-prefix nil)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(docstring-fc = (bound-and-true-p emacs-lisp-docstring-fill-column))
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(fill-column (if (integerp docstring-fc) docstring-= fc 65))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(argdoc (format easy-= mmode--arg-docstring
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mode-pretty-name)))<= br>- =C2=A0 =C2=A0 =C2=A0 =C2=A0(replace-regexp-in-string "\\(\n\n\\|\= \'\\)\\(.\\|\n\\)*\\'"
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(concat argdoc "\\1")
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0doc nil nil 1)))))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0(with-t= emp-buffer
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(insert (replace-regexp-i= n-string "\\(\n\n\\|\\'\\)\\(.\\|\n\\)*\\'"
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(c= oncat argdoc "\\1")
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0doc nil nil 1))
+ =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0(fill-region (point-min) (point-max) 'left t)
+= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(buffer-string))))))
=C2=A0
=C2=A0= ;;;###autoload

--0000000000009a6e6e0593df2324--