I am trying to use `counsel-fzf` in a way where I would like to get the input of the user when the search for a filename was unsuccesful. Reviewing the code for `ivy-read` and `counsel-fzf`, I have no clue where to start.
So my workaround is this:
(let* ((result (ivy-read "Search or enter new page name: "
#'counsel-fzf-function
:re-builder #'ivy--regex-fuzzy
:dynamic-collection t))
(page-name (if (or
(string= result "Nothing found")
(string= result "error code 1"))
;;
;; This here is redundant as I have typed it in `ivy-read` anyway
(read-string "Enter new page name: ")
(file-name-sans-extension
(file-name-nondirectory result))))
(page-filename (replace-regexp-in-string "[ ]+" "-" page-name)))
(list result page-name page-filename))
I try to read via `ivy-read`, if it finds nothing, I let the user type his initial search again via `(read-string "Enter new page name: ")`. This is not user friendly.
So I would like to know: Is there a way to get the input in the first step via `ivy-read`?
## Edit
Or to put it this way:
How can I get the user input if `completing-read` has no match?