summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2024-04-24 11:45:31 +0800
committerPo Lu <luangruo@yahoo.com>2024-04-24 11:45:31 +0800
commit145a77808ebd36fffb2e9c0376f821f09733d045 (patch)
treeebef831b8e15118d628dd7560aca34fd3a9a73e7 /test
parentd3d1be8ae56efe29e4a721c5dd4e1fa973cf9d5a (diff)
downloademacs-145a77808ebd36fffb2e9c0376f821f09733d045.tar.gz
More effectually prevent defun list wrapping in C-x C-w
* lisp/vc/log-edit.el (log-edit-fill-entry): Match and replace with NBSPs the opening defun list also. * test/lisp/vc/log-edit-tests.el (log-edit-fill-entry-no-defun-list-wrapping): New test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/vc/log-edit-tests.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/vc/log-edit-tests.el b/test/lisp/vc/log-edit-tests.el
index 8373156587d..db60d21f137 100644
--- a/test/lisp/vc/log-edit-tests.el
+++ b/test/lisp/vc/log-edit-tests.el
@@ -344,4 +344,22 @@ next line instead.")
(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