[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master ec464789df: Put the define-minor-mode boilerplate at the end
From: |
Stefan Monnier |
Subject: |
Re: master ec464789df: Put the define-minor-mode boilerplate at the end of the doc strings |
Date: |
Sat, 02 Apr 2022 15:39:47 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
> + (let ((lines (if doc
> + (string-lines doc)
> + (list (format "Toggle %s on or off."
> mode-pretty-name)))))
> + ;; Insert the first line from the doc string.
> + (insert (pop lines))
> + ;; Ensure that we have (only) one blank line after the first
> + ;; line.
> + (ensure-empty-lines)
> + (while (and lines
> + (string-empty-p (car lines)))
> + (pop lines))
> + ;; Insert the doc string.
> + (dolist (line lines)
> + (insert line "\n"))
Why do we go through so much trouble? AFAICT all this does is force the
doc to be "one line, one empty line and then the rest", which we don't
enforce anywhere else (and is not always ideal, e.g. with some
docstrings where the second line continues the first).
Also, I don't see a strong reason to override the author's
decision to put N≠1 empty lines after the first.
If we want to push this kind of layout, maybe a better option is to do
it via checkdoc?
Stefan
- Re: master ec464789df: Put the define-minor-mode boilerplate at the end of the doc strings,
Stefan Monnier <=