[latexila] PostProcessorLatexmk: hide command line detail



commit 6a01182743bd83b14952e2bc92cd0265928d4bd9
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Sep 30 15:49:18 2014 +0200

    PostProcessorLatexmk: hide command line detail

 src/liblatexila/latexila-post-processor-latexmk.c |   22 +++++++++++++++-----
 1 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/src/liblatexila/latexila-post-processor-latexmk.c 
b/src/liblatexila/latexila-post-processor-latexmk.c
index 580728b..afee449 100644
--- a/src/liblatexila/latexila-post-processor-latexmk.c
+++ b/src/liblatexila/latexila-post-processor-latexmk.c
@@ -70,8 +70,15 @@ struct _LatexilaPostProcessorLatexmkPrivate
   /* Number of separators encountered for the current state. */
   gint separator_count;
 
+  /* We run the 'latex' post-processor only on the last latex or pdflatex rule.
+   * The first latex rules most probably have warnings that are fixed in the
+   * last latex rule.
+   * @last_latex_sub_command and @last_latex_messages are simple pointers inside
+   * @messages, so don't free them.
+   */
   LatexilaBuildMsg *last_latex_sub_command;
   GQueue *last_latex_lines;
+  GList *last_latex_messages;
 
   GFile *file;
 
@@ -531,10 +538,15 @@ run_latex_post_processor (LatexilaPostProcessorLatexmk *pp)
   latexila_post_processor_end (pp_latex);
 
   msg = pp->priv->last_latex_sub_command;
+
+  /* The initial children contain the command, for example. */
   initial_children = msg->children;
+
   msg->children = latexila_post_processor_take_messages (pp_latex);
   g_object_unref (pp_latex);
 
+  pp->priv->last_latex_messages = msg->children->head;
+
   if (initial_children != NULL)
     {
       for (l = initial_children->tail; l != NULL; l = l->prev)
@@ -599,12 +611,7 @@ latexila_post_processor_latexmk_get_messages (LatexilaPostProcessor *post_proces
   g_object_get (pp, "has-details", &has_details, NULL);
 
   if (has_details && !show_details)
-    {
-      /* TODO don't display the command line */
-      LatexilaBuildMsg *msg = pp->priv->last_latex_sub_command;
-      g_assert (msg != NULL);
-      return msg->children != NULL ? msg->children->head : NULL;
-    }
+    return pp->priv->last_latex_messages;
 
   return pp->priv->messages != NULL ? pp->priv->messages->head : NULL;
 }
@@ -616,7 +623,10 @@ latexila_post_processor_latexmk_take_messages (LatexilaPostProcessor *post_proce
   GQueue *ret;
 
   ret = pp->priv->messages;
+
   pp->priv->messages = NULL;
+  pp->priv->last_latex_messages = NULL;
+  pp->priv->last_latex_sub_command = NULL;
 
   return ret;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]