Subject: bug#56476: 29.0.50; lisp-fill-paragraph broken

From: Visuwesh <[email-masked]>
Date: Sun, 10 Jul 2022 13:39:30 +0530

lisp-fill-paragraph does not fill paragraphs properly anymore.  It
leaves a space in the beginning of line, it does not join soft newlines.

To reproduce, paste the following text in emacs -Q

    (defvar test
      "Some docstring.
    This buffer is for text that is not saved, and for Lisp evaluation.
    To create a file, visit it with C-x C-f and enter text in its buffer.")

and move the point inside the docstring and say M-x lisp-fill-paragraph
RET.  Now undo the changes, and say M-q which fills the docstring
properly.

Reverting the last three commits that touched lisp-fill-paragraph fixes
the issue for me.

    commit 8f5d9d0abd0f5078646bc85c7a4d480b32057a47
    Author: Lars Ingebrigtsen <[email-masked]>
    Date:   Sun Jun 26 16:31:33 2022 +0200

        Fix a recent Lisp mode filling test failure

        * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Restore the
        "fill first line separately" logic.

    commit 040c03cae2db361d2e014a52d969a6b0ebc48f1c
    Author: Lars Ingebrigtsen <[email-masked]>
    Date:   Sat Jun 25 14:58:01 2022 +0200

        Make `M-q' work on the first line of a multi-line string again

        * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Exclude the
        quote marks from the region so that filling works (bug#56197).

    commit 88a04ea985180d1fd619c4a6540fb117a1d59d9e
    Author: Lars Ingebrigtsen <[email-masked]>
    Date:   Wed Apr 13 05:07:30 2022 +0200

        Tweak how `M-q' in emacs-lisp-mode works

        * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Only fill as
        strings inside strings (bug#31656).
        (lisp--fill-line-simple): New function to do simple sexp-based
        filling.

In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2022-07-10 built on astatine
Repository revision: 85a06306c0e2ca27365cf213b26ed526ae7a0b76
Repository branch: tamil-phonetic4
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-sound=alsa --with-x-toolkit=lucid --with-json
 --without-xaw3d --without-gconf --without-libsystemd --without-cairo'

Configured features:
ACL DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XFT
XIM XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LC_MONETARY: ta_IN.UTF-8
  value of $LC_NUMERIC: ta_IN.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  buffer-face-mode: t
  recentf-mode: t
  eros-mode: t
  pdf-occur-global-minor-mode: t
  minibuffer-depth-indicate-mode: t
  repeat-mode: t
  display-time-mode: t
  display-battery-mode: t
  winner-mode: t
  delete-selection-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  undelete-frame-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug time-stamp imenu-xref-autoloads autoload loaddefs-gen
cl-print finder skeleton autoinsert ement-taxy svg-lib mm-archive
ement-room-list ement ement-notify notifications ement-room ement-lib
ement-api ement-structs plz ement-macros taxy-magit-section
magit-section taxy dns qp avy descr-text dabbrev flyspell ispell
ecomplete shell-command+ vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs
vc-rcs vc-dir ewoc emacs-news-mode ffap smerge-mode whitespace log-edit
add-log pcmpl-gnu flymake-shellcheck make-mode display-line-numbers
ind-util pulse color xref misc pcmpl-unix face-remap sh-script smie
executable files-x shell pcomplete expand-region text-mode-expansions
er-basic-expansions expand-region-core expand-region-custom misearch
multi-isearch dired-aux gnus-dired reveal recentf tree-widget vc-backup
log-view pcvs-util vc diff noutline outline vc-git diff-mode
vc-dispatcher bug-reference mule-util info-look help-fns radix-tree
shortdoc cursor-sensor sort gnus-cite mail-extr textsec uni-scripts
idna-mapping ucs-normalize uni-confusable textsec-check gnus-async
gnus-bcklg gnus-ml network-stream nsm nndraft nnmh nnfolder nnmaildir
nnagent nnml nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig nntp
gnus-cache gnus-sum shr pixel-fill kinsoku url-file url-dired svg dom
gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int
gnus-range message sendmail yank-media puny rfc822 mml mml-sec epa epg
rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util mail-utils range mm-util mail-prsvr server paredit
edmacro kmacro eros time-date checkdoc lisp-mnt flymake-proc flymake
project warnings thingatpt wordel-autoloads sokoban-autoloads
ement-autoloads svg-lib-autoloads taxy-magit-section-autoloads
taxy-autoloads plz-autoloads nov-autoloads esxml-autoloads kv-autoloads
transmission-autoloads lua-mode-autoloads nix-mode-autoloads
magit-section-autoloads dash-autoloads racket-mode-autoloads
eros-autoloads flymake-shellcheck-autoloads writegood-mode-autoloads
siege-mode-autoloads paredit-autoloads puni-autoloads
expand-region-autoloads filladapt-autoloads compose quail
scroll-other-window org-pdftools-autoloads org-noter-autoloads
change-env-autoloads math-delimiters-autoloads doct-autoloads
ob-async-autoloads async-autoloads emacs-ob-racket-autoloads
valign-autoloads cdlatex-autoloads auctex-autoloads tex-site pdf-occur
ibuf-ext ibuffer ibuffer-loaddefs tablist advice tablist-filter
semantic/wisent/comp semantic/wisent semantic/wisent/wisent
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet pdf-isearch let-alist pdf-misc imenu
pdf-tools package browse-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie generate-lisp-file url-domsuf
url-util mailcap url-handlers url-parse auth-source eieio eieio-core
eieio-loaddefs json map byte-opt url-vars compile comint ansi-color
cus-edit edebug debug backtrace find-func wid-edit pdf-view
password-cache jka-compr pdf-cache pdf-info tq pdf-util pdf-macs
image-mode dired-x dired dired-loaddefs exif pdf-tools-autoloads
tablist-autoloads mb-depth repeat visual-fill-autoloads
olivetti-autoloads time format-spec battery dbus filenotify xml
disp-table lacarte-autoloads shell-command-plus-autoloads winner ring
derived delsel cus-load easy-mmode avy-autoloads vc-backup-autoloads
icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs rx
filecache flymake-grammarly-autoloads grammarly-autoloads
websocket-autoloads finder-inf request-autoloads s-autoloads
chemtable-autoloads molar-mass-autoloads saveplace-pdf-view saveplace
bookmark text-property-search pp saveplace-pdf-view-autoloads pcase
inspector-autoloads xr-autoloads straight-autoloads cl-seq info cl-extra
help-mode straight subr-x cl-macs gv cl-loaddefs cl-lib bytecomp
byte-compile cconv vz-nh-theme vz-options-theme rmc iso-transl tooltip
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
faces cus-face macroexp files window text-properties overlay sha1 md5
base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 1038014 190846) (symbols ?0 48207 339) (strings 32 262637 22687) (string-bytes 1 7127398) (vectors 16 119592) (vector-slots 8 2674512 186555) (floats 8 673 924) (intervals ?8 76450 5808) (buffers 992 ?U))