From: Cyrill Schenkel <cyrill.schenkel@gmail.com>
To: Guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] guix: Fix handling of periods by fill-paragraph.
Date: Sun, 27 Jul 2014 00:06:54 +0200 [thread overview]
Message-ID: <CAKYJt_wXHqD26fyK82nrHfduEbNyyNb4pbQ4rG1Zmhngg8E3cw@mail.gmail.com> (raw)
In-Reply-To: <8738dndbkr.fsf@SIRIUS09.i-did-not-set--mail-host-address--so-tickle-me>
[-- Attachment #1: Type: text/plain, Size: 98 bytes --]
Hi.
There was invalidly indented code in my previously sent patch.
So here's an updated version.
[-- Attachment #2: 0001-guix-Fix-handling-of-periods-by-fill-paragraph.patch --]
[-- Type: text/x-patch, Size: 1735 bytes --]
From 2dc0cb0eaafbcfce062f4d0acbc7e5cad200bfbf Mon Sep 17 00:00:00 2001
From: Cyrill Schenkel <cyrill.schenkel@gmail.com>
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
next prev parent reply other threads:[~2014-07-26 22:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-26 22:01 [PATCH] guix: Fix handling of periods by fill-paragraph Cyrill Schenkel
2014-07-26 22:06 ` Cyrill Schenkel [this message]
2014-07-26 22:13 ` Ludovic Courtès
2014-07-26 22:59 ` Cyrill Schenkel
2014-08-11 16:37 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKYJt_wXHqD26fyK82nrHfduEbNyyNb4pbQ4rG1Zmhngg8E3cw@mail.gmail.com \
--to=cyrill.schenkel@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).