mirror of
https://gitlab.com/vindarel/ciel.git
synced 2026-03-18 12:31:32 -07:00
fix repl.lisp for CI?
This commit is contained in:
parent
9aea9a6ab7
commit
2ca812a9cc
1 changed files with 27 additions and 1 deletions
28
repl.lisp
28
repl.lisp
|
|
@ -506,7 +506,23 @@ strings to match candidates against (for example in the form \"package:sym\")."
|
|||
(format t "~&")
|
||||
(sbcli::sbcli "" *prompt*)))
|
||||
|
||||
(defun repl ()
|
||||
(defun edit-current-input (arg key)
|
||||
;; experimental, doesn't properly work.
|
||||
(declare (ignore arg key))
|
||||
(let ((filename "/tmp/ciel-temp.lisp")
|
||||
(current-input rl:*line-buffer*))
|
||||
(str:to-file filename current-input)
|
||||
(magic-ed filename)
|
||||
;; ... user writes...
|
||||
;; (NB: rl:replace-line preserves the point position and that's annoying)
|
||||
;; (setf rl:*line-buffer* (str:trim (str:from-file filename)))
|
||||
;; (rl:redisplay)
|
||||
;; (rl:delete-text 0 rl:+end+)
|
||||
(uiop:format! t "text is: ~a~&" (str:from-file filename))
|
||||
;; (rl:insert-text (str:concat "hello" (str:trim (str:from-file filename))))
|
||||
(setf rl:*line-buffer* (str:trim (str:from-file filename)))
|
||||
(rl:redisplay)
|
||||
))
|
||||
|
||||
(defun repl (&key noinform)
|
||||
"Toplevel REPL.
|
||||
|
|
@ -530,6 +546,16 @@ strings to match candidates against (for example in the form \"package:sym\")."
|
|||
(rl:register-function :complete #'custom-complete)
|
||||
(rl:register-function :redisplay #'syntax-hl)
|
||||
|
||||
;; testing…
|
||||
(defun print-some-text (arg key)
|
||||
(declare (ignore arg key))
|
||||
(rl:insert-text "inserted text"))
|
||||
|
||||
#+(or)
|
||||
(rl:bind-keyseq "\\C-o" #'print-some-text)
|
||||
(rl:bind-keyseq "\\C-x\\C-e" #'edit-current-input)
|
||||
(rl:set-paren-blink-timeout 500)
|
||||
|
||||
(if (probe-file *config-file*)
|
||||
(load *config-file*))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue