[Geany-devel] Changes to templates

Matthew Brush matthewbrush at xxxxx
Sun Mar 13 08:18:38 UTC 2011


Hi,

I wasn't sure if I should make a feature request or a bug report, so if 
needed, let me know which and I'll file it on the project site.

The patch attached to this message does a few things, sorry I didn't 
split them into different patches, but it's so small and related that 
it's hardly worth it.

Here's what the patch does:

#1
--
Makes the indent parameter value used for calls to make_comment_block() 
a "global", so that it's settable from a single location.  It also makes 
it 3 instead of 8, where before it was 3 for function templates, and 8 
for license and fileheader.  I guess it's a matter of taste on this 
value, but IMHO, 8 is just too much.  This is related to feature request 
'Specify spacing before fileheader - ID: 3193527'[1].

#2
--
Strips whitespace from the start and end of the templates before passing 
to make_comment_block() so that trailing newlines are consistent.  I'm 
not sure if this is desired or not, but I think the resulting comment 
looks better than before where there was 2 empty comment lines before 
the closing */.  I'm also not sure if the 3 calls to g_strstrip() should 
be just a single call inside the make_comment_block() function. Also, 
not being very familiar with GString, I'm not 100% sure if calling 
g_strstrip() on the ->str member behind its back is OK, but it seems 
fine since g_strstrip() changes the string in place without changing the 
amount of memory used.

#3
--
Change filetypes.c to use /* */ style comments rather than // style, to 
prevent those ISO C90 warnings from GCC.  It's probably best to make the 
default for C not be C++ style comments.

With the small amount of testing I've done, it seems to all work fine.

[1] 
https://sourceforge.net/tracker/?func=detail&aid=3193527&group_id=153444&atid=787794

Cheers,
Matthew Brush (codebrainz)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: geany-template-indent.patch
Type: text/x-patch
Size: 3071 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20110313/e260ee81/attachment.bin>


More information about the Devel mailing list