What is this ? "! No such event "

I have met following error or warning in Emacs with ediprolog mode. What is this ? Is it related to something command line history on shell “!” ?

% ?- current_op(X, Y, !).
%@ X = 10,
%@ Y = fy.
% ?- write_canonical(a + !a).
%@ ! No such event

I have not seen this trouble as far as on terminal. Any hint
on fixing this case is appreciated. Thanks.

Totally unrelated :slight_smile: This is toplevel command line history similar to the shell. See SWI-Prolog -- Manual

Thanks. I found a workaround: put a space after the prefix ‘!’. It is a little bit strange for me that as I said there is no problem when using terminal. The problem occurs only when in emacs (with ediprolog mode.) I have made a search in the source of ediprolog.pl but found nothing related to history.

% ?- current_op(X, Y, !).

%@ X = 10,
%@ Y = fy.

% ?- X = (! a).
%@ X = !(a).

% ?- X = !a.
%@ ! No such event

EDIT.
I found current_prolog_flag(history, X) returns X = 0
in terminal, but X=25 in Emacs Prolog. I tried set_prolog_flag(history, 0) for the latter. It seems OK as the other operators works. Thanks again.