1 ### vim:ft=zsh:foldmethod=marker
3 ## Copyright: 2009, Frank Terbeck <ft@bewatermyfriend.org>
5 LOOKUP_guard || return 1
6 local old_lookup_ei qh qh_return ret
9 zstyle -t "${lookup_context}" debug &&
10 printf 'LOOKUP_query_handler: current context: "%s"\n' "${lookup_context}"
12 (( lookup_use_qh == 0 )) && return 0
13 zstyle -a "${lookup_context}" query-handlers qhs || return 0
16 old_lookup_ei=${lookup_ei}
17 lookup_ei='-queryhandler-'
19 if (( ${+functions[LOOKUP_qh_$qh]} == 0 )) ; then
20 printf 'query-handler %s requires this function: %s\n' "${qa}" "LOOKUP_qh_${qh}"
21 printf 'Hit any key to continue...\n'
24 if [[ ${lookup_qh_arg-wasunset} == 'wasunset' ]] ; then
28 LOOKUP_qh_${qh} ${lookup_qh_arg}
35 (2) # clear QUERY and stop processing
39 (3) # clear QUERY and stop processing and return 1
40 # which means, the backends are supposed to return 1, too.
41 # thus, no browser will be called.
51 lookup_ei=${old_lookup_ei}