plugin only loads when switching tabs, not when opening file

Bug #360009 reported by Arthur Blair
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
gedit-latex-plugin (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: gedit-latex-plugin

If I am running gedit and switch to a tab containing a *.tex file, the plugin loads automatically (the toolbar appears and I can compile the document). If I open a *.tex file, the plugin does not load (until I switch to the file from another tab).

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: gedit-latex-plugin 0.2rc1-1ubuntu1
PackageArchitecture: all
ProcEnviron:
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: gedit-latex-plugin
Uname: Linux 2.6.28-11-generic i686

Revision history for this message
Arthur Blair (adblair) wrote :
Revision history for this message
Paul Natsuo Kishimoto (khaeru) wrote :

Experiencing the same.

Revision history for this message
Waldir Leoncio (wleoncio) wrote :

Me too.

Revision history for this message
Andrea Gasparini (gaspa) wrote :

I don't. Could you please launch gedit from a terminal, and copy the output of the command? thanks.

Changed in gedit-latex-plugin (Ubuntu):
status: New → Incomplete
Revision history for this message
Paul Natsuo Kishimoto (khaeru) wrote :

Traceback (most recent call last):
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/__init__.py", line 89, in activate
    self._window_decorators[window] = GeditWindowDecorator(window)
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/base/decorators.py", line 82, in __init__
    self._init_tab_decorators()
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/base/decorators.py", line 182, in _init_tab_decorators
    decorator = self._create_tab_decorator(tab, init=True)
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/base/decorators.py", line 544, in _create_tab_decorator
    decorator = GeditTabDecorator(self, tab, init)
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/base/decorators.py", line 605, in __init__
    self._adjust_editor()
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/base/decorators.py", line 673, in _adjust_editor
    editor_class.__init__(self._editor, self, file)
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/base/__init__.py", line 358, in __init__
    self.init(file, self._window_context)
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/latex/editor.py", line 100, in init
    self.__parse()
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/latex/editor.py", line 264, in __parse
    self._outline_view.set_outline(self._outline)
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/latex/views.py", line 228, in set_outline
    OutlineConverter().convert(self._store, outline, self._offset_map, self._context.active_editor.edited_file)
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/base/__init__.py", line 977, in active_editor
    return self._window_decorator._active_tab_decorator.editor
AttributeError: 'NoneType' object has no attribute 'editor'

The specific steps I followed to do this:
1. Disable the LaTeX plugin.
2. Exit gedit.
3. Start gedit from terminal.
4. Open a LaTeX document.
5. Click Edit > Preferences, switch to the Plugins tab
6. Check the box next to "Gedit LaTeX Plugin 0.2 rc1". The traceback appears in the terminal output at this point. The toolbar does not appear.

Revision history for this message
Andrea Gasparini (gaspa) wrote :

Seen, It appear on 0.2r2 as well.
you can keep the plugin actived, so

Changed in gedit-latex-plugin (Ubuntu):
importance: Undecided → Low
status: Incomplete → Triaged
Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Still happens with rc3

Revision history for this message
arno_b (arno.b) wrote :

Still happening with 0.2

Revision history for this message
Waldir Leoncio (wleoncio) wrote : Re: [Bug 360009] Re: plugin only loads when switching tabs, not when opening file

0.2 rc3 + gedit 2.30.0 did it for me.

On Wed, Apr 21, 2010 at 1:07 PM, arno_b <email address hidden> wrote:

> Still happening with 0.2
>
> --
> plugin only loads when switching tabs, not when opening file
> https://bugs.launchpad.net/bugs/360009
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
arno_b (arno.b) wrote :

Well, I fixed the problem: my latex document was separated into several files and some of then had accented characters. When I removed all of them, the plugin load normally.

Revision history for this message
Andrea Gasparini (gaspa) wrote :

Hi,
could you please check if the problem is still present on the current (3.3.x) versions?

If the problem was related to accented chars, seems fixed now ( I'm currently trying with Oneiric and latex-plugin 3.3 from oneiric-backports)

thanks.

Revision history for this message
Atila:Huni (orioni5) wrote :

The problem persists in Pangolin ; gedit 3.4.
No Latex menu item;
furthermore, gedit crashes when I try to access Preferences from the Edit > Preferences > Plugins > Latex plugin > Preferences.
I am on Xubuntu.

Revision history for this message
Atila:Huni (orioni5) wrote :

oops, forgot to copy my terminal output after launching gedit

Traceback (most recent call last):
  File "/usr/lib/gedit/plugins/latex/windowactivatable.py", line 79, in do_activate
    self._tool_preferences = ToolPreferences()
  File "/usr/lib/gedit/plugins/latex/util.py", line 40, in getinstance
    instances[cls] = cls()
  File "/usr/lib/gedit/plugins/latex/preferences/tools.py", line 72, in __init__
    self.__tools = ElementTree.parse(filename).getroot()
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1183, in parse
    tree.parse(source, parser)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 657, in parse
    self._root = parser.close()
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1655, in close
    self._raiseerror(v)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1507, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: unclosed token: line 2, column 2

Revision history for this message
Andrea Gasparini (gaspa) wrote :

Hi,
I can't reproduce this in Precise. Just to be sure, the bar is not on another level, but on the right, did you notice that?
For me it's working, I opened a normal .tex file, and the bar appeared, then switched to another file (not .tex), and the bar again do what it's supposed to do.

If you can provide a more extensive explaination I'll be glad. Let me know, and thanks for your help.

(about the other problem, perhaps it's better to file another bug... before that, take a look if this file is correct:
/usr/share/gedit/plugins/latex/tools.xml )

Revision history for this message
Atila:Huni (orioni5) wrote :

Ciào Andrea,

scrivo in inglese x tutti.

what do you mean by "take a look if this file is correct:

/usr/share/gedit/plugins/latex/tools.xml )" ?

this is it:

<tools>
  <tool description="Create a PDF from LaTeX source" extensions=".tex" id="1" label="LaTeX → PDF">
    <job mustSucceed="True" postProcessor="RubberPostProcessor">rubber --inplace --maxerr -1 --short --force --warn all --pdf "$filename"</job>
    <job mustSucceed="True" postProcessor="GenericPostProcessor">gvfs-open "$shortname.pdf"</job>
  </tool>
  <tool description="Create a PostScript from LaTeX source" extensions=".tex" id="3" label="LaTeX → PS">
    <job mustSucceed="true" postProcessor="RubberPostProcessor">rubber --inplace --maxerr -1 --short --force --warn all --ps "$filename"</job>
    <job mustSucceed="true" postProcessor="GenericPostProcessor">gvfs-open "$shortname.ps"</job>
  </tool>
  <tool description="Create a DVI from LaTeX source" extensions=".tex" id="4" label="LaTeX → DVI">
    <job mustSucceed="true" postProcessor="RubberPostProcessor">rubber --inplace --maxerr -1 --short --force --warn all "$filename"</job>
    <job mustSucceed="true" postProcessor="GenericPostProcessor">gvfs-open "$shortname.dvi"</job>
  </tool>
  <tool description="Create a DVI with source specials from LaTeX source" extensions=".tex" id="5" label="LaTeX → DVI (Source Specials)">
    <job mustSucceed="true" postProcessor="LaTeXPostProcessor">latex -interaction batchmode -src "$filename"</job>
    <job mustSucceed="true" postProcessor="LaTeXPostProcessor">latex -interaction batchmode -src "$filename"</job>
    <job mustSucceed="true" postProcessor="GenericPostProcessor">xdvi -unique -s 6 -bg white -editor gedit "$shortname.dvi"</job>
  </tool>
  <tool description="Process R Sweave file and create a PDF from the resulting LaTeX source" extensions=".Rnw" id="6" label="R Sweave → PDF">
    <job mustSucceed="true" postProcessor="GenericPostProcessor">R CMD Sweave "$shortname.Rnw"</job>
    <job mustSucceed="true" postProcessor="RubberPostProcessor">rubber --inplace --maxerr -1 --short --force --warn all --pdf "$shortname.tex"</job>
    <job mustSucceed="true" postProcessor="GenericPostProcessor">gvfs-open "$shortname.pdf"</job>
  </tool>
  <tool description="Remove LaTeX build files" extensions=".tex" id="7" label="Cleanup LaTeX Build Files">
    <job mustSucceed="False" postProcessor="GenericPostProcessor">rm -f "$directory"/*.aux "$directory"/*.log "$directory"/*.toc "$directory"/*.bbl "$directory"/*.blg</job>
  </tool>
  <tool description="Convert BibTeX to XML" extensions=".bib" id="8" label="BibTeX → XML">
    <job mustSucceed="true" postProcessor="GenericPostProcessor">bibtex2xml "$filename"</job>
  </tool>
</tools>

in fact everything worked fine until an updating. As i'm using precise i have to update it over and over till the stable release comes out.
i dont have a clue what it might be. is it the new python 2.6 or gtk+3?
i dont feel like start learning another prog.language in order to solve this issue.
thanks in advance
spero ci sentiamo in giornata!!

Revision history for this message
Andrea Gasparini (gaspa) wrote : Re: [Bug 360009] Re: plugin only loads when switching tabs, not when opening file

On Tue, Apr 17, 2012 at 1:24 PM, Atila:Huni <email address hidden> wrote:
> what do you mean by  "take a look if this file is correct:>
> /usr/share/gedit/plugins/latex/tools.xml )" ?

The traceback says the xml parser can't read the xml file. So, or the
file is corrupted, or the filename is wrong.
Your file seems ok, so probably he's trying to read a file in another
(can be some misconfiguration due to the upgrading, in fact)

We need to do some further investigations.
Let's try that: if you create another user, does the issue still appear?
( you can use useradd/adduser from a terminal, and then use su/sudo to
run gedit with that user's environment, no need to logout/login)

bye.
--
- Andrea Gasparini -

Revision history for this message
Atila:Huni (orioni5) wrote :

huh
it's interesting enough. adopting your suggestion, I try to activate latex plugin from Edit>Preferences>Plugins.
The Latex and Bibtex tab appear on the menu bar, but only for a fraction of the second, after which disappear.
They blinks so fast I can hardly see what it's written in the tabs.

Traceback (most recent call last):

 File "/usr/lib/gedit/plugins/latex/preferences/dialog.py", line 477, in _on_tool_cursor_changed
    store, it = treeView.get_selection().get_selected()
AttributeError: 'NoneType' object has no attribute 'get_selected'

(gedit:8685): Gtk-CRITICAL **: gtk_tree_selection_get_selected: assertion `GTK_IS_TREE_SELECTION (selection)' failed

a presto!

Revision history for this message
Atila:Huni (orioni5) wrote :

Andrea, don't worry about my last msg, I have to correct myself, your suggestion is working somehow.
I'm looking for a solution to some little issues. I'll let you know if I meet a hurdle and need your help further.
Thank you for now!!
Grazie tanto per le risposte tempestive!

Revision history for this message
Atila:Huni (orioni5) wrote :

Here we are, again.
I couldn't resolve it. So if you have some time we can try to.

Revision history for this message
Atila:Huni (orioni5) wrote :

@Andrea

(gedit:2440): Gtk-CRITICAL **: gtk_tree_selection_get_selected: assertion `GTK_IS_TREE_SELECTION (selection)' failed
find: `/home/atila/texmf': Asnjë file apo directory
find: `/usr/share/texmf/tex/latex/base/': Asnjë file apo directory
find: `/home/atila/texmf/tex/latex/base/': Asnjë file apo directory
find: `/usr/share/texmf/tex/generic/babel/': Asnjë file apo directory
find: `/home/atila/texmf/tex/generic/babel/': Asnjë file apo directory
Traceback (most recent call last):
  File "/usr/lib/gedit/plugins/latex/action.py", line 60, in <lambda>
    self._handler = self._internal_action.connect("activate", lambda gtk_action, action: action.activate(window_context), self)
  File "/usr/lib/gedit/plugins/latex/latex/actions.py", line 90, in activate
    file.create(self.dialog.source)
  File "/usr/lib/gedit/plugins/latex/file.py", line 76, in create
    f = open(self.path, "w")
IOError: [Errno 13] Leja ju mohohet: '/home/elios/Hap\xc3\xabsira e pun\xc3\xabs/tesina/document.tex'
Traceback (most recent call last):
  File "/usr/lib/gedit/plugins/latex/latex/editor.py", line 271, in __parse
    expander.expand(self._document, self._file, self, self.charset)
  File "/usr/lib/gedit/plugins/latex/latex/expander.py", line 55, in expand
    self._expand(documentNode)
  File "/usr/lib/gedit/plugins/latex/latex/expander.py", line 82, in _expand
    file = File.create_from_relative_path("%s.tex" % target, self._master_file.dirname)
  File "/usr/lib/gedit/plugins/latex/file.py", line 49, in create_from_relative_path
    absolute_path = os.path.abspath(os.path.join(working_directory, relative_path))
  File "/usr/lib/python2.7/posixpath.py", line 71, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15: ordinal not in range(128)

this is the output of the terminal from which i launched gedit, from the new user created as you said.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.