2

After years of experimentation with editors, the fact is I prefer them as minimal as possible. I never use fancy features and the full-feature IDE's become bloated, heavy, and slow. Of course, when I do something that pretty much requires a specific IDE (like Android dev and Eclipse) I have no problems using it. But most of the time, I use gedit for programming.

However, I like many Emacs commands, and I want to use them occasionally. Is there a way to embed Emacs inside of gedit? For instance, I envision pressing alt-q (or whatever combo) and Emacs mode is enabled, and from then on all my key presses in the current tab do Emacs commands. I press alt-q again, and it turns off. This would allow me the best of both worlds. Anything like this exist, or do I need to write this plugin myself?

Mark Hurd
  • 10,665
  • 10
  • 68
  • 101
seibelj
  • 890
  • 2
  • 10
  • 22
  • 6
    Why use gedit at all if you can use Emacs? – Jesus Ramos Sep 30 '11 at 02:44
  • 3
    As for the "lean and mean" feel of gedit, it seems simpler and more straightforward to dumb down Emacs than to enhance Gedit to be more like Emacs. Embedding Emacs would certainly not make Gedit smaller or faster, but getting used to `emacsclient` will make Emacs feel a lot faster - just remember to not quit. – tripleee Sep 30 '11 at 06:56

3 Answers3

2

No.

I've seen discussion of embedding of Emacs in other applications in the past, and the consensus is that even that's not feasible, let alone what you're suggesting.

You'd be better off identifying what gedit does that makes you want to use it instead of Emacs, and extending Emacs to make it do that, too. (There can't be that much --- gedit doesn't do much.) The extra features can just sit there and wait for you, and you'll find it easier to locate and use them if you're comfortable in Emacs-mode already.

(On top of all the other advantages of Emacs, you gain the ability to use the same editor you use in a windowed environment on the terminal --- a huge advantage.)

Or maybe yes . . .

You can use the External Tools plugin of gedit (look for it in Preferences). Add a new command, bind it to the key you want, and use this script:

#!/bin/sh
FILE_NAME=$GEDIT_CURRENT_DOCUMENT_PATH 
emacs $FILE_NAME

If you want it to open in the currently-running Emacs, replace emacs with emacsclient, and add the following to your .emacs:

(server-start)
JasonFruit
  • 7,764
  • 5
  • 46
  • 61
2

This is kind of backward. Why don't you just use Emacs and stay away from all the extra bells and whistles? It'd probably be easier to coax emacs to emulate gedit than the other way around.

Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169
0

If gedit (a) can be scripted to launch another application with the current file as an argument, and (b) will notice if the file is modified on disk and offer to reload it, then you would have a workaround.

phils
  • 71,335
  • 11
  • 153
  • 198