(save-excursion
(goto-char beg)
(when (re-search-forward
- "^[[:blank:]]*(.*\\([[:space:]]\\).*):"
+ ;; Also replace spaces within defun lists
+ ;; prefixed by a file name so that
+ ;; fill-region never attempts to break
+ ;; them, even if multiple items combine
+ ;; with symbols to exceed the fill column
+ ;; by the expressly permitted margin of 1
+ ;; character.
+ (concat "^\\([[:blank:]]*\\|\\* .*[[:blank:]]"
+ "\\)(.*\\([[:space:]]\\).*):")
end t)
(replace-regexp-in-region "[[:space:]]" " "
(setq space-beg
(let ((fill-column 20)) (log-edit-fill-entry))
(should (equal (buffer-string) wanted)))))
+(ert-deftest log-edit-fill-entry-no-defun-list-wrapping ()
+ ;; This test verifies that the opening defun list of an entry is never
+ ;; broken, even in the event its length in total exceeds the fill
+ ;; column.
+ (let (string wanted)
+ (setq string "
+* src/androidfns.c (Fxw_display_color_p):
+(Fx_display_grayscale_p): Report color and/or grayscale properly.
+"
+ wanted "
+* src/androidfns.c (Fxw_display_color_p, Fx_display_grayscale_p):
+Report color and/or grayscale properly.
+")
+ (with-temp-buffer
+ (insert string)
+ (let ((fill-column 64)) (log-edit-fill-entry))
+ (should (equal (buffer-string) wanted)))))
+
;;; log-edit-tests.el ends here