Archived
1
0
Fork 0

installer: Makes sure the installer proceeds after hitting "Edit".

Fixes <https://bugs.gnu.org/39199>.
Reported by Jonathan Brielmaier <jonathan.brielmaier@web.de>.

* gnu/installer/newt/page.scm (run-file-textbox-page): Move 'loop' to
the beginning of the body.  Do not call 'loop' from the 'dynamic-wind'
exit handler as we would not return the value of the second call to
'loop'.
This commit is contained in:
Ludovic Courtès 2020-01-20 14:34:16 +01:00
parent 25623647e9
commit 48659aa221
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -566,35 +566,38 @@ ITEMS when 'Ok' is pressed."
(const #t)) (const #t))
(exit-button-callback-procedure (exit-button-callback-procedure
(const #t))) (const #t)))
(let* ((info-textbox (let loop ()
(make-reflowed-textbox -1 -1 info-text (let* ((info-textbox
info-textbox-width (make-reflowed-textbox -1 -1 info-text
#:flags FLAG-BORDER)) info-textbox-width
(file-textbox #:flags FLAG-BORDER))
(make-textbox -1 -1 (file-textbox
file-textbox-width (make-textbox -1 -1
file-textbox-height file-textbox-width
(logior FLAG-SCROLL FLAG-BORDER))) file-textbox-height
(ok-button (make-button -1 -1 (G_ "OK"))) (logior FLAG-SCROLL FLAG-BORDER)))
(exit-button (make-button -1 -1 (G_ "Exit"))) (ok-button (make-button -1 -1 (G_ "OK")))
(edit-button (and edit-button? (exit-button (make-button -1 -1 (G_ "Exit")))
(make-button -1 -1 (G_ "Edit")))) (edit-button (and edit-button?
(grid (vertically-stacked-grid (make-button -1 -1 (G_ "Edit"))))
GRID-ELEMENT-COMPONENT info-textbox (grid (vertically-stacked-grid
GRID-ELEMENT-COMPONENT file-textbox GRID-ELEMENT-COMPONENT info-textbox
GRID-ELEMENT-SUBGRID GRID-ELEMENT-COMPONENT file-textbox
(apply GRID-ELEMENT-SUBGRID
horizontal-stacked-grid (apply
GRID-ELEMENT-COMPONENT ok-button horizontal-stacked-grid
`(,@(if edit-button? GRID-ELEMENT-COMPONENT ok-button
(list GRID-ELEMENT-COMPONENT edit-button) `(,@(if edit-button?
'()) (list GRID-ELEMENT-COMPONENT edit-button)
,@(if exit-button? '())
(list GRID-ELEMENT-COMPONENT exit-button) ,@(if exit-button?
'()))))) (list GRID-ELEMENT-COMPONENT exit-button)
(form (make-form))) '())))))
(form (make-form)))
(add-form-to-grid grid form #t)
(make-wrapped-grid-window grid title)
(let loop ()
(set-textbox-text file-textbox (set-textbox-text file-textbox
(receive (_w _h text) (receive (_w _h text)
(reflow-text (read-all file) (reflow-text (read-all file)
@ -602,26 +605,26 @@ ITEMS when 'Ok' is pressed."
0 0) 0 0)
text)) text))
(add-form-to-grid grid form #t)
(make-wrapped-grid-window grid title)
(receive (exit-reason argument) (receive (exit-reason argument)
(run-form form) (run-form form)
(dynamic-wind (define result
(const #t) (dynamic-wind
(lambda () (const #t)
(case exit-reason (lambda ()
((exit-component) (case exit-reason
(cond ((exit-component)
((components=? argument ok-button) (cond
(ok-button-callback-procedure)) ((components=? argument ok-button)
((and exit-button? (ok-button-callback-procedure))
(components=? argument exit-button)) ((and exit-button?
(exit-button-callback-procedure)) (components=? argument exit-button))
((and edit-button? (exit-button-callback-procedure))
(components=? argument edit-button)) ((and edit-button?
(edit-file file)))))) (components=? argument edit-button))
(lambda () (edit-file file))))))
(if (components=? argument edit-button) (lambda ()
(loop) (destroy-form-and-pop form))))
(destroy-form-and-pop form))))))))
(if (components=? argument edit-button)
(loop) ;recurse in tail position
result)))))