[Geany-devel] Geany Plugin with Libxml

Enrico Tröger enrico.troeger at xxxxx
Sun Aug 9 09:50:54 UTC 2009

On Sat, 8 Aug 2009 14:00:52 +0200, Cédric wrote:


about compiling and your friend using Ubuntu:
sharing binary files (.so) between different systems and especially
between different distributions usually don't work (we are not on
Windows...) and it's not designed to work. Instead, compile the code
from source on the target platform, that should do the trick. If your
friend still don't get the plugin listed in the plugin manager dialog,
tell him to check Help->Debug Messages for details. There should be a
message indicating why it could not be loaded.

>Okay, here is an update => in case of invalid char, it won't shut down

Just for clarity, "shut down" seems the wrong term here. You are surely
talking about a crash. A shut down is something normal which is
expected but you are talking about a crash which happened because of
wrong code, I guess.

>geany. I also correct some other bugs, but DOCTYPE is currently not
>I'll try to add the options with what you sent me !

A few unsorted notes after having a short look at the plugin:

- it's a great idea. I personally probably won't use it much as I don't
use XML much but in general it's getting probably pretty useful for
many users.

- If you would use g_warning() and/or other g_foo() log functions, your
messages would also be available in Help->Debug Messages which makes
searching for information/warnings/errors easier as most users don't
run Geany from a console.

- If the menu item is activated, it always works on the whole document.
I think it's more intuitive and even more usable if it would work only
on the current selection if there is any and the whole document if
there is no selection. This is how most text modifiying functions work
in Geany (and other applications as well). Some very basic example code
could look like this:
gchar *buffer;
gint length;
if (sci_has_selection(sco))
	length = sci_get_selected_text_length(sco);
	buffer = g_malloc0(len + 1);
	if (buffer == NULL) { exit(-1); } //malloc error
	sci_get_selected_text(sco, buffer);
	length = sci_get_length(sco);
	buffer = g_malloc0(length + 1);
	if (buffer == NULL) { exit(-1); } //malloc error
	//retrieves the text
	sci_get_text(sco, length, buffer);

And remember I suggested to join the geany-plugins project [1] so your
code would be in the SVN repository and will be released with the next
geany-plugins combined release. 

[1] http://lists.uvena.de/pipermail/geany-devel/2009-June/000747.html


Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20090809/6f0dbccc/attachment.pgp>

More information about the Devel mailing list