Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Can the system editor be changed?
Can the system editor be changed? [message #181050] Tue, 21 November 2006 12:25 Go to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
Platform: Intel Pentium M, Ubuntu Dapper,
Gnome desktop (2.14.3-0ubuntu1)
Sun j2sdk1.5,
eclipse 3.2.0

By default, the system editor is gedit. Is it possible to change this
to e.g. emacsclient?

I haven't found a setting for this in the eclipse preferences.

The EDITOR enviroment variable is already set to emacsclient, so that
isn't enough.

Thanx!


- Steinar
Re: Can the system editor be changed? [message #181056 is a reply to message #181050] Tue, 21 November 2006 13:06 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Steinar Bang <sb@dod.no>:

> Platform: Intel Pentium M, Ubuntu Dapper,
> Gnome desktop (2.14.3-0ubuntu1)
> Sun j2sdk1.5,
> eclipse 3.2.0

> By default, the system editor is gedit. Is it possible to change this
> to e.g. emacsclient?

> I haven't found a setting for this in the eclipse preferences.

> The EDITOR enviroment variable is already set to emacsclient, so that
> isn't enough.

I'm guessing eclipse is using the desktop's default text editor.
Found a way to change it here:
http://ubuntuforums.org/showthread.php?t=299086

But it looks like I have to create an emacsclient desktop entry. Is
that possible, I wonder? Is it a meaningful concept?
Re: Can the system editor be changed? [message #181097 is a reply to message #181056] Tue, 21 November 2006 17:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse4.rizzoweb.com

Steinar Bang wrote:
>>>>>> Steinar Bang <sb@dod.no>:
>
>> Platform: Intel Pentium M, Ubuntu Dapper,
>> Gnome desktop (2.14.3-0ubuntu1)
>> Sun j2sdk1.5,
>> eclipse 3.2.0
>
>> By default, the system editor is gedit. Is it possible to change this
>> to e.g. emacsclient?
>
>> I haven't found a setting for this in the eclipse preferences.
>
>> The EDITOR enviroment variable is already set to emacsclient, so that
>> isn't enough.
>
> I'm guessing eclipse is using the desktop's default text editor.
> Found a way to change it here:
> http://ubuntuforums.org/showthread.php?t=299086
>
> But it looks like I have to create an emacsclient desktop entry. Is
> that possible, I wonder? Is it a meaningful concept?

No, it is not a "meaningful concept." Eclipse does not use a system
editor like emacs or gedit; it has its own built-in editors.
What is is that you are trying to do? What problem are you having with
Eclipse?

Eric
Re: Can the system editor be changed? [message #181190 is a reply to message #181097] Tue, 21 November 2006 22:07 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Eric Rizzo <eclipse4@rizzoweb.com>:

> No, it is not a "meaningful concept." Eclipse does not use a system
> editor like emacs or gedit; it has its own built-in editors. What
> is is that you are trying to do?

I'm trying to change the editor picked when doing
Open With->System Editor
from the context menu.
Re: Can the system editor be changed? [message #181197 is a reply to message #181190] Tue, 21 November 2006 23:10 Go to previous messageGo to next message
Randy D. Smith is currently offline Randy D. SmithFriend
Messages: 394
Registered: July 2009
Senior Member
Steinar Bang wrote:
>>>>>> Eric Rizzo <eclipse4@rizzoweb.com>:
>
>> No, it is not a "meaningful concept." Eclipse does not use a system
>> editor like emacs or gedit; it has its own built-in editors. What
>> is is that you are trying to do?
>
> I'm trying to change the editor picked when doing
> Open With->System Editor
> from the context menu.

And now back to Linux, where things work differently than on Windows...

I agree, I couldn't find a preference to do what you want. It's clear
that it's depending on some notion of "system editor" that's not
configurable from Eclipse itself... and since we don't have any experts
for all the variations on Linux handy, maybe my trial and error can help
you a bit. I don't have an Ubuntu system handy, but on my openSuSE 10.1,
I found that if I modified the settings for appropriate "type(s)" in
/var/opt/gnome/cache/gnome-vfs/defaults.list, I could redirect the
invocation of gedit to instead invoke emacs. (What's emacsclient?) But
you might find you have to change a *lot* of gedits! Oh yes, and you'll
have to log out and log in for it to take effect of course.

Yes, I'm sure there's a handy configuration tool... I mean, after all,
there are SO MANY OF THEM! :-( But I couldn't find "the right one".

Of course, if Ubuntu is sufficiently different from SuSE, or if you're
on KDE instead of Gnome, or if the moon goes into a different phase
between now and when you read this, all bets are off! :-)

--
RDS

Randy D. Smith randy (dot) d (dot) smith (at) intel (dot) com
Eclipse TPTP Committer, Platform Proj (data collection/agent controller)
Re: Can the system editor be changed? [message #181205 is a reply to message #181197] Tue, 21 November 2006 23:25 Go to previous messageGo to next message
Steve Blass is currently offline Steve BlassFriend
Messages: 276
Registered: July 2009
Senior Member
ln -s gedit emacs ?

Randy D. Smith wrote:
> Steinar Bang wrote:
>>>>>>> Eric Rizzo <eclipse4@rizzoweb.com>:
>>
>>> No, it is not a "meaningful concept." Eclipse does not use a system
>>> editor like emacs or gedit; it has its own built-in editors. What
>>> is is that you are trying to do?
>>
>> I'm trying to change the editor picked when doing Open
>> With->System Editor
>> from the context menu.
>
> And now back to Linux, where things work differently than on Windows...
>
> I agree, I couldn't find a preference to do what you want. It's clear
> that it's depending on some notion of "system editor" that's not
> configurable from Eclipse itself... and since we don't have any experts
> for all the variations on Linux handy, maybe my trial and error can help
> you a bit. I don't have an Ubuntu system handy, but on my openSuSE 10.1,
> I found that if I modified the settings for appropriate "type(s)" in
> /var/opt/gnome/cache/gnome-vfs/defaults.list, I could redirect the
> invocation of gedit to instead invoke emacs. (What's emacsclient?) But
> you might find you have to change a *lot* of gedits! Oh yes, and you'll
> have to log out and log in for it to take effect of course.
>
> Yes, I'm sure there's a handy configuration tool... I mean, after all,
> there are SO MANY OF THEM! :-( But I couldn't find "the right one".
>
> Of course, if Ubuntu is sufficiently different from SuSE, or if you're
> on KDE instead of Gnome, or if the moon goes into a different phase
> between now and when you read this, all bets are off! :-)
>
Re: Can the system editor be changed? [message #181240 is a reply to message #181205] Wed, 22 November 2006 07:23 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Steve Blass <sblass@acm.org>:

> ln -s gedit emacs ?

That, I would classify under "hack"...:-)

(and the multitude other aliasings goes in the same bucket)
Re: Can the system editor be changed? [message #181250 is a reply to message #181056] Wed, 22 November 2006 08:03 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Steinar Bang <sb@dod.no>:

>>>>> Steinar Bang <sb@dod.no>:
>> Platform: Intel Pentium M, Ubuntu Dapper,
>> Gnome desktop (2.14.3-0ubuntu1)
>> Sun j2sdk1.5,
>> eclipse 3.2.0

>> By default, the system editor is gedit. Is it possible to change this
>> to e.g. emacsclient?

>> I haven't found a setting for this in the eclipse preferences.

>> The EDITOR enviroment variable is already set to emacsclient, so that
>> isn't enough.

> I'm guessing eclipse is using the desktop's default text editor.
> Found a way to change it here:
> http://ubuntuforums.org/showthread.php?t=299086

> But it looks like I have to create an emacsclient desktop entry. Is
> that possible, I wonder? Is it a meaningful concept?

Thanx to the helpful people on the emacs-help mailing list I found out
that I could create an emacsclient.desktop file, by copying the
existing emacs21.desktop to an emacsclient.desktop file and by
changing the command from "emacs" to "emacsclient".
http://comments.gmane.org/gmane.emacs.help/38853
http://comments.gmane.org/gmane.emacs.help/38856
http://comments.gmane.org/gmane.emacs.help/38857
http://comments.gmane.org/gmane.emacs.help/38863

What I now have is a $HOME/.local/share/applications/defaults.list
file that looks like this:

[Default Applications]
text/plain=emacsclient.desktop
text/xml=emacsclient.desktop
application/x-perl=emacsclient.desktop
text/x-chdr=emacsclient.desktop
text/x-csrc=emacsclient.desktop
text/x-dtd=emacsclient.desktop
text/x-java=emacsclient.desktop
text/mathml=emacsclient.desktop
text/x-python=emacsclient.desktop
text/x-sql=emacsclient.desktop

I had to map more types than text/plain to get it working. I would
have added text/html and application/xhtml+xml as well, because the
reason I'm doing this is to make GNU Emacs the system editor from
eclipse's PPW. But I was afraid that changing those would interfer
with the Gnome desktop's operation.

The emacsclient.desktop file I ended up with (also residing in
$HOME/.local/share/applications/), and which works for me, looks like
this (I changed as little as possible):

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Emacs 21 (X11)
GenericName=Emacs
Comment=GNU Emacs 21 Text Editor
Exec=/usr/bin/emacsclient
TryExec=emacsclient
Terminal=false
Type=Application
Icon=/usr/share/emacs/21.4/etc/gnu-32x32.xpm
Categories=Application;Development;
MimeType=text/plain
Re: Can the system editor be changed? [message #181257 is a reply to message #181197] Wed, 22 November 2006 08:09 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> "Randy D. Smith" <randy.d.smith@intel.com>:

> I agree, I couldn't find a preference to do what you want. It's
> clear that it's depending on some notion of "system editor" that's
> not configurable from Eclipse itself... and since we don't have any
> experts for all the variations on Linux handy, maybe my trial and
> error can help you a bit. I don't have an Ubuntu system handy, but
> on my openSuSE 10.1, I found that if I modified the settings for
> appropriate "type(s)" in
> /var/opt/gnome/cache/gnome-vfs/defaults.list, I could redirect the
> invocation of gedit to instead invoke emacs.

I didn't have to touch any central configuration files. It was enough
to put the changes in a $HOME/.local/share/applications/defaults.list
file.

> (What's emacsclient?)

emacsclient is a small program that can be used to open a file in a
new buffer, in an already running GNU emacs process.

> But you might find you have to change a *lot* of gedits!

Here are the entries I added (all of gedit's, in fact + text/xml. I
would have liked to add text/html and application/xhtml+xml as well,
but was afraid it would interfere with the desktop's operation):

text/plain=emacsclient.desktop
text/xml=emacsclient.desktop
application/x-perl=emacsclient.desktop
text/x-chdr=emacsclient.desktop
text/x-csrc=emacsclient.desktop
text/x-dtd=emacsclient.desktop
text/x-java=emacsclient.desktop
text/mathml=emacsclient.desktop
text/x-python=emacsclient.desktop
text/x-sql=emacsclient.desktop


> Oh yes, and you'll have to log out and log in for it to take effect
> of course.

Nope, I didn't. I didn't even have to restart eclipse for the changes
to take effect.

> Yes, I'm sure there's a handy configuration tool... I mean, after all,
> there are SO MANY OF THEM! :-( But I couldn't find "the right one".

Indeed. I've just yesterday discovered the joys of NetworkManager,
and the nm applet, as opposed to the Gnome network-tools...:-)

> Of course, if Ubuntu is sufficiently different from SuSE, or if
> you're on KDE instead of Gnome, or if the moon goes into a different
> phase between now and when you read this, all bets are off! :-)

:-)

(on I side note, I believe these changes may work for KDE as well)
Re: Can the system editor be changed? [message #181791 is a reply to message #181257] Mon, 27 November 2006 13:22 Go to previous message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Steinar Bang <sb@dod.no>:

>>>>> "Randy D. Smith" <randy.d.smith@intel.com>:

>> Of course, if Ubuntu is sufficiently different from SuSE, or if
>> you're on KDE instead of Gnome, or if the moon goes into a
>> different phase between now and when you read this, all bets are
>> off! :-)

> (on a side note: I believe these changes may work for KDE as well)

I've later been told that under KDE (unknown version, on an unknown
version of Fedora), just setting EDITOR was enough to make eclipse
change its system editor.

(I already had that setting, and it wasn't enough under Ubuntu
Dapper/Gnome. That's why this thread was started)
Previous Topic:elements in a GROUP are not visible
Next Topic:Changing Eclipse.org UserID/PWord?
Goto Forum:
  


Current Time: Thu Apr 25 21:04:27 GMT 2024

Powered by FUDForum. Page generated in 0.08634 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top