gedit OS X for realz

My first ever blog post on gnome blogs, and about time. Today I ‘finished’ my earlier porting of gedit to OS X. Although we did the initial port some time ago, it was more a proof-of-concept than actually something usable. That is, I was the only one who could use it. Not any more though! I finally sat down to make it into an actual OS X App Bundle (using the excellent ige-mac-bundler). We include everything that we need in there, so it should be entirely standalone. That also means that the full thing is about 100 MB :(

I was pretty impressed by how well OS X is supported by gtk+ and friends already, but I did hit some snags on the way. One of them was gconf. We decided that it would be simpler for now not to involve dbus, so we went with gconf 2.22. Unfortunately, gconf has hardcoded install paths, and since we want to put everything in a single bundle, this was causing some problems. In the end I patched it to replace the compile time prefix with a prefix set as an environment variable. Other than that I had some issues with python modules installing in the wrong place, and I had to patch ige-mac-integration in some places to get a bit nicer menu integration (especially accelerators). All in all pretty smooth, but still about a days work to get it all done.

So, what do you get? If you’re the proud owner of a Mac (running OS X 10.4 intel), feel free to download the installer for gedit 2.26.2. After downloading, you should be prompted with the following:

After launching gedit, you should be prompted with something like this:

 

So there it is, gedit nicely running on OS X natively. It features:

  • Menu integration (including appropriate shortcuts)
  • Full support for plugins (both C and Python)
  • Everything else you expect from gedit

Of course there are still some things to be done:

  • There is no help yet (somehow, building the help eats all of my 4G of mem, crashing python for xmlpo)
  • More and more integration (proxy icon, dock menu)
  • Translations do not seem to be working at the moment

Update:
There is a new dmg 
including help, translations, better integration (proxy icon, closing/quitting) and most of the plugins in gedit-plugins.

    This entry was posted in gedit. Bookmark the permalink.

    26 Responses to gedit OS X for realz

    1. BHSPitMonkey says:

      I can’t express how happy this makes me. Thank you!

      *Off to download right away*

    2. David Hillshafer says:

      Thank you. I was using gedit in X11 through Darwin Ports. It kept giving me errors and wouldn’t change preferences. Not only does this act natively, but it even knew all my previously saved documents from gedit.

      While playing around, I noticed a few quirks in the system. I don’t know if you are aware of these, but I thought I would bring them to your attention. (I’m running OS X 10.5.7)
      1. going to full screen hides the menu bar, the button bar, and gives no left margin (aesthetically unpleasant).
      2. You cannot use F11, F9, or (command)+F9 in gedit without changing the OS X presets for Expose. I’m not sure what you might want to do about this, if anything.
      3. Coming out of full screen puts a menu bar above the button bar (like in X11) in addition to the global menu bar. This doesn’t destabilize the system, but it is bad form to have two menu bars. Also, it brings back the Tools menu.
      4. On your website, please post updates above (not below) older versions to make them more apparent.

      In the (Easter Egg?) Tools menu, Document Statistics worked. Remove trailing spaces worked, but it took a little while and gave me a watch symbol (like OS 9) and not the OS X spinning beach ball. I don’t use the other functions in Tools, so I can’t verify them.

      All in all, a great job! I hope I’ve helped you improve the port even more.

    3. jessevdk says:

      I think all of those issues have been reported (they are in our bug tracker), and I hope to find some time soon to resolve them. The solution for the keybindings is to simply find others that do not conflict with defaults on OS X (like F9).

      With regard to updates, they are now listed on the official gedit website, and we’ll provide an OS X package for every new release. We (that is, nacho), have just implemented a plugin that will check for updates on Win32 and OS X. I just released a dmg for 2.27.2 which you might want to check out (it’s our development branch though).

      The tools, most of them actually don’t work because they are linux specific, there is also a bug open about this and hopefully will be resolved soon. The cursor I will have to check, this probably requires some fixing in gdk.

    4. I just stumbled upon this post and just wanted to tell you how great this is. Being able to runt my favourite text editor on OS X is really nice.

      Good work!

    5. Esdras says:

      I was trying to install gedit for a few days using ports, and then I found this. Great, downloading right now. I’m used to use gedit on Linux and I’m missing it.

    6. HAHAHAHA!!! Installed gedit via darwin ports which took me several hours! And it worked but I was unable to change any settings!

      While googling about this I found your page and this AWESOME port!!! Works like a charm!

      Thank you very much for this! It would be great if you continued to port future versions of gedit! Your web page is now found on my bookmarks!

      Best regards
      Johan Linnarsson
      Sweden

    7. Sebastian says:

      Hey there,
      this looks awesome! Now, is there any possibility to get the Latex plugin to work with the OSX port? I tried to copy it into the package. It gets listed but unfortunately, once I click on it, it gets grayed out and nothing happens… getting this to run would be really really awesome :)

      all the best,
      Sebastian

    8. jessevdk says:

      As you are probably aware of, the latex plugin is not maintained by us. What you can do is launch gedit from the terminal and see what the exact error message is. Then contact the maintainer to see if it can be fixed (or file a bug in our bugzilla if it’s something we can fix instead of the plugin).

    9. p cohen says:

      Beautiful! thanks a lot.

    10. Märt says:

      Well I ran into a weird problem. I cannot “Open with…” any text files. My Leopard does not recommend me to open any files with gedit and if I “force” it to open with gedit, then gedit just crashes. I would really love to fix it.

    11. Jesse van den Kieboom says:

      It’s a known problem. The issue is that opening a file like that on OS X is not the same as on linux (meaning, it doesn’t just call the gedit executable with the filename as its argument). The issue can be fixed by implementing some handlers for some OS X messages, which I have to check still (it should not be too hard).

      I don’t know why gedit crashes btw, that shouldn’t happen. Anyway, I think there is already a bug open in bugzilla about the file open problem.

    12. Alex says:

      I’m also trying to get the gedit latex plugin to work. It installs fine, the problem is it fails to run the rubber executable in /opt/local/bin. Is there anything I need to do to make gedit look in that folder for executables?

    13. Jesse van den Kieboom says:

      Just the same as any executable, you’ll have to include /opt/local/bin in your PATH environment variable. You can try to add it in the gedit startup script (it’s inside the bundle).

    14. Alex says:

      Thanks Jesse,

      I’ve added:
      export PATH=$PATH:/opt/local/sbin/:/opt/local/bin
      to /Applications/gedit.app/Contents/MacOS/gedit

      That did it! Latex to PDF works using rubber! I’ve also changed the Gedit LaTeX Plugin 0.2 RC2 to use Skim rather than evince to show the compiled PDF document. Everything works flawlessly.

      The build is much faster than what I get with Textmate, so this is hands down the best latex editor out there for OSX!

      Thanks for the port Jesse :D
      And of course thanks to Michael for the excellent latex gedit plug in!

    15. Sebastian says:

      Hey Alex,
      good to hear you got it working. I am still not able to make it run. What exactly did you do to find out that the rubber exec could not be opened? What Latex Dist. have you installed. I use MacTex08 but there is no rubber…

      Sebastian

    16. Alex says:

      Hey Sebastian,

      You can install rubber through MacPorts. It is a separate tool from texlive/mactex/tetex. The gedit latex plugin displays compilation errors in the bottom pane of gedit. It told me that the rubber executable could not be found (though I could run it just fine from the terminal). Setting the path in the gedit startup script fixed that.

      If you’re still having trouble I can post more detailed instructions.

    17. John Pye says:

      Great work! Downloading it now. It could do with some more publicity, e.g. on GTK-OSX wiki, and on GTK+ wiki…

    18. Sebastian says:

      Hey Alex,

      well… i gave you instructions a shot but i still can’t get it to work. I also do not get any compiling errors when I try to activate the latex plugin. What am I doing wrong?

    19. Dan says:

      Any change of status on the “Open with…” bug?

      Is there a bug report somewhere on this that I can track?

      Great job on the DMG package!!

      I am going to try to add some language specific file for ruby.

      Thanks

      Dan

    20. Dan says:

      Thanks for the bugtrak info. I do not see any info about when/if it might be fixed. Is there anything you can tell us that might let us know?

      Its obviously not critical, but I sure wish it worked ;-)

      About the language files, I mean of course programming language:

      /usr/share/gtksourceview-2.0/language-specs/rhtml.lang

      and others that describe mime types and file types that fill out the limited support for ruby and rails.

      This is from my ubuntu system, The location is a subdir similar to your install (I hope).

      I gathered these and some useful pluginsfor development project. I bounce back and forth between mac and linux so your package is really helpful.

      I am very tied up for a few days but will eventually try out these files and plugins to see if they work. I will plop a msg when I do. I will also kind of document this but it probably won’t win a pulitzer.

      -Dan

    21. Jesse van den Kieboom says:

      It doesn’t have a very high priority because there are many things to do and we’re a small team. To be notified when anything happens you can subscribe to that bug report so that you receive an e-mail when anything happens.

      There are some plugins out there for ruby on rails:

      1. http://robzon.aenima.pl/2007/10/ubuntu-710-rails-gedit-and.html
      2. http://github.com/mig/gedit-rails

      Don’t know how good the stuff is, haven’t tried it myself. If you have any immediate questions by the way, feel free to drop by on IRC (#gedit on gimpnet)

    22. Dan says:

      Well… I think passing a filename argument to an editor app would be somewhat important and lack thereof a bit on the annoying side. But I know what you mean – I am working around the clock and still cannot get everything done ;-)

      Is the fix known, but just no time to implement? If not known, what would one need to track it down? Would a full blown Mac development environment be needed or just a few tools?

      I am a very experienced programmer and good troubleshooter, but totally new to the Mac environment.

      If I could help by looking for the fix, just let me know what to download and I would be happy to squeeze in a few hours of troubleshooting.

      Just want to be able to double-click on .rb file! ;-)

      -Dan

    23. Jesse van den Kieboom says:

      The fix is not entirely know, apart we should listen for Apple Events (http://developer.apple.com/legacy/mac/library/documentation/AppleScript/Conceptual/AppleEvents/intro_aepg/intro_aepg.html) and handle the right ones appropriately. Other than that it’s a matter of time.

      Setting up the built environment for building gedit could be a bit of a hassle, you’ll have to use jhbuilt to built the gtk+, glib modules, and there are some custom patches in my github (http://github.com/jessevdk).

    24. Danny says:

      We need more posts like this!

    Comments are closed.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>