bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode


From: Eli Zaretskii
Subject: bug#31656: 26.1; `fill-paragraph' malformats in emacs-lisp-mode
Date: Fri, 01 Jun 2018 15:43:16 +0300

> From: Noam Postavsky <address@hidden>
> Cc: Stefan Guath <address@hidden>,  address@hidden
> Date: Fri, 01 Jun 2018 05:39:39 -0400
> 
> > Or are there real-life use cases where this behavior is grossly
> > inappropriate?
> 
> I don't think it makes sense to apply normal plain text filling rules to
> code.  Maybe it doesn't come up much because people don't usually call
> M-q on code, and usually lines of code are kept short enough that they
> wouldn't get filled anyway.  But picking a random example from rgrep
> ^.\{100,\}$ on the Emacs code base:
> 
> (defun feedmail-default-date-generator (maybe-file)
>   "Default function for generating Date: header contents."
>   (feedmail-say-debug ">in-> feedmail-default-date-generator")
>   (when maybe-file
>     (feedmail-say-debug (concat "4 cre " (feedmail-rfc822-date (nth 4 
> (file-attributes maybe-file)))))
>     (feedmail-say-debug (concat "5 mod " (feedmail-rfc822-date (nth 5 
> (file-attributes maybe-file)))))
>     (feedmail-say-debug (concat "6 sta " (feedmail-rfc822-date (nth 6 
> (file-attributes maybe-file))))))
>   (let ((date-time))
>     (if (and (not feedmail-queue-use-send-time-for-date) maybe-file)
>       (setq date-time (nth 5 (file-attributes maybe-file))))
>     (feedmail-rfc822-date date-time))
>   )
> 
> Running M-q on every line turns it into this nonsense:
> 
> (defun feedmail-default-date-generator (maybe-file)
>   "Default function for generating Date: header contents."
>   (feedmail-say-debug ">in-> feedmail-default-date-generator")
>   (when maybe-file
>     (feedmail-say-debug (concat "4
>     cre " (feedmail-rfc822-date (nth 4 (file-attributes
>     maybe-file)))))
>     (feedmail-say-debug (concat "5
>     mod " (feedmail-rfc822-date (nth 5 (file-attributes
>     maybe-file)))))
>     (feedmail-say-debug (concat "6
>     sta " (feedmail-rfc822-date (nth 6 (file-attributes
>     maybe-file))))))
>   (let ((date-time))
>     (if (and (not feedmail-queue-use-send-time-for-date)
>     maybe-file)
>       (setq date-time (nth 5 (file-attributes maybe-file))))
>     (feedmail-rfc822-date date-time)) )

And if you set the value of emacs-lisp-docstring-fill-column to 80,
the value of fill-column that, according to the OP, should have been
used instead, do you get a better-looking nonsense?

IOW, if indeed it makes no sense to apply normal plain text filling
rules to code, then why does it matter what is the value of
fill-column when code is being filled?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]