unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55209: 29.0.50; Let easy-mmode--mode-docstring handle empty DOC
@ 2022-05-01 18:41 daanturo
  2022-05-01 18:49 ` Lars Ingebrigtsen
  2022-05-02  8:32 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 3+ messages in thread
From: daanturo @ 2022-05-01 18:41 UTC (permalink / raw)
  To: 55209

From 4f9bb869c736ffc10be6a83d33024247fd6f0573 Mon Sep 17 00:00:00 2001
From: Daanturo <daanturo@gmail.com>
Date: Mon, 2 May 2022 00:53:40 +0700
Subject: [PATCH] Allow empty docstrings for minor modes

* lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): handle
empty DOC case.
---
lisp/emacs-lisp/easy-mmode.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 8a76eaf58c..4348efe363 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -106,7 +106,8 @@ it is disabled.")
;; Compose a new doc string.
(with-temp-buffer
(let ((lines (if doc
- (string-lines doc)
+ (or (string-lines doc)
+ '(""))
(list (format "Toggle %s on or off." mode-pretty-name)))))
;; Insert the first line from the doc string.
(insert (pop lines))
-- 
2.36.0

-- 
Daanturo.






^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#55209: 29.0.50; Let easy-mmode--mode-docstring handle empty DOC
  2022-05-01 18:41 bug#55209: 29.0.50; Let easy-mmode--mode-docstring handle empty DOC daanturo
@ 2022-05-01 18:49 ` Lars Ingebrigtsen
  2022-05-02  8:32 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-01 18:49 UTC (permalink / raw)
  To: daanturo; +Cc: 55209

daanturo <daanturo@gmail.com> writes:

> * lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): handle
> empty DOC case.

[...]

> ;; Compose a new doc string.
> (with-temp-buffer
> (let ((lines (if doc
> - (string-lines doc)
> + (or (string-lines doc)
> + '(""))

Is this patch against an old checkout?  The code currently looks like
this:

    ;; Compose a new doc string.
    (with-temp-buffer
      (let ((lines (if doc
                       (string-lines doc)
                     (list (format "Toggle %s on or off." mode-pretty-name)))))


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#55209: 29.0.50; Let easy-mmode--mode-docstring handle empty DOC
  2022-05-01 18:41 bug#55209: 29.0.50; Let easy-mmode--mode-docstring handle empty DOC daanturo
  2022-05-01 18:49 ` Lars Ingebrigtsen
@ 2022-05-02  8:32 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-02  8:32 UTC (permalink / raw)
  To: daanturo; +Cc: 55209

daanturo <daanturo@gmail.com> writes:

> * lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): handle
> empty DOC case.

I've fixed this in Emacs 29 now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-02  8:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-01 18:41 bug#55209: 29.0.50; Let easy-mmode--mode-docstring handle empty DOC daanturo
2022-05-01 18:49 ` Lars Ingebrigtsen
2022-05-02  8:32 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).