EmilyDirsh / hotwire-shell

Automatically exported from code.google.com/p/hotwire-shell
Other
0 stars 0 forks source link

UI for setting custom editor path and args #163

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
it fails with the callback:

Traceback (most recent call last):
  File "/media/sda2/tools/hotwire-shell.git/hotwire_ui/renderers/file.py", line
219, in __on_edit_activated
  File "c:\tools\hotwire-shell.git\hotwire_ui\adaptors\editors.py", line 86, in
run
    self.run_with_callback(cwd, file, None, **kwargs)
  File "c:\tools\hotwire-shell.git\hotwire_ui\adaptors\editors.py", line
105, in
 run_with_callback
    proc = subprocess.Popen(args, env=self._get_startup_env(), cwd=cwd)
  File "c:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "c:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
TypeError: environment can only contain strings

with the attached patch applied, it fails with:
Traceback (most recent call last):
  File "/media/sda2/tools/hotwire-shell.git/hotwire_ui/renderers/file.py", line
219, in __on_edit_activated
  File "c:\tools\hotwire-shell.git\hotwire_ui\adaptors\editors.py", line 86, in
run
    self.run_with_callback(cwd, file, None, **kwargs)
  File "c:\tools\hotwire-shell.git\hotwire_ui\adaptors\editors.py", line
105, in
 run_with_callback
    proc = subprocess.Popen(args, env=self._get_startup_env(), cwd=cwd)
  File "c:\Python25\lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "c:\Python25\lib\subprocess.py", line 816, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

Still no good, but a step further. I'm not sure if it affects other
platform or not, so I'm asking for testing here.

Original issue reported on code.google.com by Zeng.Shi...@gmail.com on 3 Mar 2008 at 8:00

Attachments:

GoogleCodeExporter commented 9 years ago
This patch looks good, thanks!

Original comment by cgwalt...@gmail.com on 3 Mar 2008 at 8:03

GoogleCodeExporter commented 9 years ago
Committed r1111
        M       hotwire_ui/adaptors/editors.py
r1111 = ae0bdbbda2c34b42139b615643a05eed405cef74 (trunk)

I'll let this issue open, because we need an entry to let the user specify the 
actual
file path.

Original comment by Zeng.Shi...@gmail.com on 3 Mar 2008 at 8:12

GoogleCodeExporter commented 9 years ago
Hm, you mean the path to the Emacs binary?  We can't be sure to find it in PATH?

Original comment by cgwalt...@gmail.com on 3 Mar 2008 at 8:38

GoogleCodeExporter commented 9 years ago
No, we can't.

At least for me, i don't like to add everything to PATH. I'd like to specify it
explicitly. Perhaps it's just a personal preference. But sometime, you have to 
do so,
because you have different versions of one software for different purposes.

P.S. I'm also thinking about giving users the possibility to add an arbitrary 
editor
by specifying its 'name', 'icon' and 'cmd (format)'.

Original comment by Zeng.Shi...@gmail.com on 3 Mar 2008 at 8:46

GoogleCodeExporter commented 9 years ago
Yeah, we'll need the ability to specify an arbitrary editor.  The UI I'm 
thinking of
is basically the same as the GNOME Panel's "Add Custom Application Launcher".

Original comment by cgwalt...@gmail.com on 3 Mar 2008 at 8:56

GoogleCodeExporter commented 9 years ago
One thought occurs to me; we probably shouldn't unconditionally override the 
EDITOR
environment variable.  That way you could do whatever you want with:

import os
os.environ['EDITOR'] = '/path/to/emacs --blah'

in ~/.hotwire/plugins/myeditor.py

But we still want a UI for this probably; changing bug subject.

Original comment by cgwalt...@gmail.com on 3 Mar 2008 at 8:58

GoogleCodeExporter commented 9 years ago
Partial work on this:

Committed r1170
    M   hotwire_ui/adaptors/editors.py
r1170 = 490aaeecb39e3b9598a6ff856e7473b01d0ac13e (git-svn)

Original comment by cgwalt...@gmail.com on 23 Mar 2008 at 5:32