Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions latex2html.pl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
op(100, fx, #)
]).
:- use_module(library(debug),[debug/3]).
:- use_module(library(prolog_stack)). % For catch_with_backtrace
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ordering of this use_module seems to be important.

:- autoload(library(apply),[maplist/3]).
:- autoload(library(backcomp),[convert_time/8]).
:- autoload(library(ctypes),
Expand Down Expand Up @@ -3224,6 +3225,16 @@
:- initialization(main, main).

main(Argv) :-
catch_with_backtrace(main0(Argv),
Error,
( set_prolog_flag(backtrace_goal_depth, 20),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 set_prolog_flag calls didn't have the desired effect ... but I couldn't find another flag for setting the option for the write.

This is what I got when running from cmake:

ERROR: [2,630] tex:item_commands([_484|_486],[],[_490|_492]) at /home/peter/src/swipl-devel/build.debug/home/library/ext/ltx2htm/latex2html.pl:983
ERROR: [1,904] tex:items([\(classitem,...),'\n'|...],[[...|...]|_554]) at /home/peter/src/swipl-devel/build.debug/home/library/ext/ltx2htm/latex2html.pl:961
ERROR: [1,890] tex:env(description([],['\n'|...]),[html('<dl class="latex">'),_624|...]) at /home/peter/src/swipl-devel/build.debug/home/library/ext/ltx2htm/latex2html.pl:935

but when I ran it by hand (calling main0/1), and did the debugger u command, I got more useful information:

   Exception: (1,887) tex:translate_env(description([], ['\n', \(classitem, [{'PlTerm'}]), '\n', 'Generic', 'Prolog', term|...]), file, file, _353630) ? 

which helped me figure out where the bad markup was.

set_prolog_flag(debugger_write_options, [quoted(true), portray(true), max_depth(20), attributes(portray)]),
set_prolog_flag(answer_write_options, [quoted(true), portray(true), max_depth(200), attributes(portray)]),
print_message(error, Error),
halt(1)
)).

main0(Argv) :-
argv_options(Argv, Files, Options),
set_debugging(Options),
set_quiet(Options),
Expand Down