[m-rev.] diff: fixes for the PDF versions of the documentation

Julien Fischer jfischer at opturion.com
Mon Jan 5 02:05:18 AEDT 2015


Fixes for the PDF versions of the documentation.

doc/reference_manual.texi:
 	Replaces tabs with spaces in some examples, otherwise the
 	indentation is getting lost in the PDF version.

 	Mark some examples as unsplittable in order to avoid them being
 	broken (awkwardly) across pages in the PDF verison.

 	Use @file instead of @samp where appropriate.

doc/user_guide.texi;
 	Use @file instead of @samp where appropriate.

Julien.

diff --git a/doc/reference_manual.texi b/doc/reference_manual.texi
index 5ef49be..44253ba 100644
--- a/doc/reference_manual.texi
+++ b/doc/reference_manual.texi
@@ -3476,21 +3476,23 @@ both inside the nested disjunction and before the nested disjunction.
  The following example is a switch on X, provided X is bound beforehand.

  @example
+ at group
  (
          X = f
-	p(Out)
+        p(Out)
  ;
-	Y = X,
+        Y = X,
          (
-		Y = g,
-		Intermediate = 42
-	;
-		Z = Y,
-		Z = h(Arg),
-		q(Arg, Intermediate)
-	),
-	r(Intermediate, Out)
+                Y = g,
+                Intermediate = 42
+        ;
+                Z = Y,
+                Z = h(Arg),
+                q(Arg, Intermediate)
+        ),
+        r(Intermediate, Out)
  )
+ at end group
  @end example

  @item Disjunctions
@@ -3555,6 +3557,7 @@ because it requires solving the halting problem.
  (For instance, in the following example

  @example
+ at group
  :- pred p(T, T).
  :- mode p(in, out) is det.

@@ -3564,6 +3567,7 @@ p(A, B) :-
          ;
                  B = A
          ).
+ at end group
  @end example

  @noindent
@@ -4071,10 +4075,12 @@ Similarly, given
  the following three unifications have the same effect:

  @example
+ at group
  X = (func(Num, List) = NewList :- NewList = scalar_product(Num, List))
  Y = (func(Num::in, List::in) = (NewList::out) is det
          :- NewList = scalar_product(Num, List))
  Z = scalar_product
+ at end group
  @end example

  In the above example, the type of @samp{X}, @samp{Y}, and @samp{Z} is
@@ -7362,12 +7368,14 @@ of the form:
  @var{CtorValues} is a list of pairs of the form:

  @example
+ at group
  [
      ctor_0 - "ForeignValue_0",
      ctor_1 - "ForeignValue_1",
      ...
      ctor_N - "ForeignValue_N"
  ]
+ at end group
  @end example

  The first element of each pair is a constructor of the type @var{MercuryType},
@@ -9694,10 +9702,10 @@ Each mode is indexed on all its input arguments so the compiler can
  produce very efficient code using this technique.

  In the current implementation, the table of facts is compiled into a
-separate C file named @samp{@var{FileName}.c}.  The compiler will
+separate C file named @file{@var{FileName}.c}.  The compiler will
  automatically generate the correct dependencies for this file when the
  command @samp{mmake @var{main_module}.depend} is invoked.  This ensures
-that the C file will be compiled to @samp{@var{FileName}.o} and then
+that the C file will be compiled to @file{@var{FileName}.o} and then
  linked with the other object files when @samp{mmake @var{main_module}}
  is invoked.

@@ -9994,7 +10002,7 @@ The following declaration calls for this variant of tabling.

  @example
  :- pragma memo(@var{Name}(in, in, in, out),
-	[allow_reset, statistics, fast_loose]).
+        [allow_reset, statistics, fast_loose]).
  @end example

  The @samp{specified} attribute allows programmers to choose
@@ -10004,7 +10012,7 @@ or whether it should be looked up at all:

  @example
  :- pragma memo(@var{Name}(in, in, in, out), [allow_reset, statistics,
-	specified([value, addr, promise_implied, output])]).
+        specified([value, addr, promise_implied, output])]).
  @end example

  The @samp{specified} attribute should have an argument which is a list,
@@ -10042,7 +10050,7 @@ then this declaration can also be specified without giving the argument modes:

  @example
  :- pragma memo(@var{Name}/@var{Arity}, [allow_reset, statistics,
-	specified([value, addr, promise_implied, output])]).
+        specified([value, addr, promise_implied, output])]).
  @end example

  Note that a @samp{pragma minimal_model} declaration
@@ -10528,7 +10536,7 @@ check for floundering in the @samp{MR_commit} and @samp{MR_solve} cases
  of your function.
  The Mercury extras distribution includes an example of this:
  see the @samp{ML_var_untrail_func()} function in the file
- at samp{extras/trailed_update/var.m}.)
+ at file{extras/trailed_update/var.m}.)
  If your function does detect floundering, then it should print
  an error message and then abort execution.

diff --git a/doc/user_guide.texi b/doc/user_guide.texi
index b69b30d..deb7e70 100644
--- a/doc/user_guide.texi
+++ b/doc/user_guide.texi
@@ -517,7 +517,7 @@ and therefore you must run @samp{mmake @var{program}.depend}
  for each program.  The @samp{Mercury.modules} file is used for
  all programs in the directory.

-If there is a file called @samp{Mmake} or @samp{Mmakefile} in the
+If there is a file called @file{Mmake} or @file{Mmakefile} in the
  current directory,
  Mmake will include that file in its automatically generated Makefile.
  The @samp{Mmake} file can override the default values of
@@ -2048,10 +2048,10 @@ since in that case, that usual online documentation will not be available.
  @item
  @cindex mdbrc
  @cindex .mdbrc
-The file named @samp{.mdbrc} in your home directory.
+The file named @file{.mdbrc} in your home directory.
  You can put your usual aliases and settings here.
  @item
-The file named @samp{.mdbrc} in the current working directory.
+The file named @file{.mdbrc} in the current working directory.
  You can put program-specific aliases and settings here.
  @end enumerate
  mdb will ignore any lines starting with the character #
@@ -6138,7 +6138,7 @@ so are safe to leave in the program.

  Next, build the program in a @samp{.memprof.gc} grade.
  After the program has finished executing, it will generate a file
-called @samp{Prof.Snapshots} in the current directory.
+called @file{Prof.Snapshots} in the current directory.
  Run @samp{mprof -s} to view the profile.
  You will see the memory cells which were on the heap at each time
  that @samp{report_memory_attribution} was called: the origin of the cells, and
@@ -10944,7 +10944,7 @@ int mercury_terminate(void);

  Shut down the Mercury runtime.
  The value returned by this function is Mercury's exit status
-(as set by the predicate io.set_exit_status/3).
+(as set by the predicate @samp{io.set_exit_status/3}).
  This function will also invoke any finalisers contained in the set
  of libraries for which the stand-alone interface was generated.
  @end table







More information about the reviews mailing list