[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix fill-flowed for large or nil values of fill-flowed-display-column
From: |
Matthias Schmitt |
Subject: |
Fix fill-flowed for large or nil values of fill-flowed-display-column |
Date: |
Thu, 27 Jan 2022 12:13:58 +0000 |
Hi,
`fill-flowed` currently does not work correctly when the variable
`fill-flowed-display-column` is large or nil (no hard line breaks
e.g. when using `visual-fill-column-mode`).
The origin of this behavior is that if `fill-region` does not
break the current line but the current line should be merged with
the next line moving a line forward is an error.
This patch is a rather dirty fix that checks if the current line
should be merged with the following line (ending in SPC CRLF)
before moving over it.
This is my first contribution to Emacs and the mailing list and I
am happy to be a small part of the development of Emacs :)
Cheers,
Matthias
diff -u --label \#\<buffer\ flow-fill.el.gz\> --label \#\<buffer\
flow-fill.buffer\> /tmp/buffer-content-nY7QFh
/tmp/buffer-content-zqOgJ3
--- #<buffer flow-fill.el.gz>
+++ #<buffer flow-fill.buffer>
@@ -157,11 +157,12 @@
(delete-char -1))
(delete-char 1)
(ignore-errors
- (let ((fill-prefix ""))
- (fill-region (line-beginning-position)
- (line-end-position)
- 'left 'nosqueeze))))))
- (forward-line 1)))))
+ (let ((fill-prefix ""))
+ (fill-region (line-beginning-position)
+ (line-end-position)
+ 'left 'nosqueeze))))))
+ (unless (eq (char-before (line-end-position)) ?\s)
+ (forward-line 1))))))
(make-obsolete-variable 'fill-flowed-encode-tests nil "27.1")
(defvar fill-flowed-encode-tests)
Diff finished. Thu Jan 27 13:06:47 2022
- Fix fill-flowed for large or nil values of fill-flowed-display-column,
Matthias Schmitt <=