config_query_list  NANO_CONFIG                                                \
       "Use standard compile time features, enable all or choose from list?"  \
                   "standard" "all" "choose"                                  &&
if [[ "${NANO_CONFIG}" == "all" ]]; then
  persistent_add NANO_OPTS &&
  local NANO_OPTS="--enable-all"
elif [[ "${NANO_CONFIG}" == "choose" ]] ; then
config_query_option  NANO_OPTS  "Enable support for large files?"  y          \
                     "--enable-largefile"  "--disable-largefile"              &&
config_query_option  NANO_OPTS  "Enable National Language support?"  y        \
                     "--enable-nls"  "--disable-nls"                          &&
config_query_option  NANO_OPTS  "Enable mini file-browser?"  y                \
                     "--enable-browser"  "--disable-browser"                  &&
config_query_option  NANO_OPTS  "Enable help function?"  y                    \
                     "--enable-help"  "--disable-help"                        &&
config_query_option  NANO_OPTS  "Enable justify/unjustify function?"  y       \
                     "--enable-justify"  "--disable-justify"                  &&
config_query_option  NANO_OPTS  "Enable mouse function?"  y                   \
                     "--enable-mouse"  "--disable-mouse"                      &&
config_query_option  NANO_OPTS  "Enable setting of working directory?"  y     \
                     "--enable-operatingdir"  "--disable-operatingdir"        &&
config_query_option  NANO_OPTS  "Enable spell checker function?"  y           \
                     "--enable-speller"  "--disable-speller"                  &&
config_query_option  NANO_OPTS  "Enable tab-completion?"  y                   \
                     "--enable-tabcomp"  "--disable-tabcomp"                  &&
config_query_option  NANO_OPTS  "Enable text wrapping?"  y                    \
                     "--enable-wrapping"  "--disable-wrapping"                &&
config_query_option  NANO_OPTS  "Enable color and syntax highlighting?"  y    \
                     "--enable-color"  "--disable-color"                      &&
config_query_option  NANO_OPTS  "Enable multiple file buffers?"  y            \
                     "--enable-multibuffer"  "--disable-multibuffer"          &&
config_query_option  NANO_OPTS  "Enable use of .nanorc file?"  y              \
                     "--enable-nanorc"  "--disable-nanorc"                    &&
config_query_option  NANO_OPTS  "Enable UTF-8 support?"  y                    \
                     "--enable-utf8"  "--disable-utf8"
fi                                                                            &&

if [[ "${NANO_CONFIG}" == "all" ]] || ( list_find "$NANO_OPTS" "--enable-color" && list_find "$NANO_OPTS" "--enable-nanorc" )
then
  config_query NANO_PROVIDED_CONFIG "Do you want to install one of the available system-wide nanorc config files" n
fi                                                                                &&

if [[ "$NANO_PROVIDED_CONFIG" == "y" ]]; then
  local NANO_AVAILABLE_CONFIG                                                     &&
  NANO_AVAILABLE_CONFIG="$(ls -1 $SCRIPT_DIRECTORY/spell-config/ | tr "\n" " ")"  &&
  NANO_AVAILABLE_CONFIG="nanorc-sample $NANO_AVAILABLE_CONFIG"                    &&
  config_query_list NANO_SELECTED_CONFIG "Which config do you want to choose" $NANO_AVAILABLE_CONFIG
fi
