[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
190/197: gurses: forms: Minor refactor.
From: |
Danny Milosavljevic |
Subject: |
190/197: gurses: forms: Minor refactor. |
Date: |
Mon, 3 Jul 2017 20:37:23 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit b0e21523e77a805459a00d4d74c47e0a31cb6bb2
Author: John Darrington <address@hidden>
Date: Tue Feb 21 08:45:50 2017 +0100
gurses: forms: Minor refactor.
* gurses/form.scm (form-enter): Add some more local symbols and use
them.
---
gurses/form.scm | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/gurses/form.scm b/gurses/form.scm
index c4adb3b..55c583f 100644
--- a/gurses/form.scm
+++ b/gurses/form.scm
@@ -158,15 +158,14 @@ label eq? to N"
(form-update-cursor form))
(if (form-enabled? form)
- (let* ((f (array-ref (form-items form) (form-current-item form)))
- (left (substring (field-value f) 0 (field-cursor-position f)))
- (centre (substring (field-value f) (field-cursor-position f)
- (min (1+ (field-cursor-position f))
- (string-length (field-value f)))))
- (right (substring (field-value f)
- (min (1+ (field-cursor-position f))
- (string-length (field-value f)))
- (string-length (field-value f)))))
+ (let* ((f (array-ref (form-items form) (form-current-item form)))
+ (value (field-value f))
+ (len (string-length value))
+ (pos (field-cursor-position f))
+ (left (substring value 0 pos))
+ (centre (substring value pos (min (1+ pos) len)))
+ (right (substring value (min (1+ pos) len) len)))
+
(cond ((and (char? ch)
(not (char-set-contains? char-set:iso-control ch)))
@@ -181,7 +180,7 @@ label eq? to N"
(field-set-value! f (string-append left right))
(redraw-current-field form f)
(form-update-cursor form))
-
+
((eq? ch KEY_BACKSPACE)
(if (positive? (field-cursor-position f))
(begin
- 139/197: installer: Allow file system specifications to be removed., (continued)
- 139/197: installer: Allow file system specifications to be removed., Danny Milosavljevic, 2017/07/03
- 136/197: installer: No passphrase is needed for clear networks., Danny Milosavljevic, 2017/07/03
- 138/197: installer: Clear the mount point field for swap file systems., Danny Milosavljevic, 2017/07/03
- 135/197: installer: Use a "hard" method of rebooting. Do not rely on shepherd., Danny Milosavljevic, 2017/07/03
- 148/197: installer: Support WEP encrypted wireless., Danny Milosavljevic, 2017/07/03
- 176/197: installer: Fix incorrect symbol in generated config file., Danny Milosavljevic, 2017/07/03
- 177/197: installer: Remove non-existant supplementary group., Danny Milosavljevic, 2017/07/03
- 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 <=
- 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, 2017/07/03
- 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