[gedit-latex] Add per-dcument preferences.



commit b0a9b342ed33c8a9da1a6e45c53d23fdfde790e5
Author: John Stowers <john stowers gmail com>
Date:   Tue Aug 16 11:09:07 2011 +1200

    Add per-dcument preferences.
    
    Introduce DocumentPreferences, whereby preferences are
    first attempted to be read from the current document, before
    falling back to the system preferences. This currently allows
    one to specify the master document via modelines in the
    tex file, e.g.
    %
    % gedit:master-document-filename = foo.tex
    %
    This also cleans up a lot of existing code
    
    To unify this as a key-value store, I moved to ini style
    files (no more XML). This is the first step towards cleaning
    up the prefs a great deal more.
    
    Future plans include introducing the concept of a
    MasterDocumentPreferences, where, on a per-project/document basis,
    one can customize the behaviour of the plugin, such as
     * Introducing more tools
     * Changing build actions
     * etc
    tidy prefs, remove get_bool, defaults, etc

 ...org.gnome.gedit.plugins.latex.gschema.xml.in.in |    3 +
 latex/base/windowactivatable.py                    |    3 +-
 latex/bibtex/editor.py                             |    2 +-
 latex/bibtex/views.py                              |    2 +-
 latex/latex/__init__.py                            |   76 ------------
 latex/latex/actions.py                             |   16 +---
 latex/latex/dialogs.py                             |   17 ++-
 latex/latex/editor.py                              |   48 ++++-----
 latex/latex/outline.py                             |    6 +-
 latex/latex/views.py                               |    8 +-
 latex/outline.py                                   |    2 +-
 latex/preferences/__init__.py                      |  120 +++++++++++++++++---
 latex/preferences/dialog.py                        |    4 +-
 latex/tools/postprocess.py                         |    2 +-
 latex/views.py                                     |    4 +-
 test/article.tex                                   |    1 +
 test/chap3.tex                                     |    5 +
 17 files changed, 166 insertions(+), 153 deletions(-)
---
diff --git a/data/org.gnome.gedit.plugins.latex.gschema.xml.in.in b/data/org.gnome.gedit.plugins.latex.gschema.xml.in.in
index bce4fa8..b00eab9 100644
--- a/data/org.gnome.gedit.plugins.latex.gschema.xml.in.in
+++ b/data/org.gnome.gedit.plugins.latex.gschema.xml.in.in
@@ -4,6 +4,9 @@
       <default>500</default>
       <_summary>Maximum BibTeX Size</_summary>
     </key>
+    <key name="bibtex-outline-grouping" type="i">
+      <default>1</default>
+    </key>
     <key name="outline-connect-to-editor" type="b">
       <default>true</default>
       <_summary>Connect Outline to Editor</_summary>
diff --git a/latex/base/windowactivatable.py b/latex/base/windowactivatable.py
index 329e232..390d3cc 100644
--- a/latex/base/windowactivatable.py
+++ b/latex/base/windowactivatable.py
@@ -107,7 +107,6 @@ class LaTeXWindowActivatable(GObject.Object, Gedit.WindowActivatable, PeasGtk.Co
         Called when the window extension is deactivated
         """
         # save preferences and stop listening
-        self._preferences.save()
         self._tool_preferences.save()
 
         # destroy tab decorators
@@ -414,7 +413,7 @@ class LaTeXWindowActivatable(GObject.Object, Gedit.WindowActivatable, PeasGtk.Co
         self._log.debug("---------- ADJUST: %s" % (extension))
 
         latex_extensions = self._preferences.get("latex-extensions").split(",")
-        show_toolbar = self._preferences.get_bool("show-latex-toolbar")
+        show_toolbar = self._preferences.get ("show-latex-toolbar")
         if show_toolbar and extension in latex_extensions:
             self.show_toolbar()
         else:
diff --git a/latex/bibtex/editor.py b/latex/bibtex/editor.py
index 0fe7663..0d84cc1 100644
--- a/latex/bibtex/editor.py
+++ b/latex/bibtex/editor.py
@@ -193,7 +193,7 @@ class BibTeXEditor(Editor, IIssueHandler, JobChangeListener):
         """
         The cursor has moved
         """
-        if self._preferences.get_bool("outline-connect-to-editor"):
+        if self._preferences.get("outline-connect-to-editor"):
             self._outline_view.select_path_by_offset(offset)
 
     def destroy(self):
diff --git a/latex/bibtex/views.py b/latex/bibtex/views.py
index 279004a..c776a56 100644
--- a/latex/bibtex/views.py
+++ b/latex/bibtex/views.py
@@ -63,7 +63,7 @@ class BibTeXOutlineView(BaseOutlineView):
 
         self._preferences = Preferences()
 
-        grouping = self._preferences.get("BibtexOutlineGrouping", GROUP_NONE)
+        grouping = self._preferences.get("bibtex-outline-grouping")
         if grouping == GROUP_NONE:
             self._item_none.set_active(True)
         elif grouping == GROUP_TYPE:
diff --git a/latex/latex/__init__.py b/latex/latex/__init__.py
index 906cf92..1b4fd67 100644
--- a/latex/latex/__init__.py
+++ b/latex/latex/__init__.py
@@ -30,80 +30,4 @@ class LaTeXSource(object):
         self.source = source
         self.packages = packages
 
-
-from logging import getLogger
-
-# TODO: use ElementTree
-from xml.dom import minidom
-from xml.parsers.expat import ExpatError
-
-from ..base.file import File
-
-
-class PropertyFile(dict):
-    """
-    A property file is a hidden XML file that holds meta data for exactly one file.
-    It can be used to store the master file of a LaTeX document fragment.
-    """
-
-    __log = getLogger("PropertyFile")
-
-    # TODO: insert value as TEXT node
-
-    def __init__(self, file):
-        """
-        Create or load the property file for a given File
-        """
-        self.__file = File("%s/.%s.properties.xml" % (file.dirname, file.basename))
-
-        try:
-            self.__dom = minidom.parse(self.__file.path)
-
-            for property_node in self.__dom.getElementsByTagName("property"):
-                k = property_node.getAttribute("key")
-                v = property_node.getAttribute("value")
-                self.__setitem__(k, v)
-
-        except IOError:
-            self.__log.debug("File %s not found, creating empty one" % self.__file)
-
-            self.__dom = minidom.getDOMImplementation().createDocument(None, "properties", None)
-
-        except ExpatError, e:
-            self.__log.error("Error parsing %s: %s" % (self.__file, e))
-
-
-    def __find_node(self, k):
-        for node in self.__dom.getElementsByTagName("property"):
-            if node.getAttribute("key") == str(k):
-                return node
-        raise KeyError
-
-    def __getitem__(self, k):
-        return self.__find_node(k).getAttribute("value")
-
-    def __setitem__(self, k, v):
-        try:
-            self.__find_node(k).setAttribute("value", str(v))
-        except KeyError:
-            node = self.__dom.createElement("property")
-            node.setAttribute("key", str(k))
-            node.setAttribute("value", str(v))
-            self.__dom.documentElement.appendChild(node)
-
-    def save(self):
-        filename = self.__file.path
-
-        if self.__file.exists:
-            mode = "w"
-        else:
-            mode = "a"
-
-        try:
-            f = open(filename, mode)
-            f.write(self.__dom.toxml())
-            f.close()
-            self.__log.debug("Saved to %s" % filename)
-        except IOError, e:
-            self.__log.error("Error saving %s: %s" % (filename, e))
 # ex:ts=4:et:
diff --git a/latex/latex/actions.py b/latex/latex/actions.py
index 188752c..d5394f8 100644
--- a/latex/latex/actions.py
+++ b/latex/latex/actions.py
@@ -38,7 +38,7 @@ from .parser import LaTeXParser, Node
 from .dialogs import UseBibliographyDialog, InsertGraphicsDialog, InsertTableDialog, \
                     InsertListingDialog, BuildImageDialog, SaveAsTemplateDialog, \
                     NewDocumentDialog, ChooseMasterDialog
-from . import LaTeXSource, PropertyFile
+from . import LaTeXSource
 
 class LaTeXAction(Action):
     extensions = Preferences().get("latex-extensions").split(",")
@@ -111,19 +111,7 @@ class LaTeXChooseMasterAction(LaTeXAction):
         editor = context.active_editor
         assert type(editor) is LaTeXEditor
 
-        file = editor._file        # FIXME: access to private member
-
-        # load property file
-        property_file = PropertyFile(file)
-
-        master_filename = ChooseMasterDialog().run(file.dirname)
-        if master_filename:
-            # relativize the master filename
-            master_filename = File(master_filename).relativize(file.dirname, True)
-
-            property_file["MasterFilename"] = master_filename
-            property_file.save()
-
+        editor.choose_master_file()
 
 class LaTeXCloseEnvironmentAction(LaTeXIconAction):
     _log = getLogger("LaTeXCloseEnvironmentAction")
diff --git a/latex/latex/dialogs.py b/latex/latex/dialogs.py
index 258a3b7..e78cdcb 100644
--- a/latex/latex/dialogs.py
+++ b/latex/latex/dialogs.py
@@ -100,7 +100,10 @@ class ComboBoxProxy(AbstractProxy):
         self._options = []
 
     def restore(self, default):
-        restored_value = self._preferences.get(self._key, default)
+        if default != None:
+            restored_value = default
+        else:
+            restored_value = self._preferences.get(self._key)
         restored_index = 0
         i = 0
         for value, label in self._options:
@@ -147,8 +150,12 @@ class EntryProxy(AbstractProxy):
     def __init__(self, widget, key):
         AbstractProxy.__init__(self, widget, key)
 
-    def restore(self, default):
-        self._widget.set_text(self._preferences.get(self._key, default))
+    def restore(self, default=None):
+        if default != None:
+            txt = default
+        else:
+            txt = self._preferences.get(self._key, default)
+        self._widget.set_text(txt)
 
     @property
     def value(self):
@@ -356,7 +363,7 @@ class NewDocumentDialog(GladeInterface):
             #
             self._entry_title = self.find_widget("entryTitle")
             self._entry_author = self.find_widget("entryAuthor")
-            self._entry_author.set_text(preferences.get("RecentAuthor", environment.username))
+            self._entry_author.set_text(environment.username)
             self._radio_date_custom = self.find_widget("radioCustom")
             self._entry_date = self.find_widget("entryDate")
 
@@ -381,7 +388,7 @@ class NewDocumentDialog(GladeInterface):
 
 
             self._check_landscape = self.find_widget("checkLandscape")
-            self._check_landscape.set_active(preferences.get_bool("RecentPaperLandscape", False))
+            self._check_landscape.set_active(False)
 
             #
             # font size
diff --git a/latex/latex/editor.py b/latex/latex/editor.py
index 7f7a497..9c9daef 100644
--- a/latex/latex/editor.py
+++ b/latex/latex/editor.py
@@ -44,15 +44,14 @@ from validator import LaTeXValidator
 
 from dialogs import ChooseMasterDialog
 
-from . import LaTeXSource, PropertyFile
-from ..preferences import Preferences
+from . import LaTeXSource
+from ..preferences import Preferences, DocumentPreferences
 
 
 class LaTeXEditor(Editor, IIssueHandler):
 
     _log = getLogger("LaTeXEditor")
 
-    #extensions = [".tex"]
     extensions = Preferences().get("latex-extensions").split(",")
 
     dnd_extensions = [".png", ".pdf", ".bib", ".tex"]
@@ -73,7 +72,7 @@ class LaTeXEditor(Editor, IIssueHandler):
         self._file = file
         self._context = context
 
-        self._preferences = Preferences()
+        self._preferences = DocumentPreferences(self._file)
         self._preferences.connect("preferences-changed", self._on_preferences_changed)
 
         self.register_marker_type("latex-error", self._preferences.get("error-background-color"))
@@ -87,8 +86,6 @@ class LaTeXEditor(Editor, IIssueHandler):
         self._validator = LaTeXValidator()
         self._document = None
 
-        self._document_dirty = True
-
         # if the document is no master we display an info message on the packages to
         # include - _ensured_packages holds the already mentioned packages to not
         # annoy the user
@@ -113,7 +110,7 @@ class LaTeXEditor(Editor, IIssueHandler):
                 # so we may not use it for regenerating the outline here
                 self.__parse()
         elif key == "show-latex-toolbar":
-            show_toolbar = self._preferences.get_bool("show-latex-toolbar")
+            show_toolbar = self._preferences.get("show-latex-toolbar")
             if show_toolbar:
                 self._window_context._window_decorator.show_toolbar()
             else:
@@ -262,6 +259,9 @@ class LaTeXEditor(Editor, IIssueHandler):
                 del self._document
             self._document = self._parser.parse(self.content, self._file, self)
 
+            # update document preferences
+            self._preferences.parse_content(self.content)
+
             if BENCHMARK: self._log.info("LaTeXParser.parse: %f" % (time.clock() - t))
 
             # create a copy that won't be expanded (e.g. for spell check)
@@ -330,41 +330,35 @@ class LaTeXEditor(Editor, IIssueHandler):
 
             #print self._document.xml
 
+    def choose_master_file(self):
+        master_filename = ChooseMasterDialog().run(self._file.dirname)
+        if master_filename:
+            # relativize the master filename
+            master_filename = File(master_filename).relativize(self._file.dirname, True)
+            self._preferences.set("document-master-filename", master_filename)
+        return master_filename
+
     @property
-    # returns(File)
     def __master_file(self):
         """
         Find the LaTeX master of this child
 
         @return: base.File
         """
-        # TODO: cache result
-
-        property_file = PropertyFile(self._file)
-        try:
-            #return File(property_file["MasterFilename"])
-
-            path = property_file["MasterFilename"]
-            # the property file may contain absolute and relative paths
-            # because we switched in 0.2rc2
+        path = self._preferences.get("document-master-filename")
+        if path != None:
             if File.is_absolute(path):
                 self._log.debug("Path is absolute")
                 return File(path)
             else:
                 self._log.debug("Path is relative")
                 return File.create_from_relative_path(path, self._file.dirname)
-        except KeyError:        # master filename not found
-            # ask user
-            master_filename = ChooseMasterDialog().run(self._file.dirname)
+        else:
+            # master filename not found, ask user
+            master_filename = self.choose_master_file()
             if master_filename:
-                # relativize the master filename
-                master_filename = File(master_filename).relativize(self._file.dirname, True)
-
-                property_file["MasterFilename"] = master_filename
-                property_file.save()
                 return File.create_from_relative_path(master_filename, self._file.dirname)
             else:
-                # no master file chosen
                 return None
 
     def issue(self, issue):
@@ -384,7 +378,7 @@ class LaTeXEditor(Editor, IIssueHandler):
         """
         The cursor has moved
         """
-        if self._preferences.get_bool("outline-connect-to-editor"):
+        if self._preferences.get("outline-connect-to-editor"):
             self._outline_view.select_path_by_offset(offset)
 
     @property
diff --git a/latex/latex/outline.py b/latex/latex/outline.py
index 5b1e4dc..2b62228 100644
--- a/latex/latex/outline.py
+++ b/latex/latex/outline.py
@@ -102,9 +102,9 @@ class LaTeXOutlineGenerator(object):
         """
 
         # setup
-        self.cfgLabelsInTree = Preferences().get_bool("outline-show-labels")
-        self.cfgTablesInTree = Preferences().get_bool("outline-show-tables")
-        self.cfgGraphicsInTree = Preferences().get_bool("outline-show-graphics")
+        self.cfgLabelsInTree = Preferences().get("outline-show-labels")
+        self.cfgTablesInTree = Preferences().get("outline-show-tables")
+        self.cfgGraphicsInTree = Preferences().get("outline-show-graphics")
 
         self._outline = Outline()
         self._stack = [self._outline.rootNode]
diff --git a/latex/latex/views.py b/latex/latex/views.py
index 0b53798..b56bd55 100644
--- a/latex/latex/views.py
+++ b/latex/latex/views.py
@@ -112,7 +112,7 @@ class LaTeXSymbolMapView(PanelView):
         return Gtk.Image.new_from_stock(Gtk.STOCK_INDEX,Gtk.IconSize.MENU)
 
     def _load_collection(self, collection):
-        self._expanded_groups = set(self._preferences.get("expanded-symbol-groups", "").split(","))
+        self._expanded_groups = set(self._preferences.get("expanded-symbol-groups").split(","))
 
         for group in collection.groups:
             self._add_group(group)
@@ -208,8 +208,8 @@ class LaTeXOutlineView(BaseOutlineView):
         btn_tables.set_tooltip_text(_("Show tables"))
         self._toolbar.insert(btn_tables, -1)
 
-        btn_graphics.set_active(Preferences().get_bool("outline-show-graphics"))
-        btn_tables.set_active(Preferences().get_bool("outline-show-tables"))
+        btn_graphics.set_active(Preferences().get("outline-show-graphics"))
+        btn_tables.set_active(Preferences().get("outline-show-tables"))
 
         self._handlers[btn_graphics] = btn_graphics.connect("toggled", self._on_graphics_toggled)
         self._handlers[btn_tables] = btn_tables.connect("toggled", self._on_tables_toggled)
@@ -233,7 +233,7 @@ class LaTeXOutlineView(BaseOutlineView):
         """
         An outline node has been selected
         """
-        if Preferences().get_bool("outline-connect-to-editor"):
+        if Preferences().get("outline-connect-to-editor"):
             if node.file == self._editor.edited_file:
                 self._editor.select(node.start, node.end)
 
diff --git a/latex/outline.py b/latex/outline.py
index 3861af0..360b0a4 100644
--- a/latex/outline.py
+++ b/latex/outline.py
@@ -52,7 +52,7 @@ class BaseOutlineView(PanelView):
 
         btn_follow = Gtk.ToggleToolButton.new_from_stock(Gtk.STOCK_CONNECT)
         btn_follow.set_tooltip_text(_("Follow Editor"))
-        btn_follow.set_active(self._preferences.get_bool("outline-connect-to-editor"))
+        btn_follow.set_active(self._preferences.get("outline-connect-to-editor"))
         self._base_handlers[btn_follow] = btn_follow.connect("toggled", self._on_follow_toggled)
 
         btn_expand = Gtk.ToolButton.new_from_stock(Gtk.STOCK_ZOOM_IN)
diff --git a/latex/preferences/__init__.py b/latex/preferences/__init__.py
index d7f196e..fab7ae2 100644
--- a/latex/preferences/__init__.py
+++ b/latex/preferences/__init__.py
@@ -24,45 +24,137 @@ preferences
 
 from gi.repository import GObject, Gio, GLib
 
+import re
 import os.path
 import logging
+import ConfigParser
 
 from ..util import singleton
 
- singleton
-class Preferences(GObject.GObject):
+LOG = logging.getLogger(__name__)
+
+class _DocumentConfigParser(ConfigParser.RawConfigParser):
+
+    SECTION = "LATEX"
+
+    def __init__(self, filename):
+        ConfigParser.RawConfigParser.__init__(self)
+        self._filename = filename
+        self.read(filename)
+        try:
+            self.add_section(self.SECTION)
+        except ConfigParser.DuplicateSectionError:
+            pass
+
+    def get(self, key):
+        try:
+            return ConfigParser.RawConfigParser.get(self,self.SECTION, key)
+        except ConfigParser.NoOptionError:
+            return None
+
+    def set(self,key,value):
+        ConfigParser.RawConfigParser.set(self, self.SECTION, key, value)
+
+    def save(self):
+        f = open(self._filename,'w')
+        self.write(f)
+        f.close()
+
+class _Preferences(GObject.GObject):
 
     __gsignals__ = {
         "preferences-changed": (
             GObject.SignalFlags.RUN_LAST, None, [str, str]),
     }
 
+    def __init__(self):
+        GObject.GObject.__init__(self)
+
+    def get(self, key, default=None):
+        raise NotImplementedError
+
+    def set(self, key, value):
+        pass
+
+ singleton
+class Preferences(_Preferences):
     """
     A simple map storing preferences as key-value-pairs
     """
 
-    _log = logging.getLogger("Preferences")
-
     TEMPLATE_DIR = os.path.join(GLib.get_user_data_dir(), "gedit", "latex", "templates")
 
     def __init__(self):
-        GObject.GObject.__init__(self)
+        _Preferences.__init__(self)
         self._settings = Gio.Settings("org.gnome.gedit.plugins.latex")
-        self._log.debug("Constructed")
-
-    def get(self, key, default=None):
-        if default:
-            return default
-        return self._settings[key]
+        
+        LOG.debug("Prefs singleton constructed")
 
-    def get_bool(self, key):
+    def get(self, key):
+        LOG.debug("Prefs get: %s" % key)
         return self._settings[key]
 
     def set(self, key, value):
+        LOG.debug("Prefs set: %s = %s" % (key,value))
         self._settings[key] = value
         self.emit("preferences-changed", str(key), str(value))
 
-    def save(self):
-        pass
+class DocumentPreferences(_Preferences):
+    """
+    Similar to @Preferences, but treats keys starting with 'document-' differently
+    """
+
+    KEYS = dict([(k,True) for k in (
+        "document-master-filename",
+    )])
+
+    def __init__(self, file):
+        _Preferences.__init__(self)
+        self._sysprefs = Preferences()
+        self._sysprefs.connect("preferences-changed", self._on_prefs_changed)
+        self._file = file
+        self._cp = _DocumentConfigParser(
+                        "%s/.%s.ini" % (file.dirname, file.basename))
+
+        self._re = re.compile("^\s*%+\s*gedit:(.*)\s*=\s*(.*)")
+        self._modelines = {}
+
+    def _on_prefs_changed(self, p, key, value):
+        self.emit("preferences-changed", key, value)
+
+    def _is_docpref(self,key):
+        return key.startswith("document-") and key in self.KEYS
+
+    def parse_content(self, content, max_lines=100):
+        """ Parses txt content from the document looking for modelines """
+        self._modelines = {}
+
+        i = 0
+        for l in content.splitlines():
+            if i > max_lines:
+                break
+            try:
+                key,val = self._re.match(l).groups()
+                LOG.debug("Detected preference modeline: %s = %s" % (key,val))
+                self._modelines[key.strip()] = val
+            except AttributeError:
+                pass
+            i = i+1
+
+    def get(self, key):
+        if self._is_docpref(key):
+            LOG.debug("Get document pref: %s (modelines: %s)" % (key,",".join(self._modelines.keys())))
+            return self._modelines.get(key, self._cp.get(key))
+        else:
+            return self._sysprefs.get(key)
+
+    def set(self, key, value):
+        if self._is_docpref(key):
+            LOG.debug("Set document pref")
+            self._cp.set(key,value)
+            self._cp.save()
+            self.emit("preferences-changed", key, value)
+        else:
+            self._sysprefs.set(key, value)
 
 # ex:ts=4:et:
diff --git a/latex/preferences/dialog.py b/latex/preferences/dialog.py
index fcf5579..fa07c6e 100644
--- a/latex/preferences/dialog.py
+++ b/latex/preferences/dialog.py
@@ -353,11 +353,11 @@ class PreferencesDialog(GladeInterface):
 
             # misc
             check_hide_box = self.find_widget("checkHideBox")
-            check_hide_box.set_active(self._preferences.get_bool("hide-box-warnings"))
+            check_hide_box.set_active(self._preferences.get("hide-box-warnings"))
 
 
             check_show_toolbar = self.find_widget("checkShowToolbar")
-            check_show_toolbar.set_active(self._preferences.get_bool("show-latex-toolbar"))
+            check_show_toolbar.set_active(self._preferences.get("show-latex-toolbar"))
 
 
             filechooser_tmp = self.find_widget("filechooserTemplates")
diff --git a/latex/tools/postprocess.py b/latex/tools/postprocess.py
index db3e2b2..838fa62 100644
--- a/latex/tools/postprocess.py
+++ b/latex/tools/postprocess.py
@@ -173,7 +173,7 @@ class RubberPostProcessor(PostProcessor):
         # FIXME: circ dep
         from ..preferences import Preferences
 
-        self._hide_box_warnings = Preferences().get_bool("hide-box-warnings")
+        self._hide_box_warnings = Preferences().get("hide-box-warnings")
 
     @property
     def successful(self):
diff --git a/latex/views.py b/latex/views.py
index 2457d37..89ad197 100644
--- a/latex/views.py
+++ b/latex/views.py
@@ -48,8 +48,8 @@ class IssueView(PanelView):
         self._preferences = Preferences()
 
         self._preferences.connect("preferences-changed", self._on_preferences_changed)
-        self._show_tasks = self._preferences.get_bool("issues-show-tasks")
-        self._show_warnings = self._preferences.get_bool("issues-show-warnings")
+        self._show_tasks = self._preferences.get("issues-show-tasks")
+        self._show_warnings = self._preferences.get("issues-show-warnings")
 
         self._icons = { Issue.SEVERITY_WARNING : GdkPixbuf.Pixbuf.new_from_file(Resources().get_icon("warning.png")),
                         Issue.SEVERITY_ERROR : GdkPixbuf.Pixbuf.new_from_file(Resources().get_icon("error.png")),
diff --git a/test/article.tex b/test/article.tex
index a0b0fc4..9598be4 100644
--- a/test/article.tex
+++ b/test/article.tex
@@ -40,6 +40,7 @@ I like \cite{dijkstra76}
 lets use a \testcite{dijkstra68}
 
 \include{chap2}
+\include{chap3}
 
 \bibliography{article}
 \bibliographystyle{IEEEtran}
diff --git a/test/chap3.tex b/test/chap3.tex
new file mode 100644
index 0000000..0cabb61
--- /dev/null
+++ b/test/chap3.tex
@@ -0,0 +1,5 @@
+% gedit:document-master-filename = article.tex
+
+\chapter{A Third Chapter}
+\section{Imma Let You Finish}
+This is the best \LaTeX plugin of all time.



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