From 2dc0cb0eaafbcfce062f4d0acbc7e5cad200bfbf Mon Sep 17 00:00:00 2001 From: Cyrill Schenkel Date: Sun, 27 Jul 2014 00:03:16 +0200 Subject: [PATCH] guix: Fix handling of periods by fill-paragraph. * guix/ui.scm (fill-paragraph): Two spaces after period and no spaces before newline. --- guix/ui.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 9112d55..74d227d 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -395,7 +395,9 @@ converted to a space; sequences of more than one line break are preserved." (else (let ((chars (case newlines ((0) chars) - ((1) (cons #\space chars)) + ((1) + (append (make-list (if (eqv? (car chars) #\.) 2 1) + #\space) chars)) (else (append (make-list newlines #\newline) chars)))) (column (case newlines @@ -414,7 +416,10 @@ converted to a space; sequences of more than one line break are preserved." 0 ,(if (null? after) before - (append before (cons #\newline (cdr after))))) + (append before + (cons #\newline + (drop-while (cut eqv? #\space <>) + after))))) `(,column 0 ,chars))) ; unbreakable `(,column 0 ,chars))))))))) -- 2.0.0