[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
142/197: gurses: xchar->char: New procedure.
From: |
Danny Milosavljevic |
Subject: |
142/197: gurses: xchar->char: New procedure. |
Date: |
Mon, 3 Jul 2017 20:37:15 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 7bd8cbd515909699803f90e87587ec22061da52a
Author: John Darrington <address@hidden>
Date: Fri Jan 27 08:47:36 2017 +0100
gurses: xchar->char: New procedure.
* gurses/stexi.scm (xchar->char): New procedure.
---
gurses/stexi.scm | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/gurses/stexi.scm b/gurses/stexi.scm
index b49ff4d..2f04e7e 100644
--- a/gurses/stexi.scm
+++ b/gurses/stexi.scm
@@ -101,6 +101,10 @@ described by the stexi STXI"
(loop (cdr in)
(parse-fragment (car in) acc normal))))))))
+
+(define (xchar->char ch)
+ (car (xchar-chars ch)))
+
(define (offset-to-end-of-word ccs)
"Return the number of xchars until the end of the current word."
@@ -109,14 +113,14 @@ described by the stexi STXI"
cs
('() dist)
(((? xchar? first) . rest)
- (if (char-set-contains? char-set:blank (car (xchar-chars first)))
+ (if (char-set-contains? char-set:blank (xchar->char first))
dist
(offset-to-end-of-word' rest (1+ dist))))))
(offset-to-end-of-word' ccs 0))
(define (remove-leading-whitespace cs)
- (if (char-set-contains? char-set:blank (car (xchar-chars (car cs))))
+ (if (char-set-contains? char-set:blank (xchar->char (car cs)))
(cdr cs)
cs))
@@ -160,7 +164,7 @@ string of length LEN"
(if (null? in)
n
(let ((white (char-set-contains? char-set:blank
- (car (xchar-chars (car in))))))
+ (xchar->char (car in)))))
(loop (cdr in) (1+ x) (if (and prev-white (not white))
(1+ n)
n) white)))))
@@ -179,7 +183,7 @@ string of length LEN"
"You asked to pad to ~a but the string is already ~a
characters long."
len (length str))))
- (if (eqv? (car (xchar-chars (last str))) #\newline)
+ (if (eqv? (xchar->char (last str)) #\newline)
str ; Don't justify the last line of a paragraph
(let loop ((in str)
(out '())
@@ -189,7 +193,7 @@ string of length LEN"
(if (null? in)
(reverse out)
(let* ((white (char-set-contains? char-set:blank
- (car (xchar-chars (car
in)))))
+ (xchar->char (car in))))
(end-of-word (and white (not prev-white)))
(words-processed (if end-of-word (1+ words) words))
(spaces-inserted (if end-of-word
- 182/197: installer: Kill old dhclient instance before starting new one., (continued)
- 182/197: installer: Kill old dhclient instance before starting new one., Danny Milosavljevic, 2017/07/03
- 189/197: installer: Fix buglet where keys were sometimes ignored in users page., Danny Milosavljevic, 2017/07/03
- 179/197: installer: Mount all partitions instead of just the root., Danny Milosavljevic, 2017/07/03
- 190/197: gurses: forms: Minor refactor., Danny Milosavljevic, 2017/07/03
- 194/197: guix system: Remove outdated (gnu system grub) import., Danny Milosavljevic, 2017/07/03
- 197/197: installer: Use "G_" instead of "_"., Danny Milosavljevic, 2017/07/03
- 188/197: installer: Go back to main menu after "cancel", Danny Milosavljevic, 2017/07/03
- 184/197: installer: Create dedicated module to maintainer the page stack., Danny Milosavljevic, 2017/07/03
- 126/197: installer: mount-points page: Enlarge the forms window., Danny Milosavljevic, 2017/07/03
- 96/197: installer: Changed N_ to M_ since N_ is used for another purpose in guix/ui.scm, Danny Milosavljevic, 2017/07/03
- 142/197: gurses: xchar->char: New procedure.,
Danny Milosavljevic <=
- 85/197: installer: Use "lspci -mm" instead of "lspci -m"., Danny Milosavljevic, 2017/07/03
- 88/197: installer: Use a cleaner method of detecting wireless capability for ethernet interfaces., Danny Milosavljevic, 2017/07/03
- 93/197: installer: Add a dedicated make to format filesystems., Danny Milosavljevic, 2017/07/03
- 100/197: installer: Do not perform tasks more than once., Danny Milosavljevic, 2017/07/03
- 106/197: installer: Properly handle swap partitions when generating the configuration., Danny Milosavljevic, 2017/07/03
- 114/197: installer: Check that swap spaces have not been assigned mount points, Danny Milosavljevic, 2017/07/03
- 112/197: gurses: form: Use match instead of car, cdr etc., Danny Milosavljevic, 2017/07/03
- 125/197: installer: Do not assume the root file system is of type "ext4"., Danny Milosavljevic, 2017/07/03
- 130/197: installer: Delete unused procedure "justify"., Danny Milosavljevic, 2017/07/03
- 134/197: installer: Tolerate an undefined system role in config generation., Danny Milosavljevic, 2017/07/03