. $GRIMOIRE/config_query_multi.function

config_query_list W3M_TERM_LIB                        \
               "Which terminal library do you want?"  \
               ncurses                                \
               termcap                                &&
config_query_multi W3M_INLINE_IMAGE                   \
                  "Enable inline image handlers"      \
                  AUTO                                \
		  NONE                                \
                  x11                                 \
                  fb                                  \
                  fb+s                                &&

if ! list_find "$W3M_INLINE_IMAGE" "NONE" ; then
  config_query_list W3M_IMAGE_LIB                     \
                  "Which image library do you want?"  \
                  imlib2                              \
                  imlib                               \
                  gtk2                                \
                  gdk-pixbuf
fi                                                    &&

config_query_string W3M_EDITOR                        \
                    "Default editor command"          \
                    "$EDITOR"                         &&
config_query_list W3M_KEYMAP                          \
                  "Which keymap do you want?"         \
                  w3m                                 \
                  lynx                                &&
config_query_option W3M_OPTS                          \
                    "Enable multilingualisation (m17n)?" \
                    y                                 \
                    "--enable-m17n"                   \
                    "--disable-m17n"                  &&

if $(echo "$W3M_OPTS" | grep -q -- "--enable-m17n")
then
  config_query_option W3M_OPTS                        \
                    "Enable unicode?"                 \
                    y                                 \
                    "--enable-unicode"                \
                    "--disable-unicode"
fi &&

config_query_option W3M_OPTS                          \
                    "Enable NLS?"                     \
                    y                                 \
                    "--enable-nls"                    \
                    "--disable-nls"                   &&
config_query_option W3M_OPTS                          \
                    "Enable color?"                   \
                    y                                 \
                    "--enable-color"                  \
                    "--disable-color"                 &&

if $(echo "$W3M_OPTS" | grep -q -- "--enable-color")
then
  config_query_option W3M_OPTS                        \
                    "Enable ansi-color?"              \
                    y                                 \
                    "--enable-ansi-color"             \
                    "--disable-ansi-color"            &&
  config_query_option W3M_OPTS                        \
                    "Enable background color?"        \
                    y                                 \
                    "--enable-bgcolor"                \
                    "--disable-bgcolor"
fi &&

config_query_option W3M_OPTS                          \
                    "Enable popup menu?"              \
                    y                                 \
                    "--enable-menu"                   \
                    "--disable-menu"                  &&
config_query_option W3M_OPTS                          \
                    "Enable mouse support?"           \
                    y                                 \
                    "--enable-mouse"                  \
                    "--disable-mouse"                 &&
config_query_option W3M_OPTS                          \
                    "Enable URL history?"             \
                    y                                 \
                    "--enable-history"                \
                    "--disable-history"               &&
config_query_option W3M_OPTS                          \
                    "Enable alarm?"                   \
                    y                                 \
                    "--enable-alarm"                  \
                    "--disable-alarm"                 &&
config_query_option W3M_OPTS                          \
                    "Enable cookies?"                 \
                    y                                 \
                    "--enable-cookie"                 \
                    "--disable-cookie"                &&
config_query_option W3M_OPTS                          \
                    "Enable NNTP?"                    \
                    y                                 \
                    "--enable-nntp"                   \
                    "--disable-nntp"                  &&
config_query_option W3M_OPTS                          \
                    "Enable gopher?"                  \
                    n                                 \
                    "--enable-gopher"                 \
                    "--disable-gopher"                &&
config_query_option W3M_OPTS                          \
                    "Enable dict?"                    \
                    y                                 \
                    "--enable-dict"                   \
                    "--disable-dict"                  &&
config_query_option W3M_OPTS                          \
                    "Enable help cgi?"                \
                    y                                 \
                    "--enable-help-cgi"               \
                    "--disable-help-cgi"              &&
config_query_option W3M_OPTS                          \
                    "Enable external URI loader?"     \
                    y                                 \
                    "--enable-external-uri-loader"    \
                    "--disable-external-uri-loader"   &&

if $(echo "$W3M_OPTS" | grep -q -- "--enable-external-uri-loader")
then
  config_query_option W3M_OPTS                        \
                    "Enable w3mmailer?"               \
                    y                                 \
                    "--enable-w3mmailer"              \
                    "--disable-w3mmailer"
fi &&

config_query_option W3M_OPTS                          \
                    "Enable IPv6?"                    \
                    y                                 \
                    "--enable-ipv6"                   \
                    "--disable-ipv6"                  &&
config_query_option W3M_OPTS                          \
                    "Verify SSL certificates?"        \
                    y                                 \
                    "--enable-sslverify"              \
                    "--disable-sslverify"             &&
config_query_option W3M_OPTS                          \
                    "Enable digest auth?"             \
                    y                                 \
                    "--enable-digest-auth"            \
                    "--disable-digest-auth"

