GNOME Bugzilla – Bug 317112
Plugin to pipe to/from external programs
Last modified: 2019-03-23 20:33:37 UTC
Hi, Kenneth P. Turvey requested in Debian bug http://bugs.debian.org/329401 a plugin to filter Gedit's buffer with an external program. This might be a generic solution to bugs such as bug 143827. Bye,
getting access to the text buffer is pretty easy, just a matter of gedit_get_active_document (a gedit document is a GtkTextBuffer, so you can do anything on it including pulling all the text as a string). So this sort of plugin shouldn't be very hard to write. Note however that performance may not be optimal since you end up with another copy of the text in memory and then you need to reinsert the elaborated text in the GtkTextBuffer. With the upcoming feature of having python plugins, writing a plugin will be much easier: just a few lines of python and dropping the file in ~/.gnome2/gedit/plugins so I think that custom plugins for any sort of text operation will be easy to make. Obviously nothing stops you from invoking awk or other commands from python, if your really want :)
That's basically what the External Tools plugin does. So I'm going to close this bug as FIXED. Feel free to reopen the bug if I'm wrong.