Re: [Geany-devel] configuration save: utils_build_path?

2011-04-11 Thread Nick Treleaven
On Sun, 10 Apr 2011 13:16:26 +0300
Dimitar Zhekov dimitar.zhe...@gmail.com wrote:

  utils_build_path is really a bomb waiting to explode in someone's face
  (well code anyway :-).  It shouldn't be a general util, either it
  should be made safe or if some part of Geany uses enough paths that it
  really is a material overhead to allocate and deallocate buffers then
  it should be made a local function there, not a general util.
 
 +1. On a second thought, +10.

The reason I wrote it wasn't efficiency, but to avoid having to
manually free the string each time. I miss RAII :-/

I agree it's not safe and maybe we should remove it. I deliberately
didn't add it to the plugin API for this reason.

Regards,
Nick
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] Follow VTE project path patch

2011-04-11 Thread Nick Treleaven
Hi Nicolas,
I've now committed the patch, thanks.

On Sat, 02 Apr 2011 11:58:17 -0700
Matthew Brush mbr...@codebrainz.ca wrote:

 I tested and it worked fine.

Thanks for testing.

Regards,
Nick
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


[Geany-devel] ui_menu_add_document_items_sorted() and document_sort_by_display_name()

2011-04-11 Thread Nick Treleaven
On Sun, 10 Apr 2011 17:03:41 +
eh...@users.sourceforge.net wrote:

 Revision: 5705
   http://geany.svn.sourceforge.net/geany/?rev=5705view=rev
 Author:   eht16
 Date: 2011-04-10 17:03:41 + (Sun, 10 Apr 2011)
 
 Log Message:
 ---
 Add ui_menu_add_document_items_sorted() and document_sort_by_display_name() 
 to the plugin API.

Some comments on these:

 +/** GCompareFunc-like sort function to sort documents, e.g. in a GPtrArray by
 + *  their display names.
 + *  Display names means the base name of the document's file.
 + *
 + * @param a @c document a.
 + * @param b @c document b.
 + * @return negative value if a  b; zero if a = b; positive value if a  b.
 + *
 + *  @since 0.21
 + */
 +gint document_sort_by_display_name(gconstpointer a, gconstpointer b)

I think this should be renamed document_cmp_by_display_name
(or document_compare_by_display_name). The function doesn't actually
sort anything.

 +/** Adds a list of document items to @a menu.
 + *
 + * @a sort_func might be NULL to not sort the documents in the menu. In this 
 case,
 + * the order of the document tabs is used.
 + *
 + * See document_sort_by_display_name() for an example sort function.
 + *
 + * @param menu Menu.
 + * @param active Which document to highlight, or @c NULL.
 + * @param callback is used for each menu item's @c activate signal and 
 will be passed
 + * the corresponding document pointer as @c user_data.
 + * @param sort_func is used to sort the list. Might be @c NULL to not sort 
 the list.
 + * @warning You should check @c doc-is_valid in the callback.
 + * @since 0.21 */
 +void ui_menu_add_document_items_sorted(GtkMenu *menu, GeanyDocument *active,

I think it would be better if when sort_func is NULL the items are
sorted by display name, because in that case the function is the same as
ui_menu_add_document_items, so no one would pass NULL.

I think these 2 changes could actually be done without breaking the
ABI (even though the second one changes behaviour, it shouldn't affect
plugins badly).

 + for (i = 0; i  GEANY(sorted_documents)-len; i++)

The GEANY() macro does not do anything in core code BTW.

Regards,
Nick
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] Calltips broken after editing

2011-04-11 Thread Colomban Wendling
Le 11/04/2011 16:33, Nick Treleaven a écrit :
 Hi,
 Calltips appear to be broken after editing a document. They seem to
 work again after saving.
 
 This is probably related to real time tag parsing.

Hum, good catch. It seems to be due to the recent change not to update
the parent objects when updating in real-time (r5642), to fix
performance issues with geanyprj plugin (which adds lots of workspace
tags IIRC).

I'll revert this change for now, and will try to find out why it's
happening exactly, and how we could fix this.

Regards,
Colomban
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] Performance issues?

2011-04-11 Thread Colomban Wendling
Le 28/03/2011 22:37, Colomban Wendling a écrit :
 [...]
 Well its not really dependency aware, in the non-real-time version it
 does it by reparseing *all* files in the workspace when any one of
 them is saved, so there can be no inconsistency.
 It is the fact that its doing all of them on real-time update that is
 the performance problem, so we want to real-time parse only the file
 we are editing.
 
 True. Moreover -- as far as I can understand the TagManager code (so,
 only more or less :D) -- the parent updates will not be done in-memory,
 so it's definitely a problem we should solve.

This is at least not totally true if I trust strace (no IO during these
updates, in facts I had already checked this when I initially wrote the
in-memory stuff). At least without geanyprj.

 Not being certain what inconsistencies there might be, I'd suggest
 trying it, only parse the one file real-time and all the others at
 save time, ie apply Yura's patch (below) and see.
 
 Agreed. However the patch would *always* disable updating parent, what
 we probably don't want (though, not really sure what it'd change). So I
 have modified it and committed it to SVN (r5642).
 
 Hope this fixes the issue, feedback welcome.
 And guys, thanks a lot for tracking this down!

Unfortunately, this change broke calltips (see today's Nick's mail and
my answer). I then reverted this, and we have to find a better fix. I'll
try to track this further, though I can't promise anything in the next
days, nor I know GeanyPRJ, so if anybody beat me in time, it'd be great :D

Regards,
Colomban
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel