unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Broken lisp-fill-paragraph post Emacs 28 update
@ 2022-07-09  2:52 Maxim Cournoyer
  2022-07-09  6:53 ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Maxim Cournoyer @ 2022-07-09  2:52 UTC (permalink / raw)
  To: guix-devel; +Cc: Ricardo Wurmus

Hi,

If you too have been wondering why hitting M-q on package descriptions
doesn't produce the intended effect anymore (the first line of text
protrudes beyond the fill-column value), this may be of interest.

The problem was introduced in commit 9bf367e1848, which aimed to improve
the handling of Elisp docstrings.  To revert to the old version (the one
that shipped with Emacs 27), you can put this in your .emacs:

--8<---------------cut here---------------start------------->8---
(require 'lisp-mode)
(defun lisp-fill-paragraph (&optional justify)
  (interactive "P")
  (or (fill-comment-paragraph justify)
      (let ((paragraph-start
             (concat paragraph-start
                     "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)"))
	    (paragraph-separate
	     (concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
            (fill-column (if (and (integerp emacs-lisp-docstring-fill-column)
                                  (derived-mode-p 'emacs-lisp-mode))
                             emacs-lisp-docstring-fill-column
                           fill-column)))
	(fill-paragraph justify))
      ;; Never return nil.
      t))
--8<---------------cut here---------------end--------------->8---

For more details, you can refer to the (now closed) upstream bug report
here [0].

[0]  https://issues.guix.gnu.org/56197

Happy hacking!

Maxim


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

* Re: Broken lisp-fill-paragraph post Emacs 28 update
  2022-07-09  2:52 Broken lisp-fill-paragraph post Emacs 28 update Maxim Cournoyer
@ 2022-07-09  6:53 ` Ricardo Wurmus
  2022-07-10  5:08   ` Maxim Cournoyer
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2022-07-09  6:53 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: guix-devel


Hi Maxim,

> The problem was introduced in commit 9bf367e1848, which aimed to improve
> the handling of Elisp docstrings.  To revert to the old version (the one
> that shipped with Emacs 27), you can put this in your .emacs:
>
> (require 'lisp-mode)
> (defun lisp-fill-paragraph (&optional justify)
>   (interactive "P")
>   (or (fill-comment-paragraph justify)
>       (let ((paragraph-start
>              (concat paragraph-start
>                      "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)"))
> 	    (paragraph-separate
> 	     (concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
>             (fill-column (if (and (integerp emacs-lisp-docstring-fill-column)
>                                   (derived-mode-p 'emacs-lisp-mode))
>                              emacs-lisp-docstring-fill-column
>                            fill-column)))
> 	(fill-paragraph justify))
>       ;; Never return nil.
>       t))
>
> For more details, you can refer to the (now closed) upstream bug report
> here [0].
>
> [0]  https://issues.guix.gnu.org/56197

Oof, that’s a frustrating discussion.  Interesting how it took just
*one* comment to dismiss the new bug report with “the votes are in” :-/

Thanks for the procedure definition above.  Do you think we should
enable this by default in the guix-devel minor mode?

-- 
Ricardo


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

* Re: Broken lisp-fill-paragraph post Emacs 28 update
  2022-07-09  6:53 ` Ricardo Wurmus
@ 2022-07-10  5:08   ` Maxim Cournoyer
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Cournoyer @ 2022-07-10  5:08 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hi,

Ricardo Wurmus <rekado@elephly.net> writes:

> Hi Maxim,
>
>> The problem was introduced in commit 9bf367e1848, which aimed to improve
>> the handling of Elisp docstrings.  To revert to the old version (the one
>> that shipped with Emacs 27), you can put this in your .emacs:
>>
>> (require 'lisp-mode)
>> (defun lisp-fill-paragraph (&optional justify)
>>   (interactive "P")
>>   (or (fill-comment-paragraph justify)
>>       (let ((paragraph-start
>>              (concat paragraph-start
>>                      "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)"))
>> 	    (paragraph-separate
>> 	     (concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
>>             (fill-column (if (and (integerp emacs-lisp-docstring-fill-column)
>>                                   (derived-mode-p 'emacs-lisp-mode))
>>                              emacs-lisp-docstring-fill-column
>>                            fill-column)))
>> 	(fill-paragraph justify))
>>       ;; Never return nil.
>>       t))
>>
>> For more details, you can refer to the (now closed) upstream bug report
>> here [0].
>>
>> [0]  https://issues.guix.gnu.org/56197
>
> Oof, that’s a frustrating discussion.  Interesting how it took just
> *one* comment to dismiss the new bug report with “the votes are in” :-/
>
> Thanks for the procedure definition above.  Do you think we should
> enable this by default in the guix-devel minor mode?

I went ahead and pushed a changed to our .dir-locals.el file that
reverts the behavior of lisp-fill-paragraph to that of Emacs 27 (see
commit c9fb789fe9) Along with an update to our paredit package, it does
the job.  Let me know if something doesn't work as advertised.

Thanks,

Maxim


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

end of thread, other threads:[~2022-07-10  5:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-09  2:52 Broken lisp-fill-paragraph post Emacs 28 update Maxim Cournoyer
2022-07-09  6:53 ` Ricardo Wurmus
2022-07-10  5:08   ` Maxim Cournoyer

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

	https://git.savannah.gnu.org/cgit/guix.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).