1/* Part of LogicMOO Base Logicmoo Debug Tools
    2% ===================================================================
    3% File 'with_no_x.pl'
    4% Purpose: An Implementation in SWI-Prolog of certain debugging tools
    5% Maintainer: Douglas Miles
    6% Contact: $Author: dmiles $@users.sourceforge.net ;
    7% Version: 'with_no_x.pl' 1.0.0
    8% Revision: $Revision: 1.1 $
    9% Revised At:  $Date: 2002/07/11 21:57:28 $
   10% Licience: LGPL
   11% ===================================================================
   12*/
   13% File: /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/util/logicmoo_util_with_assertions.pl
   14:- module(with_no_x,[ with_no_x/1]).   15:- meta_predicate with_no_x(0).   16
   17:- thread_local(tlbugger:show_must_go_on/1).   18
   19%:- use_module(library(gui_tracer)).
 with_no_x(:Goal) is nondet
Using No X.
   25with_no_x(G):- getenv('DISPLAY',DISP),!,call_cleanup((unsetenv('DISPLAY'),with_no_x(G)),setenv('DISPLAY',DISP)).
   26with_no_x(G):- current_prolog_flag(gui,true),!,call_cleanup((set_prolog_flag(gui,false),with_no_x(G)),set_prolog_flag(gui,true)).
   27with_no_x(G):- current_prolog_flag(gui_tracer,true),!,call_cleanup((set_prolog_flag(gui,false),with_no_x(G)),set_prolog_flag(gui,true)).
   28with_no_x(G):- locally_each(tlbugger:show_must_go_on,call(G))