anchor.diff:  (define-command !prompt () ()
     (message "~A"
              (!prompt-for-line "hello: "
  -                             "cxxxr"
  -                             lem::*minibuffer-buffer-complete-function*
  +                             ""
  +                             nil
  +                             nil
  +                             #+(or)
                                (lambda (name)
                                  (member name (buffer-list) :test #'string= :key #'buffer-name))
                                nil)))
  
positive.code:                 :when-let))
  (in-package :lem.prompt-window)
  
  (define-condition execute ()
    ((input
      :initarg :input
  
negative.code:     (character-offset (copy-point (buffer-start-point buffer) :temporary)
                        (prompt-window-start-charpos prompt-window))))
  
  (defun current-point-in-prompt ()
    (buffer-point (window-buffer (current-prompt-window))))
  
  (defun get-between-input-points ()
    (list (prompt-window-start-point (current-prompt-window))
          (buffer-end-point (window-buffer (current-prompt-window)))))
  
  (defun get-prompt-string ()
    (apply #'points-to-string (get-between-input-points)))
  
  (defun replace-prompt-input (input)
    (apply #'delete-between-points (get-between-input-points))
    (insert-string (current-point-in-prompt) input))
  
  (define-command prompt-execute () ()
    (let ((input (get-prompt-string)))
      (when (or (zerop (length input))
                (null (completion-window-existing-test-function (current-prompt-window)))
                (funcall (completion-window-existing-test-function (current-prompt-window)) input))
        (lem.history:add-history (prompt-window-history (current-prompt-window)) input)
        (error 'execute :input input))))
  
  (define-command prompt-completion () ()
    (when (prompt-window-completion-function (current-prompt-window))
      (with-point ((start (prompt-window-start-point (current-prompt-window))))
        (funcall 'lem.completion-mode::minibuffer-completion
                 (prompt-window-completion-function (current-prompt-window))
                 start))))
  
  (defun replace-if-history-exists (next-history-fn)
    (multiple-value-bind (string exists-p)
        (funcall next-history-fn
                 (prompt-window-history (current-prompt-window)))
      (when exists-p
        (replace-prompt-input string))))
  
  (define-command prompt-previous-history () ()
    (let ((history (prompt-window-history (current-prompt-window))))
      (lem.history:backup-edit-string history (get-prompt-string))
      (replace-if-history-exists #'lem.history:prev-history)))
  
  (define-command prompt-next-history () ()
    (let ((history (prompt-window-history (current-prompt-window))))
      (lem.history:backup-edit-string history (get-prompt-string))
      (or (replace-if-history-exists #'lem.history:next-history)
          (replace-if-history-exists #'lem.history:restore-edit-string))))
  
  (define-command prompt-abort () ()
    (error 'abort-prompt))
  